Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

amire::component::ComponentContext Class Reference

Inheritance diagram for amire::component::ComponentContext:

amire::component::ComponentManager amire::component::ComposedComponent List of all members.

Public Member Functions

virtual ~ComponentContext ()
virtual osg::ref_ptr< const
Component
getComponentPrototype (const std::string &name)=0
osg::ref_ptr< ComponentnewComponent (const std::string &prototypeName)
osg::ref_ptr< ComponentnewComponent (const std::string &prototypeName, const std::string &identifier)
bool connect (const std::string &emitter, const std::string &outSlot, const std::string &receiver, const std::string &inSlot, const osg::ref_ptr< const ConnectionFilter > &filter=NULL)
const osg::ref_ptr< Component > & getComponent (long id) const
const osg::ref_ptr< Component > & getComponent (const std::string &name) const
const std::vector< osg::ref_ptr<
Component > > & 
getComponents () const
void setPriority (long id, int priority)
int getPriority (long id) const
void setName (long id, const std::string &name)
const std::string & getName (long id) const
void deleteComponent (const osg::ref_ptr< Component > &component)

Protected Member Functions

 ComponentContext ()
virtual void changedInSlots (const osg::ref_ptr< const Component > &component)
virtual void changedOutSlots (const osg::ref_ptr< const Component > &component)
virtual void removedInSlot (const osg::ref_ptr< const Component > &component, int inSlotId, const std::string &inSlotName, const osg::ref_ptr< const amire::property::PropertyType > &inSlotType)
virtual void removedOutSlot (const osg::ref_ptr< const Component > &component, int outSlotId, const std::string &outSlotName, const osg::ref_ptr< const amire::property::PropertyType > &outSlotType)
virtual void renamedInSlot (const osg::ref_ptr< const Component > &component, int inSlotId, const std::string &oldInSlotName, const std::string &newInSlotName)
virtual void renamedOutSlot (const osg::ref_ptr< const Component > &component, int outSlotId, const std::string &oldOutSlotName, const std::string &newOutSlotName)
virtual void changedInSlotType (const osg::ref_ptr< const Component > &component, int inSlotId, const std::string &inSlotName, const osg::ref_ptr< const amire::property::PropertyType > &oldInSlotType, const osg::ref_ptr< const amire::property::PropertyType > &newInSlotType)
virtual void changedOutSlotType (const osg::ref_ptr< const Component > &component, int outSlotId, const std::string &outSlotName, const osg::ref_ptr< const amire::property::PropertyType > &oldOutSlotType, const osg::ref_ptr< const amire::property::PropertyType > &newOutSlotType)
virtual std::string getQualifier () const
long nextComponentId ()

Protected Attributes

std::vector< osg::ref_ptr<
Component > > 
components

Detailed Description

Each component instance exists in a environment. This environment is called the component context. In such a component context, a component can be accessed by its name, which is unique in the whole component context. The component context allows the creation of new component instances. These new component instances will become part of the component context. Like the creation of component instances also their deletion is indirectly managed by the component context (the interface is provided by the component itself). Further, the component context provides an interface to connect in- and out-slot of two component instances by their names. Two kind of component contexts are available in the MR framework: Fist, each composed component is a component context. The second kind is the component manager.

The component manager extends the functionality of the component context by the management of component prototypes and property types. You can register a component prototype at the component manager by its name (native and composed components are handled as the same). These component prototypes are used to create new component instances. Each component has its own component context and component manager. If the component is part of a composed component then the component manager and the component context are different. Otherwise they would be the same.


Constructor & Destructor Documentation

virtual amire::component::ComponentContext::~ComponentContext  )  [virtual]
 

amire::component::ComponentContext::ComponentContext  )  [protected]
 


Member Function Documentation

virtual void amire::component::ComponentContext::changedInSlots const osg::ref_ptr< const Component > &  component  )  [protected, virtual]
 

Informs the context about modified in-slots of a component.

Reimplemented in amire::component::ComposedComponent.

virtual void amire::component::ComponentContext::changedInSlotType const osg::ref_ptr< const Component > &  component,
int  inSlotId,
const std::string &  inSlotName,
const osg::ref_ptr< const amire::property::PropertyType > &  oldInSlotType,
const osg::ref_ptr< const amire::property::PropertyType > &  newInSlotType
[protected, virtual]
 

Informs the context about a type modified slot.

Reimplemented in amire::component::ComposedComponent.

virtual void amire::component::ComponentContext::changedOutSlots const osg::ref_ptr< const Component > &  component  )  [protected, virtual]
 

Informs the context about modified out-slots of a component.

Reimplemented in amire::component::ComposedComponent.

