-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBlkArray.h
More file actions
48 lines (31 loc) · 786 Bytes
/
Copy pathBlkArray.h
File metadata and controls
48 lines (31 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef __BLOCK_ARRAY_H__
#define __BLOCK_ARRAY_H__
class CBlkArray
{
public:
CBlkArray(int blk);
CBlkArray();
~CBlkArray(void);
protected:
void SetSize(int nNewSize );
// Operations
// Clean up
public:
int GetSize() { return m_Length; };
void SetBlkSize(int blk);
void RemoveAll(){ SetSize(0); };
// Direct Access to the element data (may return NULL)
u_int8_t * GetData() const { return m_pData; };
// Accessing elements
void SetAt(int nIndex, void * newElement);
u_int8_t * Add(void * newElement);
void RemoveAt(int nIndex, int nCount = 1);
// Implementation
protected:
u_int8_t * m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_Length;
int m_BlkSize;
};
#endif