ContactFactory Class Reference
#include <ContactFactory.hh>
Inherited by ContactCreator< T >, and ContactCreator< DefaultContact >.
List of all members.
Detailed Description
Interface class for all contact factories.
The ContactFactory class defines the interface to all contact factories. Contact factories are entities that are responsible from manufacturing instances of particular contacts types. An important example is the family of ContactCreator classes, which are templated on derivatives of Contact and derived from this class, performing creation of appropriate types of contacts upon request.
This abstract base class provides facilities to keep track of a string "alias" and a set of parameters associated with each instance. Specified during construction, they can be used by the derived classes or queried externally. The string alias is useful for identifying particular instances of factories, which may be simply different parametrizations of the same contact primitive.
Finally, the productName() method specifies an interface for retrieving the name (or "type") or the contact primitive manufactured by derived classes. Together with the alias, it provides means of uniquely identifying each contact factory object with respect to the config file.
Constructor & Destructor Documentation
| ContactFactory::ContactFactory |
( |
const char * |
alias, |
|
|
utils::ConfigFile * |
params |
|
) |
[inline] |
|
|
|
This constructor creates a contact factory base object with the specified alias and parameter set. |
|
|
This destructor cleans up internal objects and destroys the factory |
Member Function Documentation
| virtual Contact* ContactFactory::establish |
( |
DeContactEvent * |
event, |
|
|
Object * |
a, |
|
|
Object * |
b |
|
) |
[pure virtual] |
|
| const char* ContactFactory::getAlias |
( |
void |
|
) |
[inline] |
|
|
|
This method returns the alias string for the factory object |
| utils::ConfigFile* ContactFactory::getParams |
( |
void |
|
) |
[inline] |
|
|
|
This method returns the parameter settings for the factory object |
| virtual const char* ContactFactory::productName |
( |
void |
|
) |
[pure virtual] |
|
|
|
Derived classes must implement this method to return the type name of the contact object to be manufactured. Mainly used for display and debugging purposes |
SimLib Reference Documentation