blob: d0836919b99811fa6b50349080a5b608c6d637ff (
plain)
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
|
#pragma once
#include "drape/buffer_base.hpp"
#include "std/vector.hpp"
#include "std/shared_ptr.hpp"
namespace dp
{
class CPUBuffer : public BufferBase
{
typedef BufferBase base_t;
public:
CPUBuffer(uint8_t elementSize, uint16_t capacity);
~CPUBuffer();
void UploadData(void const * data, uint16_t elementCount);
// Set memory cursor on element with number == "elementNumber"
// Element numbers start from 0
void Seek(uint16_t elementNumber);
// Check function. In real world use must use it only in assert
uint16_t GetCurrentElementNumber() const;
unsigned char const * Data() const;
private:
unsigned char * NonConstData();
unsigned char * GetCursor() const;
private:
unsigned char * m_memoryCursor;
shared_ptr<vector<unsigned char> > m_memory;
};
} //namespace dp
|