ADTF
3.18.2
|
Classes | |
class | cMemoryPtrPrivate |
Public Member Functions | |
cMemoryPtr () | |
Default constructor. | |
cMemoryPtr (tVoid *pvData, tSize nSize) | |
Constructor for presetting the assigned buffer. More... | |
cMemoryPtr (const cMemoryPtr &oMemObject) | |
Copy constructor. More... | |
tBool | IsReference () |
Check whether the object owns its memory or is attached to an external buffer. More... | |
tResult | Attach (tVoid *pvData, tSize nSize) |
Attaches the object to an external buffer. More... | |
tResult | Attach (const cMemoryPtr &oMemObject) |
Attches the object to an external buffer. More... | |
tResult | Detach () |
Detaches the object from an external buffer. More... | |
virtual | ~cMemoryPtr () |
Destructor. | |
tVoid | Free () |
Frees all allocated memory and detaches from external buffers. | |
tResult | Alloc (tSize nDataSize) |
Allocates memory. More... | |
tResult | Assign (const tVoid *pvData, tSize nDataSize) |
Copies external data to a newly allocated buffer. More... | |
tResult | Assign (const cMemoryPtr &oMemObject) |
Copies external data to a newly allocated buffer. More... | |
tResult | CopyTo (tVoid *pvBuffer, tSize nBufferSize) |
Copies data to an external buffer. More... | |
const tVoid * | GetPtr () const |
Get a pointer to the data. More... | |
tVoid * | GetWritePtr () const |
Get a pointer to the data. More... | |
tSize | GetSize () const |
Get the size of the memory region. More... | |
tUInt | Ref () |
Increase reference counter. More... | |
tUInt | Unref () |
Decrease reference counter. More... | |
tVoid | Destroy () |
Destroys the object and frees all allocated resources. | |
operator const tVoid * () const | |
Returns a pointer to the data. More... | |
tVoid * | operator= (const cMemoryPtr &oMemObject) |
Copies data. | |
tBool | operator== (tVoid *pvData) const |
Checks whether an object handles a memory region. More... | |
Protected Attributes | |
tUInt | m_nReferenceCounter |
Reference counter. | |
tVoid * | m_pvData |
Pointer to data. | |
tSize | m_nDataSize |
Size of data. | |
tBool | m_bReference |
Is reference. | |
Definition at line 22 of file memoryptr.h.
|
inline |
Constructor for presetting the assigned buffer.
The data is copied to a new buffer.
pvData | [in] The buffer. |
nSize | [in] The size of the buffer. |
Definition at line 63 of file memoryptr.h.
References tFalse.
|
inline |
Copy constructor.
oMemObject | [in] The object to copy from. |
Definition at line 79 of file memoryptr.h.
References cMemoryPtr::m_nDataSize, cMemoryPtr::m_pvData, and tFalse.
Allocates memory.
nDataSize | [in] The amount of memory in bytes. |
Definition at line 178 of file memoryptr.h.
References A_UTILS_NS::MEMPTR_WRONG_SIZE_PARAM_MASK, RETURN_ERROR, and RETURN_NOERROR.
|
inline |
Copies external data to a newly allocated buffer.
oMemObject | [in] The data to copy. |
Definition at line 228 of file memoryptr.h.
References cMemoryPtr::m_nDataSize, and cMemoryPtr::m_pvData.
Copies external data to a newly allocated buffer.
pvData | [in] The data to copy. |
nDataSize | [in] The size of the data. |
Definition at line 211 of file memoryptr.h.
References cMemoryBlock::MemCopy(), RETURN_IF_FAILED, RETURN_IF_POINTER_NULL, and RETURN_NOERROR.
|
inline |
Attches the object to an external buffer.
oMemObject | [in] The external buffer. |
Definition at line 131 of file memoryptr.h.
References cMemoryPtr::m_nDataSize, and cMemoryPtr::m_pvData.
Attaches the object to an external buffer.
pvData | [in] The buffer. |
nSize | [in] The size of the buffer. |
Definition at line 108 of file memoryptr.h.
References A_UTILS_NS::MEMPTR_WRONG_SIZE_PARAM_MASK, RETURN_ERROR, RETURN_NOERROR, and tTrue.
Copies data to an external buffer.
pvBuffer | [in] The destintion buffer. |
nBufferSize | [in] The amount of bytes to copy. |
Definition at line 242 of file memoryptr.h.
References cMemoryBlock::MemCopy(), A_UTILS_NS::MEMPTR_WRONG_SIZE_PARAM_MASK, RETURN_ERROR, RETURN_IF_POINTER_NULL, and RETURN_NOERROR.
|
inline |
Detaches the object from an external buffer.
Definition at line 140 of file memoryptr.h.
References RETURN_NOERROR.
|
inline |
Get a pointer to the data.
Definition at line 267 of file memoryptr.h.
|
inline |
Get the size of the memory region.
Definition at line 287 of file memoryptr.h.
|
inline |
Get a pointer to the data.
Definition at line 277 of file memoryptr.h.
|
inline |
Check whether the object owns its memory or is attached to an external buffer.
Definition at line 96 of file memoryptr.h.
|
inline |
Returns a pointer to the data.
Definition at line 338 of file memoryptr.h.
Checks whether an object handles a memory region.
pvData | The memory region. |
Definition at line 359 of file memoryptr.h.
|
inline |
Increase reference counter.
Definition at line 297 of file memoryptr.h.
|
inline |
Decrease reference counter.
Definition at line 306 of file memoryptr.h.