virtual void amire::component::ComponentContext::changedOutSlotType const osg::ref_ptr< const Component > &  component,
int  outSlotId,
const std::string &  outSlotName,
const osg::ref_ptr< const amire::property::PropertyType > &  oldOutSlotType,
const osg::ref_ptr< const amire::property::PropertyType > &  newOutSlotType
[protected, virtual]
 

Informs the context about a type modified slot.

Reimplemented in amire::component::ComposedComponent.

bool amire::component::ComponentContext::connect const std::string &  emitter,
const std::string &  outSlot,
const std::string &  receiver,
const std::string &  inSlot,
const osg::ref_ptr< const ConnectionFilter > &  filter = NULL
 

Connects the out-slot of the emitter component with the in-slot of the receiver component. An exception thrown when either the emitter component or the recevier component are unknown for this context. Another possible case for an exception would be a unknown out-slot for the emitter or in-slot for the receiver.

void amire::component::ComponentContext::deleteComponent const osg::ref_ptr< Component > &  component  ) 
 

const osg::ref_ptr<Component>& amire::component::ComponentContext::getComponent const std::string &  name  )  const
 

Returns a reference to the component assigned to the given name. An exception is thrown when the name is unknown for this context.

const osg::ref_ptr<Component>& amire::component::ComponentContext::getComponent long  id  )  const
 

Returns a reference to the component assigned to the given id. An exception is thrown when the id is unknown for this context.

virtual osg::ref_ptr<const Component> amire::component::ComponentContext::getComponentPrototype const std::string &  name  )  [pure virtual]
 

Returns the the specified component prototype. An exception is thrown when the prototype is unknown for this context.

Implemented in amire::component::ComponentManager, and amire::component::ComposedComponent.

const std::vector<osg::ref_ptr<Component> >& amire::component::ComponentContext::getComponents  )  const
 

const std::string& amire::component::ComponentContext::getName long  id  )  const
 

int amire::component::ComponentContext::getPriority long  id  )  const
 

virtual std::string amire::component::ComponentContext::getQualifier  )  const [protected, virtual]
 

Returns the qualifier of this component context.

Reimplemented in amire::component::ComposedComponent.

osg::ref_ptr<Component> amire::component::ComponentContext::newComponent const std::string &  prototypeName,
const std::string &  identifier
 

Returns a reference to a new component cloned from the spcified prototype. Further this context is assigned to the component as its current context. The component name is initialized with the given name. An exception is thrown when the prototype is unknown for this context.

osg::ref_ptr<Component> amire::component::ComponentContext::newComponent const std::string &  prototypeName  ) 
 

Returns a reference to a new component cloned from the spcified prototype. Further this context is assigned to the component as its current context. The component name is initialized with its prototype name and an increasing number of the created instances of this prototype. An exception is thrown when the prototype is unknown for this context.

long amire::component::ComponentContext::nextComponentId  )  [protected]
 

Returns a new id for a component.

virtual void amire::component::ComponentContext::removedInSlot const osg::ref_ptr< const Component > &  component,
int  inSlotId,
const std::string &  inSlotName,
const osg::ref_ptr< const amire::property::PropertyType > &  inSlotType
[protected, virtual]
 

Informs the context about a removed slot.

virtual void amire::component::ComponentContext::removedOutSlot const osg::ref_ptr< const Component > &  component,
int  outSlotId,
const std::string &  outSlotName,
const osg::ref_ptr< const amire::property::PropertyType > &  outSlotType
[protected, virtual]
 

Informs the context about a removed slot.

virtual void amire::component::ComponentContext::renamedInSlot const osg::ref_ptr< const Component > &  component,
int  inSlotId,
const std::string &  oldInSlotName,
const std::string &  newInSlotName
[protected, virtual]
 

Informs the context about a renamed slot.

Reimplemented in amire::component::ComposedComponent.

virtual void amire::component::ComponentContext::renamedOutSlot const osg::ref_ptr< const Component > &  component,
int  outSlotId,
const std::string &  oldOutSlotName,
const std::string &  newOutSlotName
[protected, virtual]
 

Informs the context about a renamed slot.

Reimplemented in amire::component::ComposedComponent.

void amire::component::ComponentContext::setName long  id,
const std::string &  name
 

void amire::component::ComponentContext::setPriority long  id,
int  priority
 


Friends And Related Function Documentation

friend class Component [friend]
 

Reimplemented in amire::component::ComponentManager, and amire::component::ComposedComponent.

friend class ComposedComponent [friend]
 


Member Data Documentation

std::vector<osg::ref_ptr<Component> > amire::component::ComponentContext::components [protected]
 


The documentation for this class was generated from the following file:
Generated on Tue May 20 17:23:56 2003 for AMIRE-Framework by doxygen1.3