Smart pointer class to control access to object. More...
#include <ValidPtr.h>
Public Member Functions | |
ValidPtr (Tobj *p) | |
Copy ordinary pointer constructor. | |
~ValidPtr () | |
Tobj & | operator* () const |
Tobj * | operator-> () const |
const Tobj & | getConstRefForCopying () const |
getConstRefForCopying() is provided to make it possible to copy the object also when it is written to file. | |
void | inMemorySet (bool val) |
bool | inMemoryGet () const |
void | haveDataStructureSet (bool val) |
bool | haveDataStructureGet () const |
Static Public Member Functions | |
static void | swap (ValidPtr< Tobj > &ptrA, ValidPtr< Tobj > &ptrB) |
Protected Attributes | |
Tobj * | ptr |
bool | inMemory |
Access to ptr forbidden if inMemory is false. | |
bool | haveDataStructure |
Access to ptr forbidden if haveDataStructure is false. | |
Private Member Functions | |
ValidPtr (ValidPtr< Tobj > const &) | |
ValidPtr< Tobj > & | operator= (ValidPtr< Tobj > const &) |
Smart pointer class to control access to object.
Primary use: Control access to objects that may be written to file.
mat::ValidPtr< Tobj >::ValidPtr | ( | Tobj * | p | ) | [inline, explicit] |
Copy ordinary pointer constructor.
mat::ValidPtr< Tobj >::~ValidPtr | ( | ) | [inline] |
mat::ValidPtr< Tobj >::ValidPtr | ( | ValidPtr< Tobj > const & | ) | [inline, private] |
const Tobj& mat::ValidPtr< Tobj >::getConstRefForCopying | ( | ) | const [inline] |
getConstRefForCopying() is provided to make it possible to copy the object also when it is written to file.
Referenced by mat::MatrixBase< ergo_real, Matri >::MatrixBase(), and mat::MatrixBase< ergo_real, Matri >::operator=().
bool mat::ValidPtr< Tobj >::haveDataStructureGet | ( | ) | const [inline] |
Referenced by mat::VectorGeneral< ergo_real, Vectorrr >::is_empty(), mat::MatrixBase< ergo_real, Matri >::is_empty(), mat::MatrixBase< ergo_real, Matri >::MatrixBase(), mat::VectorGeneral< ergo_real, Vectorrr >::operator=(), mat::MatrixBase< ergo_real, Matri >::operator=(), mat::ValidPtr< Vectorrr >::swap(), and mat::VectorGeneral< ergo_real, Vectorrr >::VectorGeneral().
void mat::ValidPtr< Tobj >::haveDataStructureSet | ( | bool | val | ) | [inline] |
Referenced by mat::MatrixTriangular< ergo_real, Matri >::inch(), mat::MatrixBase< ergo_real, Matri >::MatrixBase(), mat::VectorGeneral< ergo_real, Vectorrr >::operator=(), mat::MatrixBase< ergo_real, Matri >::operator=(), mat::VectorGeneral< ergo_real, Vectorrr >::resetSizesAndBlocks(), mat::MatrixBase< ergo_real, Matri >::resetSizesAndBlocks(), and mat::VectorGeneral< ergo_real, Vectorrr >::VectorGeneral().
bool mat::ValidPtr< Tobj >::inMemoryGet | ( | ) | const [inline] |
void mat::ValidPtr< Tobj >::inMemorySet | ( | bool | val | ) | [inline] |
Tobj& mat::ValidPtr< Tobj >::operator* | ( | ) | const [inline] |
Tobj* mat::ValidPtr< Tobj >::operator-> | ( | ) | const [inline] |
ValidPtr<Tobj>& mat::ValidPtr< Tobj >::operator= | ( | ValidPtr< Tobj > const & | ) | [inline, private] |
static void mat::ValidPtr< Tobj >::swap | ( | ValidPtr< Tobj > & | ptrA, | |
ValidPtr< Tobj > & | ptrB | |||
) | [inline, static] |
bool mat::ValidPtr< Tobj >::haveDataStructure [protected] |
Access to ptr forbidden if haveDataStructure is false.
Referenced by mat::ValidPtr< Vectorrr >::haveDataStructureGet(), mat::ValidPtr< Vectorrr >::haveDataStructureSet(), mat::ValidPtr< Vectorrr >::operator*(), and mat::ValidPtr< Vectorrr >::operator->().
bool mat::ValidPtr< Tobj >::inMemory [protected] |
Access to ptr forbidden if inMemory is false.
Referenced by mat::ValidPtr< Vectorrr >::inMemoryGet(), mat::ValidPtr< Vectorrr >::inMemorySet(), mat::ValidPtr< Vectorrr >::operator*(), and mat::ValidPtr< Vectorrr >::operator->().
Tobj* mat::ValidPtr< Tobj >::ptr [protected] |