rambrain
rambrain::adhereTo< T > Class Template Reference

Main class to fetch memory that is managed by rambrain for actual usage. More...

#include <managedPtr.h>

Public Member Functions

 adhereTo (const adhereTo< T > &ref)
 copy constructor More...
 
 adhereTo (const managedPtr< T > &data, bool loadImmediately=true)
 constructor fetching data More...
 
 adhereTo (const managedPtr< T > *data, bool loadImmediately=true)
 Provides the same functionality as the other constructor but accepts a managedPtr pointer as argument. More...
 
adhereTo< T > & operator= (const adhereTo< T > &ref)
 Simple assignment operator. More...
 
 operator const T * ()
 This operator can be used to pull the data to a const pointer. Use this whenever possible. More...
 
 operator const T * () const
 This operator can be used to pull the data to a const pointer. Use this whenever possible. More...
 
 operator T * ()
 This operator can be used to pull the data to a non-const pointer. If you only read the data, pull the const version, as this saves execution time. More...
 
 ~adhereTo ()
 destructor More...
 

Private Attributes

const managedPtr< T > * data
 
bool loadedWritable = false
 
bool loadedReadable = false
 

Friends

class ::adhereTo_Unit_LoadUnload_Test
 
class ::adhereTo_Unit_LoadUnloadConst_Test
 
class ::adhereTo_Unit_TwiceAdhered_Test
 
class ::adhereTo_Unit_TwiceAdheredOnceUsed_Test
 

Detailed Description

template<class T>
class rambrain::adhereTo< T >

Main class to fetch memory that is managed by rambrain for actual usage.

Warning
thread-safety
  • The object itself is not thread-safe
  • Do not pass pointers/references to this object over thread boundaries
Note
thread-safety
  • The object itself may be copied over thread boundaries

Definition at line 48 of file managedPtr.h.

Constructor & Destructor Documentation

template<class T>
rambrain::adhereTo< T >::adhereTo ( const adhereTo< T > &  ref)
inline

copy constructor

Definition at line 392 of file managedPtr.h.

template<class T>
rambrain::adhereTo< T >::adhereTo ( const managedPtr< T > &  data,
bool  loadImmediately = true 
)
inline

constructor fetching data

Parameters
loadImmediatelyset this to false if you want to load the element when pulling the pointer and not beforehands
datathe managedPtr that is to be used in near future

Definition at line 407 of file managedPtr.h.

template<class T>
rambrain::adhereTo< T >::adhereTo ( const managedPtr< T > *  data,
bool  loadImmediately = true 
)
inline

Provides the same functionality as the other constructor but accepts a managedPtr pointer as argument.

See also
adhereTo ( const managedPtr<T> &data, bool loadImmediately = true )

Definition at line 415 of file managedPtr.h.

template<class T>
rambrain::adhereTo< T >::~adhereTo ( )
inline

destructor

Definition at line 463 of file managedPtr.h.

Member Function Documentation

template<class T>
rambrain::adhereTo< T >::operator const T * ( )
inline

This operator can be used to pull the data to a const pointer. Use this whenever possible.

Definition at line 439 of file managedPtr.h.

template<class T>
rambrain::adhereTo< T >::operator const T * ( ) const
inline

This operator can be used to pull the data to a const pointer. Use this whenever possible.

Definition at line 443 of file managedPtr.h.

template<class T>
rambrain::adhereTo< T >::operator T * ( )
inline

This operator can be used to pull the data to a non-const pointer. If you only read the data, pull the const version, as this saves execution time.

Definition at line 453 of file managedPtr.h.

template<class T>
adhereTo<T>& rambrain::adhereTo< T >::operator= ( const adhereTo< T > &  ref)
inline

Simple assignment operator.

Definition at line 418 of file managedPtr.h.

Friends And Related Function Documentation

template<class T>
friend class ::adhereTo_Unit_LoadUnload_Test
friend

Definition at line 478 of file managedPtr.h.

template<class T>
friend class ::adhereTo_Unit_LoadUnloadConst_Test
friend

Definition at line 479 of file managedPtr.h.

template<class T>
friend class ::adhereTo_Unit_TwiceAdhered_Test
friend

Definition at line 480 of file managedPtr.h.

template<class T>
friend class ::adhereTo_Unit_TwiceAdheredOnceUsed_Test
friend

Definition at line 481 of file managedPtr.h.

Member Data Documentation

template<class T>
const managedPtr<T>* rambrain::adhereTo< T >::data
private

Definition at line 471 of file managedPtr.h.

template<class T>
bool rambrain::adhereTo< T >::loadedReadable = false
mutableprivate

Definition at line 474 of file managedPtr.h.

template<class T>
bool rambrain::adhereTo< T >::loadedWritable = false
mutableprivate

Definition at line 473 of file managedPtr.h.


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