A DynamicMallocUInt8ArrayLite extends DynamicUInt8ArrayLite to use malloc and realloc to resize the array. More...
#include <dynamic-malloc-uint8-array-lite.hpp>
Public Member Functions | |
| DynamicMallocUInt8ArrayLite (size_t initialLength) | |
| Create a DynamicMallocUInt8ArrayLite with a buffer of the initial length. More... | |
| ~DynamicMallocUInt8ArrayLite () | |
| Free the malloced array. | |
Public Member Functions inherited from ndn::DynamicUInt8ArrayLite | |
| DynamicUInt8ArrayLite (uint8_t *array, size_t length, ndn_ReallocFunction reallocFunction) | |
| Create a DynamicUInt8ArrayLite with the given array buffer. More... | |
| uint8_t * | getArray () |
| Get the current allocated array. More... | |
| const uint8_t * | getArray () const |
| size_t | getLength () const |
| Get the current length of the allocated array. More... | |
| ndn_Error | ensureLength (size_t length) |
| Ensure that getLength() is greater than or equal to length. More... | |
| ndn_Error | copy (const uint8_t *value, size_t valueLength, size_t offset) |
| Copy value into this object's array at offset, using ensureLength to make sure the array has enough length. More... | |
| ndn_Error | ensureLengthFromBack (size_t length) |
| Ensure that getLength() is greater than or equal to the given length. More... | |
| ndn_Error | copyFromBack (const uint8_t *value, size_t valueLength, size_t offsetFromBack) |
| First call ensureLengthFromBack to make sure this object's array has offsetFromBack bytes. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ndn::DynamicUInt8ArrayLite | |
| static DynamicUInt8ArrayLite & | downCast (ndn_DynamicUInt8Array &dynamicArray) |
| Downcast the reference to the ndn_DynamicUInt8Array struct to a DynamicUInt8ArrayLite. More... | |
|
static const DynamicUInt8ArrayLite & | downCast (const ndn_DynamicUInt8Array &dynamicArray) |
Protected Member Functions inherited from ndn::DynamicUInt8ArrayLite | |
| void | setArrayAndLength (uint8_t *array, size_t length) |
| Set the array and length. More... | |
A DynamicMallocUInt8ArrayLite extends DynamicUInt8ArrayLite to use malloc and realloc to resize the array.
Note that the destructor frees the memory; if you continue to need the array, you must copy getArray() before this object is destructed. We also disable the copy constructor and assignment operator because we don't do reference counting of the malloced array. If your lightweight platform doesn't support malloc then don't link to this file, and use DynamicUInt8ArrayLite directly with a fixed-size array.
| ndn::DynamicMallocUInt8ArrayLite::DynamicMallocUInt8ArrayLite | ( | size_t | initialLength | ) |
Create a DynamicMallocUInt8ArrayLite with a buffer of the initial length.
| initialLength | The initial size of the malloced array. This may be 0. |
1.8.6