oos::object_ptr< T > Class Template Reference

The object_ptr 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_ptr ()
 
 object_ptr (const object_ptr &x)
 
 object_ptr (const object_ref< T > &x)
 
object_ptroperator= (const object_ptr &x)
 
 object_ptr (object *o)
 
 object_ptr (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_ptr< T >

The object_ptr holds a pointer to an object.

Template Parameters
TThe type of the object.

The object_ptr holds a pointer to an object. The object_ptr 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_ptr and should be used through the object_ptr class.

Member Typedef Documentation

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

Shortcut for object type.

Constructor & Destructor Documentation

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

Create an empty object_ptr

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

Copies object_ptr

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

Copies a object_ref

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

Create an object_ptr from an object

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

Create an object_ptr from an object_proxy

Parameters
proxyThe object_proxy.

Member Function Documentation

template<class T>
T* oos::object_ptr< 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_ptr< 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_ptr< 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_ptr& oos::object_ptr< T >::operator= ( const object_ptr< T > &  x)
inline

Assign an object_ptr

Parameters
xThe object_ptr to assign from
Returns
The assign object_ptr
template<class T>
virtual const char* oos::object_ptr< 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