#include <data_types.h>
Classes | |
class | PrivateImplementation |
Subclass for storing further members and attaching an overloadable dtor. More... | |
Public Member Functions | |
DataPointer (DataPointer &&other) | |
DataPointer (DataPointer &other) | |
DataPointer (unsigned char *pointer, unsigned int size, PrivateImplementation *private_impl=0) | |
unsigned char * | get_raw_pointer () const |
bool | valid () |
Indicator for nullpointer / no data contained if false. More... | |
~DataPointer () | |
Delete the private implementation with its derived dtor. More... | |
Protected Attributes | |
unsigned char * | m_pointer |
unsigned int | m_size |
Private Attributes | |
PrivateImplementation * | m_private_impl |
Representation of a pointer to a data field with no access methods.
Type-specialized access is gained by deriving from this class and implementing access functions like operator[] and size().
The PrivateImplementation feature enables RAII-type locking mechanisms used in the scanserver for holding CacheObject-locks. It is protected so that scanserver-unaware code can only construct this class with a pointer and size. Initialization of a derived class with these locking mechanisms creates this class with the private implementation value, which will be deleted in this dtor when it completely falls out of scope.
Definition at line 33 of file data_types.h.
|
inline |
Ctor for the initial creation
pointer | base pointer to the data |
size | of the pointed data in bytes |
Definition at line 50 of file data_types.h.
|
inline |
Copy-Ctor for passing along via return by value
The type-specialized classes (B) will be called with their B(DataPointer&&) temporary ctor and call this constructor, so the private imlementation has to be taken away. The temporary inside that constructor isn't seen as temporary anymore, so we need a simple reference-ctor.
Definition at line 63 of file data_types.h.
|
inline |
Same as DataPointer(DataPointer&), except this is for functions returning DataPointer instead of derived classes, so the temporary-ctor is used.
Definition at line 75 of file data_types.h.
|
inline |
Delete the private implementation with its derived dtor.
Definition at line 84 of file data_types.h.
|
inline |
Definition at line 94 of file data_types.h.
|
inline |
Indicator for nullpointer / no data contained if false.
Definition at line 90 of file data_types.h.
|
protected |
Definition at line 97 of file data_types.h.
|
private |
Definition at line 101 of file data_types.h.
|
protected |
Definition at line 98 of file data_types.h.