16 #ifndef TORC_GENERIC_PARENTEDOBJECT_HPP
17 #define TORC_GENERIC_PARENTEDOBJECT_HPP
22 #include <boost/shared_ptr.hpp>
23 #include <boost/weak_ptr.hpp>
24 #ifdef GENOM_SERIALIZATION
25 #include <boost/serialization/access.hpp>
26 #include <boost/serialization/weak_ptr.hpp>
27 #endif //GENOM_SERIALIZATION
39 template <
typename _ParentType>
42 #ifdef GENOM_SERIALIZATION
43 friend class boost::serialization::access;
64 inline const boost::shared_ptr<_ParentType>
getParent()
const;
71 virtual void setParent(
const boost::shared_ptr<_ParentType>& inSource);
74 #ifdef GENOM_SERIALIZATION
75 template <
class Archive>
void serialize(Archive& ar,
unsigned int);
76 #endif //GENOM_SERIALIZATION
89 template <
typename _ParentType>
inline const boost::shared_ptr<_ParentType>
91 return mParent.lock();
100 const boost::shared_ptr<_ParentType>& inSource) {
104 #ifdef GENOM_SERIALIZATION
105 template <
typename _ParentType>
template <
class Archive>
void
109 #endif //GENOM_SERIALIZATION
113 #endif // TORC_GENERIC_PARENTEDOBJECT_HPP
ParentedObject< _ParentType > & operator=(const ParentedObject< _ParentType > &source)
An object that has a parent.
boost::weak_ptr< _ParentType > mParent
const boost::shared_ptr< _ParentType > getParent() const
virtual void setParent(const boost::shared_ptr< _ParentType > &inSource)
virtual ~ParentedObject()