oos::object_ref< T > Class Template Reference

The object_ref holds a pointer to an object. More...

#include <object_ptr.hpp>

Inherits oos::object_base_ptr.

Public Types

typedef T object_type
 

Public Member Functions

 object_ref ()
 
 object_ref (const object_ref &x)
 
 object_ref (const object_ptr< T > &x)
 
object_refoperator= (const object_ref &x)
 
bool operator== (const object_ref &x) const
 Check on equal. More...
 
 object_ref (object *o)
 
 object_ref (object_proxy *proxy)
 
virtual const char * type () const
 
T * operator-> () const
 Return the pointer to the object of type T. More...
 
T & operator* () const
 Return the reference to the object of type T. More...
 
T * get () const
 Return the pointer to the object of type T. More...
 
- Public Member Functions inherited from oos::object_base_ptr
bool operator== (const object_base_ptr &x) const
 
bool operator!= (const object_base_ptr &x) const
 
void reset (const object *o=0)
 
bool is_loaded () const
 
long id () const
 
void id (long i)
 
objectptr () const
 
objectlookup_object () const
 
virtual bool is_reference () const
 
bool is_internal () const
 
unsigned long ref_count () const
 
unsigned long ptr_count () const
 

Additional Inherited Members

- Protected Member Functions inherited from oos::object_base_ptr
 object_base_ptr (bool is_ref)
 Creates and empty base pointer. More...
 
 object_base_ptr (const object_base_ptr &x)
 
object_base_ptroperator= (const object_base_ptr &x)
 
 object_base_ptr (object *o, bool is_ref)
 Creates an object_base_ptr with a given object. More...
 
 object_base_ptr (object_proxy *op, bool is_ref)
 Creates an object_base_ptr with a given object_proxy. More...
 

Detailed Description

template<class T>
class oos::object_ref< T >

The object_ref holds a pointer to an object.

Template Parameters
TThe type of the object.

The object_ref holds a pointer to an object. The object_ref is a wrapper class for the object class It has a reference count mechanism. The objects inserted into the object_store are returned as a object_ref and should be used through the object_ref class. A object_ref can't be deleted from the object_store.

Member Typedef Documentation

template<class T>
typedef T oos::object_ref< T >::object_type

Shortcut for object type.

Constructor & Destructor Documentation

template<class T>
oos::object_ref< T >::object_ref ( )
inline

Create an empty object_ref

template<class T>
oos::object_ref< T >::object_ref ( const object_ref< T > &  x)
inline

Copies object_ref

Parameters
xThe object_ref to copy
template<class T>
oos::object_ref< T >::object_ref ( const object_ptr< T > &  x)
inline

Copies object_ptr

Parameters
xThe object_ptr to copy
template<class T>
oos::object_ref< T >::object_ref ( object o)
inlineexplicit

Create an object_ref from an object

Parameters
oThe object.
template<class T>
oos::object_ref< T >::object_ref ( object_proxy *  proxy)
inlineexplicit

Create an object_ref from an object_proxy

Parameters
proxyThe object.

Member Function Documentation

template<class T>
T* oos::object_ref< T >::get ( ) const
inline

Return the pointer to the object of type T.

Return the pointer to the object of type T. If there isn't a valid object 0 (null) is returned.

Returns
The pointer to the object of type T.
template<class T>
T& oos::object_ref< T >::operator* ( ) const
inline

Return the reference to the object of type T.

Return the reference to the object of type T. If there isn't a valid object 0 (null) is returned.

Returns
The reference to the object of type T.
template<class T>
T* oos::object_ref< T >::operator-> ( ) const
inline

Return the pointer to the object of type T.

Return the pointer to the object of type T. If there isn't a valid object 0 (null) is returned.

Returns
The pointer to the object of type T.
template<class T>
object_ref& oos::object_ref< T >::operator= ( const object_ref< T > &  x)
inline

Assign an object_ref

Parameters
xThe object_ref to assign from
Returns
The assign object_ref
template<class T>
bool oos::object_ref< T >::operator== ( const object_ref< T > &  x) const
inline

Check on equal.

Check if this object_ref is equal to the given one.

Parameters
xThe object_ref to compare with.
Returns
True if the object_ref are equal.
template<class T>
virtual const char* oos::object_ref< T >::type ( ) const
inlinevirtual

Return the type string of the object

Returns
The type string of the object.

Implements oos::object_base_ptr.


The documentation for this class was generated from the following file:
  • object/object_ptr.hpp