#include <PhxNamedInterface.h>
Inheritance diagram for Phx::NamedInterface::Manager:

Public Member Functions | |
| virtual Ptr< NamedInterface > | newNamedInterface (NamedInterface::Type interfaceType, const Ptr< Description > &description, const String &instanceName, NamedInterface::Identifier identifier)=0 |
| Constructs a new interface instance of the given type and assigns it the specified name and identifier if possible. | |
| virtual Ptr< NamedInterface > | newNamedInterface (NamedInterface::Type interfaceType, const Ptr< Description > &description, const String &instanceName)=0 |
| virtual Ptr< NamedInterface > | namedInterface (NamedInterface::Identifier identifier) const =0 |
| Locates and returns a pointer to an interface which is referred to by a given identifier. | |
| virtual Ptr< NamedInterface > | namedInterface (const String &name) const =0 |
| Locates and returns a pointer to an interface instance which is referred to by a given text name. | |
| virtual void | deleteNamedInterface (const Ptr< NamedInterface > &interface)=0 |
| Deletes an interface from this manager. | |
| virtual void | typeListener (NamedInterface::Type type, TypeListener *listener)=0 |
| Creates a new NamedInterface type by setting a listener that constructs instances of the NamedInterface class. | |
| template<class T> | |
| Ptr< TypeListener > | newNamedInterfaceType (void) |
| A convenience method that automatically creates an NamedInterface type by installing a standard TypeListener. | |
| virtual void | typeNameType (const String &typeName, NamedInterface::Type type)=0 |
| For a given name, sets the type constant for objects with that type name. | |
| virtual NamedInterface::Type | typeNameType (const String &typeName) const =0 |
| Retrives the type associated with a particular type name. | |
Static Public Attributes | |
| static const NamedInterface::Type | INTERFACE_TYPE |
| static const String | INTERFACE_TYPE_NAME |
Protected Member Functions | |
| void | setNamedInterfaceType (const Ptr< NamedInterface > &interface, NamedInterface::Type type) |
| void | setNamedInterfaceName (const Ptr< NamedInterface > &interface, const String &name) |
| void | setNamedInterfaceIdentifier (const Ptr< NamedInterface > &interface, NamedInterface::Identifier identifier) |
Classes | |
| class | DefaultTypeListener |
| class | TypeListener |
| A listener class which is used to call back the client to create and delete instances of a NamedInterface. More... | |
The manager provides for simple creation of objects by type via newNamedInterface().
You can register a new interface type by installing a TypeListener for that type.
|
|
Deletes an interface from this manager. This will remove any references to the given interface from this manager. When the object that is referred to by the given interface pointer needs to be removed from the system, this method should be called. This will unregister the instance name of the interface if it had one. Note that the object itself may not actually be freed. If other objects in the system are still holding Ptr references to it, then it may remain in existence until they release their references. This call simply releases the manager from the responsibility of keeping track of the object. Managers must be careful since releasing the final reference to an object may have unforseen consequences within the simulation. While not required, it is highly recommended that managers defer deletion of objects until it is known to be safe. The standard Manager provided by Core does exactly this.
|
|
|
Locates and returns a pointer to an interface instance which is referred to by a given text name.
|
|
|
Locates and returns a pointer to an interface which is referred to by a given identifier.
|
|
||||||||||||||||||||
|
Constructs a new interface instance of the given type and assigns it the specified name and identifier if possible.
|
|
||||||||||
|
A convenience method that automatically creates an NamedInterface type by installing a standard TypeListener. Normally, to create a new NamedInterface type you would create a TypeListener subclass which implements TypeListener::onNewNamedInterface() and onDeleteNamedInterface(). This is tedious for many situations. To simplify things, this (templatized) method automatically constructs a listener that will create an instance of the template parameter, and does nothing on interface deletion. You must explicitly supply the template parameter, which must be a type with a constructor of the form T::T(const Ptr<Description>&, const String&, NamedInterface::Identifier, const NamedInterface::Manager*) and also must derive, ultimately, from NamedInterface. The first three parameters passed to the constructor are the values that are passed to TypeListener::onNewNamedInterface(). The last parameter is a pointer to the interface manager in which the constructed object will reside.
T must also supply two public, const static data members. T::INTERFACE_TYPE is of type NamedInterface::Type and its value is the assigned type constant for the class (this is the
|
|
||||||||||||
|
Creates a new NamedInterface type by setting a listener that constructs instances of the NamedInterface class.
The listener's onNewNamedInterface() and onDeleteNamedInterface() methods will be called whenever NamedInterface's of type
|
|
|
Retrives the type associated with a particular type name.
|
|
||||||||||||
|
For a given name, sets the type constant for objects with that type name. Note that it is possible to associate multiple type names to the same type. However, this is presently not recommended.
type already set for it.
|
1.4.2