rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
Public Member Functions | Protected Attributes | List of all members
r_Ref< T > Class Template Reference

References of type r_Ref in many respects behave like C++ pointers but provide an additional mechanism that guarantees integrity in references to persistent objects. More...

#include <ref.hh>

Public Member Functions

 r_Ref ()
 default constructor
 
 r_Ref (const r_Ref_Any &)
 constructor for r_Ref_Any objects
 
 r_Ref (const r_OId &initOId, r_Transaction *ta=NULL)
 constructor for creating a reference with an oid
 
 r_Ref (const r_Ref< T > &)
 Dereferencing the self object results in loading the object with initOId.
 
 ~r_Ref ()
 destructor deletes referenced object from main memory and database
 
 operator r_Ref_Any () const
 cast to r_Ref_Any
 
r_Ref< T > & operator= (const r_Ref_Any &)
 assignment operator for assigning a r_Ref_Any
 
r_Ref< T > & operator= (T *)
 assignment operator for assigning a C pointer
 
r_Ref< T > & operator= (const r_Ref< T > &)
 assignment operator for assigning a r_Ref pointer
 
const T & operator* () const
 dereference operator (error kinds: r_Error_RefNull, r_Error_RefInvalid)
 
T & operator* ()
 dereference operator (error kinds: r_Error_RefNull, r_Error_RefInvalid)
 
const T * operator-> () const
 If the memory pointer is zero and the oid is valid, the object is loaded from the server and a reference to the object in memory is returned.
 
T * operator-> ()
 operator for dereferencing the reference (error kinds: r_Error_RefNull, r_Error_RefInvalid)
 
const T * ptr () const
 If the memory pointer is zero and the oid is valid, the object is loaded from the server and the new memory location is returned.
 
T * ptr ()
 method for dereferencing the reference (error kinds: r_Error_RefNull, r_Error_RefInvalid)
 
int operator! () const
 If the memory pointer is zero and the oid is valid, the object is loaded from the server and the new memory location is returned.
 
int is_null () const
 method for reference validity test
 
int operator== (const r_Ref< T > &refR) const
 The method delivers true iff the oid and/or the memory pointer are valid.
 
int operator!= (const r_Ref< T > &refR) const
 
int operator== (const T *) const
 compares the memory pointer (does not load the object)
 
int operator!= (const T *) const
 compares the memory pointer (does not load the object)
 
void destroy ()
 delete from main memory
 
void delete_object ()
 deletes referenced object from main memory and database
 
const r_OIdget_oid () const
 get oid
 
 r_Ref (T *, r_Transaction *ta=NULL)
 constructor getting memory pointer
 
 r_Ref (const r_OId &, T *, r_Transaction *ta=NULL)
 constructor getting oid and memory pointer
 
T * get_memory_ptr () const
 get memory pointer (without loading the object)
 
unsigned int is_oid_valid () const
 

Protected Attributes

r_Transactionta {NULL}
 

Detailed Description

template<class T>
class r_Ref< T >

References of type r_Ref in many respects behave like C++ pointers but provide an additional mechanism that guarantees integrity in references to persistent objects.

r_Ref implements a so called smart pointer which behaves like a C++ pointer but can do additional things in time of dereferencing the pointer. In case that no valid memory pointer is available, which means that the object is not present, and an oid is existing, the object belonging to the oid is read from the db and the new memory pointer is given back.

Constructor & Destructor Documentation

◆ r_Ref() [1/6]

template<class T >
r_Ref< T >::r_Ref ( )

default constructor

◆ r_Ref() [2/6]

template<class T >
r_Ref< T >::r_Ref ( const r_Ref_Any )

constructor for r_Ref_Any objects

◆ r_Ref() [3/6]

template<class T >
r_Ref< T >::r_Ref ( const r_OId initOId,
r_Transaction ta = NULL 
)

constructor for creating a reference with an oid

◆ r_Ref() [4/6]

template<class T >
r_Ref< T >::r_Ref ( const r_Ref< T > &  )

Dereferencing the self object results in loading the object with initOId.

copy constructor

◆ ~r_Ref()

template<class T >
r_Ref< T >::~r_Ref ( )

destructor deletes referenced object from main memory and database

◆ r_Ref() [5/6]

template<class T >
r_Ref< T >::r_Ref ( T *  ,
r_Transaction ta = NULL 
)

constructor getting memory pointer

◆ r_Ref() [6/6]

template<class T >
r_Ref< T >::r_Ref ( const r_OId ,
T *  ,
r_Transaction ta = NULL 
)

constructor getting oid and memory pointer

Member Function Documentation

◆ delete_object()

template<class T >
void r_Ref< T >::delete_object ( )

deletes referenced object from main memory and database

◆ destroy()

template<class T >
void r_Ref< T >::destroy ( )

delete from main memory

◆ get_memory_ptr()

template<class T >
T * r_Ref< T >::get_memory_ptr ( ) const

get memory pointer (without loading the object)

◆ get_oid()

template<class T >
const r_OId & r_Ref< T >::get_oid ( ) const

get oid

◆ is_null()

template<class T >
int r_Ref< T >::is_null ( ) const

method for reference validity test

◆ is_oid_valid()

template<class T >
unsigned int r_Ref< T >::is_oid_valid ( ) const

◆ operator r_Ref_Any()

template<class T >
r_Ref< T >::operator r_Ref_Any ( ) const

cast to r_Ref_Any

◆ operator!()

template<class T >
int r_Ref< T >::operator! ( ) const

If the memory pointer is zero and the oid is valid, the object is loaded from the server and the new memory location is returned.

operator for validity test

◆ operator!=() [1/2]

template<class T >
int r_Ref< T >::operator!= ( const r_Ref< T > &  refR) const

◆ operator!=() [2/2]

template<class T >
int r_Ref< T >::operator!= ( const T *  ) const

compares the memory pointer (does not load the object)

◆ operator*() [1/2]

template<class T >
T & r_Ref< T >::operator* ( )

dereference operator (error kinds: r_Error_RefNull, r_Error_RefInvalid)

◆ operator*() [2/2]

template<class T >
const T & r_Ref< T >::operator* ( ) const

dereference operator (error kinds: r_Error_RefNull, r_Error_RefInvalid)

◆ operator->() [1/2]

template<class T >
T * r_Ref< T >::operator-> ( )

operator for dereferencing the reference (error kinds: r_Error_RefNull, r_Error_RefInvalid)

◆ operator->() [2/2]

template<class T >
const T * r_Ref< T >::operator-> ( ) const

If the memory pointer is zero and the oid is valid, the object is loaded from the server and a reference to the object in memory is returned.

◆ operator=() [1/3]

template<class T >
r_Ref< T > & r_Ref< T >::operator= ( const r_Ref< T > &  )

assignment operator for assigning a r_Ref pointer

◆ operator=() [2/3]

template<class T >
r_Ref< T > & r_Ref< T >::operator= ( const r_Ref_Any )

assignment operator for assigning a r_Ref_Any

◆ operator=() [3/3]

template<class T >
r_Ref< T > & r_Ref< T >::operator= ( T *  )

assignment operator for assigning a C pointer

◆ operator==() [1/2]

template<class T >
int r_Ref< T >::operator== ( const r_Ref< T > &  refR) const

The method delivers true iff the oid and/or the memory pointer are valid.

◆ operator==() [2/2]

template<class T >
int r_Ref< T >::operator== ( const T *  ) const

compares the memory pointer (does not load the object)

◆ ptr() [1/2]

template<class T >
T * r_Ref< T >::ptr ( )

method for dereferencing the reference (error kinds: r_Error_RefNull, r_Error_RefInvalid)

◆ ptr() [2/2]

template<class T >
const T * r_Ref< T >::ptr ( ) const

If the memory pointer is zero and the oid is valid, the object is loaded from the server and the new memory location is returned.

Member Data Documentation

◆ ta

template<class T >
r_Transaction* r_Ref< T >::ta {NULL}
protected

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