10 #include <Ravelin/virtual_enable_shared_from_this.hpp>
14 #include <boost/shared_ptr.hpp>
15 #include <Moby/Types.h>
20 class Base :
public Ravelin::virtual_enable_shared_from_this<Base>
26 virtual void save_to_xml(
XMLTreePtr node, std::list<boost::shared_ptr<const Base> >& shared_objects)
const;
27 virtual void load_from_xml(boost::shared_ptr<const XMLTree> node, std::map<std::string, BasePtr>& id_map);
31 static boost::shared_ptr<T>
clone(boost::shared_ptr<T> x) {
return (!x) ? x : boost::shared_ptr<T>(
new T(*x)); }
virtual void save_to_xml(XMLTreePtr node, std::list< boost::shared_ptr< const Base > > &shared_objects) const
Method for saving this object to XML.
Definition: Base.cpp:83
Class from which all Moby classes are derived.
Definition: Base.h:20
static boost::shared_ptr< T > clone(boost::shared_ptr< T > x)
Static method for cloning a shared pointer.
Definition: Base.h:31
boost::shared_ptr< void > userdata
Any relevant userdata.
Definition: Base.h:34
boost::shared_ptr< XMLTree > XMLTreePtr
XML tree smart pointer.
Definition: Types.h:104
std::string id
The unique ID for this object.
Definition: Base.h:37
virtual void load_from_xml(boost::shared_ptr< const XMLTree > node, std::map< std::string, BasePtr > &id_map)
Method for loading the data for this object from XML.
Definition: Base.cpp:58