-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathprpl-cellStream.h
47 lines (36 loc) · 1.27 KB
/
prpl-cellStream.h
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
45
46
47
#ifndef PRPL_CELLSTREAM_H
#define PRPL_CELLSTREAM_H
#include "prpl-basicTypes.h"
namespace pRPL {
class CellStream {
public:
CellStream();
~CellStream();
pRPL::CellStream& operator=(const pRPL::CellStream &rhs);
void clear();
size_t size() const;
int getTotalCellCount() const;
vector<int>& getCellCounts();
const vector<int>& getCellCounts() const;
const vector<pair<unsigned int, unsigned int> >& getLayerInfos() const;
bool resize();
void* getStream();
const void* getStream() const;
bool addLayer(int lyrID,
unsigned int typeSize);
bool addCell(long cellIdx,
const void *aCellVal);
unsigned int getNumLayers() const;
unsigned int getNumCellsOnLayer(int lyrID) const;
unsigned int getTypeSizeOnLayer(int lyrID) const;
void* getCellsOnLayer(int lyrID);
private:
vector<pair<unsigned int, unsigned int> >::const_iterator _getLayerInfo(int lyrID) const;
private:
size_t _size;
void *_aStream; // pair<long, ANY_TYPE>: Cell index, Cell value
vector<int> _vCellCounts; // numbers of cells on Layers
vector<pair<unsigned int, unsigned int> > _vLayerInfos; // Layer index, data type size
};
};
#endif