strusBase  0.17
Public Member Functions | List of all members
strus::Reference< Object > Class Template Reference

Shared pointer template with non thread-safe reference counting. More...

#include <reference.hpp>

Public Member Functions

 Reference ()
 Default constructor. More...
 
 Reference (Object *obj_, bool doThrow=true)
 Constructor. More...
 
 Reference (const Reference &o)
 Copy constructor. More...
 
 ~Reference ()
 Destructor. More...
 
Referenceoperator= (const Reference &o)
 Assignment operator. More...
 
void reset (Object *obj_=0)
 Reinitialize the local value of the reference and dispose the old value if not referenced by others. More...
 
Object * operator-> ()
 Object access operator. More...
 
const Object * operator-> () const
 Object access operator. More...
 
Object & operator* ()
 Object access operator. More...
 
const Object & operator* () const
 Object access operator. More...
 
const Object * get () const
 Object access as function. More...
 
Object * get ()
 Object access as function. More...
 
Object * release ()
 Release object reference and return the pointer to the object (with ownership) if this is possible. More...
 
unsigned int refcnt () const
 

Detailed Description

template<class Object>
class strus::Reference< Object >

Shared pointer template with non thread-safe reference counting.

Note
Similar to shared_ptr but without atomic (thread safe) reference counting

Constructor & Destructor Documentation

template<class Object >
strus::Reference< Object >::Reference ( )
inline

Default constructor.

template<class Object >
strus::Reference< Object >::Reference ( Object *  obj_,
bool  doThrow = true 
)
inline

Constructor.

template<class Object >
strus::Reference< Object >::Reference ( const Reference< Object > &  o)
inline

Copy constructor.

template<class Object >
strus::Reference< Object >::~Reference ( )
inline

Destructor.

Member Function Documentation

template<class Object >
const Object* strus::Reference< Object >::get ( ) const
inline

Object access as function.

template<class Object >
Object* strus::Reference< Object >::get ( )
inline

Object access as function.

template<class Object >
Object& strus::Reference< Object >::operator* ( )
inline

Object access operator.

template<class Object >
const Object& strus::Reference< Object >::operator* ( ) const
inline

Object access operator.

template<class Object >
Object* strus::Reference< Object >::operator-> ( )
inline

Object access operator.

template<class Object >
const Object* strus::Reference< Object >::operator-> ( ) const
inline

Object access operator.

template<class Object >
Reference& strus::Reference< Object >::operator= ( const Reference< Object > &  o)
inline

Assignment operator.

template<class Object >
unsigned int strus::Reference< Object >::refcnt ( ) const
inline
template<class Object >
Object* strus::Reference< Object >::release ( )
inline

Release object reference and return the pointer to the object (with ownership) if this is possible.

Remarks
A multiply shared object reference cannot be released
template<class Object >
void strus::Reference< Object >::reset ( Object *  obj_ = 0)
inline

Reinitialize the local value of the reference and dispose the old value if not referenced by others.


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