A concrete instantiation of an object at a given place. More...
#include <typeinst.h>
Public Member Functions | |
virtual | ~Instance (void) throw () |
virtual const char * | getInstanceId (void) const =0 throw () |
ID of this particular instance (can be non-unique, can be null!). | |
virtual const char * | getTypeId (void) const =0 throw () |
ID of the instance type. | |
virtual placement_t & | getPlacement (void)=0 throw () |
raw read/write access to placement | |
virtual void | setComponentData (IN const char *componentName, IN smart_ptr< ComponentData > &data)=0 |
provide component data (physics model, 3d model, ai, etc. | |
virtual smart_ptr< ComponentData > | getComponentData (IN const char *componentName)=0 |
retrieve component data (physics model, 3d model, ai, etc.) | |
virtual const Datahash * | getTypeComponentData (IN const char *componentName)=0 |
retrieve raw component data from type | |
virtual void | setInstanceData (IN const char *componentName, IN smart_ptr< Datahash > &data)=0 |
Set raw instance data for the given named component. | |
virtual smart_ptr< Datahash > | getInstanceData (IN const char *componentName)=0 |
Retrieve raw instance data for the given named component. | |
virtual void | dump (IN const char *txt)=0 throw () |
for debugging | |
Static Public Member Functions | |
static smart_ptr< Instance > | parse (IO std::istream &stream) |
static smart_ptr< Instance > | create (IN const char *instanceId, IN const char *typeId) |
A concrete instantiation of an object at a given place.
Usually, callers are interested in one of two things (or both!):
When an Instance is created (using the static methods of this class), the framework creates a simple empty Instance object (with just the IDs and placement information), and then invokes all registered TypeComponenLoader objects to load any and all component data. Users of the Instance object can retrieve this component data by calling getComponentData().
This object is threadsafe, except for placement_t access. At the moment readers and writers can collide. If this turns into an issue (at the moment it is unlikely to cause more than occasional slight mistakes in coordinates, if anything) placement access can be made threadsafe.
Definition at line 173 of file typeinst.h.
aesop::Instance::~Instance | ( | void | ) | throw () [virtual] |
Definition at line 40 of file typeinst.cpp.