42 #ifndef STANDARD_COMPOSITION_RELATIONSHIPS_PACK_H
43 #define STANDARD_COMPOSITION_RELATIONSHIPS_PACK_H
48 namespace StandardCompositionRelationshipsPack {
59 {
public:
NoRefSet(
const std::string& what_arg) : std::logic_error(what_arg) {}};
66 ,func_name <<
": The reference for \'" << name <<
"\' has not been set yet"
71 template<
class ContainedClass>
79 template<
class ContainedClass>
80 inline void set_role_name(ContainedClass*& role_name_,
bool& owns_role_name_,
const char name[]
83 if(owns_role_name_ && role_name_ != role_name)
delete role_name_;
88 template<
class ContainedClass>
89 inline ContainedClass*
get_role_name(ContainedClass* role_name_,
bool owns_role_name_
96 template<
class ContainedClass>
105 template<
class ContainedClass>
106 inline bool owns_role_name(ContainedClass* role_name_,
bool owns_role_name_,
const char name[])
109 return owns_role_name_;
113 template<
class ContainedClass>
114 inline ContainedClass&
role_name(ContainedClass* role_name_,
bool owns_role_name_,
const char name[])
121 template<
class ContainedClass>
122 inline const ContainedClass&
role_name(
const ContainedClass* role_name_,
bool owns_role_name_,
const char name[])
129 template<
class ContainedClass>
130 inline const ContainedClass&
const_role_name(
const ContainedClass* role_name_,
bool owns_role_name_,
const char name[])
138 template<
class ContainedClass>
141 if(owns_role_name_)
delete role_name_;
148 #endif // STANDARD_COMPOSITION_RELATIONSHIPS_PACK_H
NoRefSet(const std::string &what_arg)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool owns_role_name(ContainedClass *role_name_, bool owns_role_name_, const char name[])
const ContainedClass & const_role_name(const ContainedClass *role_name_, bool owns_role_name_, const char name[])
ContainedClass * get_role_name(ContainedClass *role_name_, bool owns_role_name_, const char name[])
void destory_container_obj(ContainedClass *role_name_, bool owns_role_name_)
void set_owns_role_name(ContainedClass *&role_name_, bool &owns_role_name_, const char name[], bool owns_role_name)
Thrown when the reference has not been set.
void assert_role_name_set(const ContainedClass *role_name_, const char func_name[], const char name[])
Assert that the reference is set.
ContainedClass & role_name(ContainedClass *role_name_, bool owns_role_name_, const char name[])
void set_role_name(ContainedClass *&role_name_, bool &owns_role_name_, const char name[], ContainedClass *role_name, bool owns_role_name)
void ThrowNoRefSet(const char func_name[], const char name[])