#include <pointer.h>
Inheritance diagram for base::pointer_t< T >:
Public Member Functions | |
pointer_t () | |
Default constructor. | |
pointer_t (T *ptr, size_t max) | |
Constructor:. | |
bool | isSamePointerAs (const pointer_t< T > &other) const |
Pointer equality testing. | |
T & | operator[] (size_t at) |
wrap and check ptr[at] | |
const T | operator[] (size_t at) const |
wrap and check read only ptr[at] | |
T * | operator-> () |
wrap and check ptr->something | |
T & | operator * () |
wrap and check *ptr | |
size_t | size () const |
size of pointed area in T nb of elements | |
void | reset () |
reset all pointed elements | |
uint32_t | hash () const |
void | copyFrom (const pointer_t< T > &src) |
copy all pointed elements from a pointer. | |
const T * | begin () const |
Simple iteration. | |
const T * | end () const |
T * | begin () |
T * | end () |
const T * | operator() () const |
Reading data. | |
Protected Attributes | |
T * | data |
data pointed | |
size_t | capa |
size of data, important for checks |
This is a pointer to some bounded memory. array_t is defined too, but pointer_t has no memory management, it is only a reference. Accesses ptr[i] are checked. Main purpose is debugging + simple iteration. std::vector does not provide these debugging capabilities. Everything is assumed to be 32 bits aligned so this wrapper is obviously not designed for int8 or int16 types.
|
Default constructor.
|
|
Constructor:.
|
|
|
|
Simple iteration.
|
|
copy all pointed elements from a pointer.
|
|
|
|
|
|
|
|
Pointer equality testing. It is ambiguous to define a == operator since it could be interpreted as pointer or content testing. |
|
wrap and check *ptr
|
|
Reading data.
|
|
wrap and check ptr->something
|
|
wrap and check read only ptr[at]
|
|
wrap and check ptr[at]
|
|
reset all pointed elements
|
|
size of pointed area in T nb of elements
|
|
size of data, important for checks
|
|
data pointed
|