Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Member Functions | List of all members
materials::smart_ref< T > Class Template Reference

A handler object that is used as a smart reference for an object of which it can have the responsibility of the deletion. More...

#include <bayeux/materials/detail/tools.h>

Public Member Functions

bool is_owned () const
 Check the object deletion responsibility. More...
 
void set_owned (bool owned_)
 Set the object deletion responsibility flag. More...
 
void set_alias_of (const std::string &name_)
 Set the alias information. More...
 
const std::string & get_alias_of () const
 Return the alias information. More...
 
bool is_alias () const
 Check for existing alias information. More...
 
void reset_alias_of ()
 Reset the alias information. More...
 
bool has_ref () const
 Check for a existing reference. More...
 
T * grab_ptr ()
 Return a pointer to the mutable object. More...
 
const T * get_ptr () const
 Return a pointer to the non mutable object. More...
 
T & grab_ref ()
 Return a reference to the mutable object. More...
 
const T & get_ref () const
 Return a reference to the non mutable object. More...
 
 smart_ref ()
 Default constructor. More...
 
virtual ~smart_ref ()
 Destructor. More...
 
void reset_ref ()
 Reset the internal reference and delete the object if we have the responsibility of its deletion. More...
 
void set_ref (T *ref_)
 Set the internal reference with the responsibility of the deletion (ala boost::scoped_ptr) More...
 
void set_ref (T &ref_)
 Set the internal reference without the responsibility of the deletion. More...
 

Detailed Description

template<class T>
class materials::smart_ref< T >

A handler object that is used as a smart reference for an object of which it can have the responsibility of the deletion.

Constructor & Destructor Documentation

◆ smart_ref()

template<class T>
materials::smart_ref< T >::smart_ref ( )
inline

Default constructor.

◆ ~smart_ref()

template<class T>
virtual materials::smart_ref< T >::~smart_ref ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ get_alias_of()

template<class T>
const std::string& materials::smart_ref< T >::get_alias_of ( ) const
inline

Return the alias information.

◆ get_ptr()

template<class T>
const T* materials::smart_ref< T >::get_ptr ( ) const
inline

Return a pointer to the non mutable object.

◆ get_ref()

template<class T>
const T& materials::smart_ref< T >::get_ref ( ) const
inline

Return a reference to the non mutable object.

◆ grab_ptr()

template<class T>
T* materials::smart_ref< T >::grab_ptr ( )
inline

Return a pointer to the mutable object.

◆ grab_ref()

template<class T>
T& materials::smart_ref< T >::grab_ref ( )
inline

Return a reference to the mutable object.

◆ has_ref()

template<class T>
bool materials::smart_ref< T >::has_ref ( ) const
inline

Check for a existing reference.

◆ is_alias()

template<class T>
bool materials::smart_ref< T >::is_alias ( ) const
inline

Check for existing alias information.

◆ is_owned()

template<class T>
bool materials::smart_ref< T >::is_owned ( ) const
inline

Check the object deletion responsibility.

◆ reset_alias_of()

template<class T>
void materials::smart_ref< T >::reset_alias_of ( )
inline

Reset the alias information.

◆ reset_ref()

template<class T>
void materials::smart_ref< T >::reset_ref ( )
inline

Reset the internal reference and delete the object if we have the responsibility of its deletion.

◆ set_alias_of()

template<class T>
void materials::smart_ref< T >::set_alias_of ( const std::string &  name_)
inline

Set the alias information.

◆ set_owned()

template<class T>
void materials::smart_ref< T >::set_owned ( bool  owned_)
inline

Set the object deletion responsibility flag.

◆ set_ref() [1/2]

template<class T>
void materials::smart_ref< T >::set_ref ( T *  ref_)
inline

Set the internal reference with the responsibility of the deletion (ala boost::scoped_ptr)

◆ set_ref() [2/2]

template<class T>
void materials::smart_ref< T >::set_ref ( T &  ref_)
inline

Set the internal reference without the responsibility of the deletion.


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