Classes | Public Member Functions | Protected Attributes | Private Attributes | List of all members
DataPointer Class Reference

#include <data_types.h>

Inheritance diagram for DataPointer:
Inheritance graph
[legend]

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

PrivateImplementationm_private_impl
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DataPointer() [1/3]

DataPointer::DataPointer ( unsigned char *  pointer,
unsigned int  size,
PrivateImplementation private_impl = 0 
)
inline

Ctor for the initial creation

Parameters
pointerbase pointer to the data
sizeof the pointed data in bytes

Definition at line 50 of file data_types.h.

◆ DataPointer() [2/3]

DataPointer::DataPointer ( DataPointer other)
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.

◆ DataPointer() [3/3]

DataPointer::DataPointer ( DataPointer &&  other)
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.

◆ ~DataPointer()

DataPointer::~DataPointer ( )
inline

Delete the private implementation with its derived dtor.

Definition at line 84 of file data_types.h.

Member Function Documentation

◆ get_raw_pointer()

unsigned char* DataPointer::get_raw_pointer ( ) const
inline

Definition at line 94 of file data_types.h.

◆ valid()

bool DataPointer::valid ( )
inline

Indicator for nullpointer / no data contained if false.

Definition at line 90 of file data_types.h.

Member Data Documentation

◆ m_pointer

unsigned char* DataPointer::m_pointer
protected

Definition at line 97 of file data_types.h.

◆ m_private_impl

PrivateImplementation* DataPointer::m_private_impl
private

Definition at line 101 of file data_types.h.

◆ m_size

unsigned int DataPointer::m_size
protected

Definition at line 98 of file data_types.h.


The documentation for this class was generated from the following file:


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:26