ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
dynamic_memoryblock.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <adtf_base.h>
10 
11 namespace adtf
12 {
13 
14 namespace disptb
15 {
16 
17 namespace graphicslib
18 {
19 
20 namespace dengar
21 {
22 
29 {
30 public:
43  virtual tResult Append(const tVoid* pvData, tInt nDataSize) = 0;
44 
53  virtual tVoid* GetPtr() = 0;
54 
60  virtual tSize GetSize() = 0;
61 
67  virtual tResult Reset() = 0;
68 
79  virtual tResult SetIncrement(tInt nNewIncrement) = 0;
80 
84  virtual tVoid Destroy() = 0;
85 
86 protected:
91  {}
92 };
93 
102 {
103 
108 
109 public:
114 
119 
120 public: // implements IDynamicMemoryBlock
121 
123  tResult Append(const tVoid* pvData, tInt nDataSize);
124 
125  tVoid* GetPtr();
126 
127  tSize GetSize();
128 
129  tResult Reset();
130 
131  tResult SetIncrement(tInt nNewIncrement);
132 
133  tVoid Destroy();
135 
136 protected:
138  util::cMemoryBlock* m_pData;
144  tUInt32 m_ui32UsedSize;
145 
146 private:
148  tResult AdjustMemoryBlock(tInt nBytesToAppend);
150 };
151 
152 }
155 
156 }
157 
158 }
159 
160 }
The IDynamicMemoryBlock interface extends allocated memory dynamically.
virtual tResult Reset()=0
Resets the size.
virtual tResult Append(const tVoid *pvData, tInt nDataSize)=0
Append data to the allocated memory.
virtual tVoid Destroy()=0
Destroys the object and frees the allocated memory.
virtual tSize GetSize()=0
Get the amount of used memory in bytes.
virtual tVoid * GetPtr()=0
Get a pointer to the allocated memory.
virtual tResult SetIncrement(tInt nNewIncrement)=0
Sets the allocated memory growing size Default growing size is 256 bytes.
A_UTILS_D(cDynamicMemoryBlock)
D-Pointer implementation.
util::cMemoryBlock * m_pData
Memory block for allocation, deletion.
Main namespace.