Definition at line 19 of file Buffer.h.
◆ Buffer() [1/3]
Definition at line 14 of file Buffer.cc.
14: m_memory(NULL), m_size(0), m_allocated(false) {}
◆ Buffer() [2/3]
Buffer |
( |
unsigned int |
size, |
|
|
unsigned char * |
memory = NULL |
|
) |
| |
Definition at line 16 of file Buffer.cc.
17 : m_memory(memory), m_size(size), m_allocated(false)
18{
19 if (memory == NULL && size > 0) {
20 m_memory = new unsigned char[size];
21 ::memset(m_memory, 0, size);
22 m_allocated = true;
23 }
24}
◆ Buffer() [3/3]
Definition at line 26 of file Buffer.cc.
27 : m_memory(NULL), m_size(buf.m_size),
28 m_allocated(buf.m_allocated)
29{
30 if (m_allocated) {
31 m_memory = new unsigned char [buf.m_size];
32 ::memset(m_memory, 0, buf.m_size);
33 ::memcpy(m_memory, buf.m_memory, buf.m_size);
34 } else {
35 m_memory = buf.m_memory;
36 }
37 m_size = buf.m_size;
38}
◆ ~Buffer()
Definition at line 40 of file Buffer.cc.
41{
42 if (m_allocated && m_memory != NULL) {
43 delete [] m_memory;
44 m_allocated = false;
45 m_memory = NULL;
46 }
47}
◆ available()
virtual bool available |
( |
| ) |
|
|
inlinevirtual |
Definition at line 33 of file Buffer.h.
33{ return m_memory != NULL; }
◆ operator=()
Definition at line 49 of file Buffer.cc.
50{
51 if (m_allocated) {
52 delete [] m_memory;
53 }
54 m_allocated = buf.m_allocated;
55 if (m_allocated) {
56 m_memory = new unsigned char [buf.m_size];
57 ::memset(m_memory, 0, buf.m_size);
58 ::memcpy(m_memory, buf.m_memory, buf.m_size);
59 } else {
60 m_memory = buf.m_memory;
61 }
62 m_size = buf.m_size;
63 return *this;
64}
◆ ptr() [1/2]
◆ ptr() [2/2]
const unsigned char * ptr |
( |
| ) |
const |
|
inline |
◆ size()
unsigned int size |
( |
| ) |
const |
|
inline |
◆ m_allocated
◆ m_memory
◆ m_size
The documentation for this class was generated from the following files: