rasdaman complete source
Public Member Functions | List of all members
r_Ref< T > Class Template Reference

#include <oqlquery.hh>

Public Member Functions

 r_Ref ()
 default constructor More...
 
 r_Ref (const r_Ref_Any &)
 constructor for r_Ref_Any objects More...
 
 r_Ref (const r_OId &initOId)
 constructor for creating a reference with an oid More...
 
 r_Ref (const r_Ref< T > &)
 copy constructor More...
 
 ~r_Ref ()
 destructor deletes referenced object from main memory and database More...
 
 operator r_Ref_Any () const
 cast to {r_Ref_Any} More...
 
r_Ref< T > & operator= (const r_Ref_Any &)
 assignment operator for assigning a {r_Ref_Any} More...
 
r_Ref< T > & operator= (T *)
 assignment operator for assigning a C pointer More...
 
r_Ref< T > & operator= (const r_Ref< T > &)
 assignment operator for assigning a r_Ref pointer More...
 
const T & operator* () const throw (r_Error)
 dereference operator (error kinds: r_Error_RefNull, r_Error_RefInvalid) More...
 
T & operator* () throw ( r_Error )
 dereference operator (error kinds: r_Error_RefNull, r_Error_RefInvalid) More...
 
const T * operator-> () const throw (r_Error)
 
T * operator-> () throw ( r_Error )
 operator for dereferencing the reference (error kinds: r_Error_RefNull, r_Error_RefInvalid) More...
 
const T * ptr () const throw (r_Error)
 
T * ptr () throw ( r_Error )
 method for dereferencing the reference (error kinds: r_Error_RefNull, r_Error_RefInvalid) More...
 
int operator! () const
 operator for validity test More...
 
int is_null () const
 method for reference validity test More...
 
void destroy ()
 delete from main memory More...
 
void delete_object ()
 deletes referenced object from main memory and database More...
 
const r_OIdget_oid () const
 get oid More...
 
int operator== (const r_Ref< T > &refR) const
 
int operator!= (const r_Ref< T > &refR) const
 
int operator== (const T *) const
 compares the memory pointer (does not load the object) More...
 
int operator!= (const T *) const
 compares the memory pointer (does not load the object) More...
 
 r_Ref (T *)
 constructor getting memory pointer More...
 
 r_Ref (const r_OId &, T *)
 constructor getting oid and memory pointer More...
 
T * get_memory_ptr () const
 get memory pointer (without loading the object) More...
 
unsigned int is_oid_valid () const
 

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

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

default constructor

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

constructor for r_Ref_Any objects

template<class T>
r_Ref< T >::r_Ref ( const r_OId initOId)

constructor for creating a reference with an oid

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

copy constructor

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

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

destructor deletes referenced object from main memory and database

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

constructor getting memory pointer

template<class T>
r_Ref< T >::r_Ref ( const r_OId ,
T *   
)

constructor getting oid and memory pointer

Member Function Documentation

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

deletes referenced object from main memory and database

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

delete from main memory

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

get memory pointer (without loading the object)

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

get oid

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

method for reference validity test

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

cast to {r_Ref_Any}

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

operator for validity test

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.

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

compares the memory pointer (does not load the object)

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

dereference operator (error kinds: r_Error_RefNull, r_Error_RefInvalid)

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

dereference operator (error kinds: r_Error_RefNull, r_Error_RefInvalid)

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

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.

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

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

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

assignment operator for assigning a {r_Ref_Any}

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

assignment operator for assigning a C pointer

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

assignment operator for assigning a r_Ref pointer

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.

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

compares the memory pointer (does not load the object)

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

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.

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

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


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