10 #ifndef MATERIALS_DETAIL_TOOLS_H 11 #define MATERIALS_DETAIL_TOOLS_H 1 55 return !
is_owned() && ! _alias_of_.empty();
113 if (_owned_)
delete _ref_;
140 std::string _alias_of_;
154 #endif // MATERIALS_DETAIL_TOOLS_H bool is_alias() const
Check for existing alias information.
Definition: tools.h:53
std::map< std::string, smart_ref< element > > element_dict_type
Definition: tools.h:149
void set_alias_of(const std::string &name_)
Set the alias information.
Definition: tools.h:40
const T & get_ref() const
Return a reference to the non mutable object.
Definition: tools.h:90
T * grab_ptr()
Return a pointer to the mutable object.
Definition: tools.h:72
A handler object that is used as a smart reference for an object of which it can have the responsibil...
Definition: tools.h:22
void set_ref(T &ref_)
Set the internal reference without the responsibility of the deletion.
Definition: tools.h:128
std::map< std::string, smart_ref< isotope > > isotope_dict_type
Definition: tools.h:146
void reset_alias_of()
Reset the alias information.
Definition: tools.h:59
bool is_owned() const
Check the object deletion responsibility.
Definition: tools.h:27
const std::string & get_alias_of() const
Return the alias information.
Definition: tools.h:47
void set_ref(T *ref_)
Set the internal reference with the responsibility of the deletion (ala boost::scoped_ptr)
Definition: tools.h:120
T & grab_ref()
Return a reference to the mutable object.
Definition: tools.h:84
std::map< std::string, smart_ref< material > > material_dict_type
Definition: tools.h:150
const T * get_ptr() const
Return a pointer to the non mutable object.
Definition: tools.h:78
void set_owned(bool owned_)
Set the object deletion responsibility flag.
Definition: tools.h:33
smart_ref()
Default constructor.
Definition: tools.h:96
void reset_ref()
Reset the internal reference and delete the object if we have the responsibility of its deletion.
Definition: tools.h:109
The description of a material.
Definition: material.h:116
virtual ~smart_ref()
Destructor.
Definition: tools.h:102
Top-level namespace of the Bayeux/materials module library.
Definition: geom_manager_utils.h:14
bool has_ref() const
Check for a existing reference.
Definition: tools.h:66