Public Member Functions | Static Public Member Functions

aesop::Instance Class Reference
[AESOP Types and Instances]

A concrete instantiation of an object at a given place. More...

#include <typeinst.h>

Inheritance diagram for aesop::Instance:
Inheritance graph
[legend]

List of all members.

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_tgetPlacement (void)=0 throw ()
 raw read/write access to placement
virtual void setComponentData (const char *componentName, smart_ptr< ComponentData > &data)=0
 provide component data (physics model, 3d model, ai, etc.
virtual smart_ptr< ComponentDatagetComponentData (const char *componentName)=0
 retrieve component data (physics model, 3d model, ai, etc.)
virtual const DatahashgetTypeComponentData (const char *componentName)=0
 retrieve raw component data from type
virtual void setInstanceData (const char *componentName, smart_ptr< Datahash > &data)=0
 Set raw instance data for the given named component.
virtual smart_ptr< DatahashgetInstanceData (const char *componentName)=0
 Retrieve raw instance data for the given named component.
virtual void dump (const char *txt)=0 throw ()
 for debugging

Static Public Member Functions

static smart_ptr< Instanceparse (std::istream &stream)
static smart_ptr< Instancecreate (const char *instanceId, const char *typeId)

Detailed Description

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.


Constructor & Destructor Documentation

aesop::Instance::~Instance ( void   )  throw () [virtual]

Definition at line 40 of file typeinst.cpp.


The documentation for this class was generated from the following files: