#include <ContactFactory.hh>
Inherits ContactFactory.
The family of templated ContactCreator classes implement contact factories for each contact primitive . These contact types must be defined as classes derived from Contact and have a constructor with no arguments. Furthermore, the are required to provide a static member function T::familyName() that returns a string name for the contact primitive they represent. This helps to identify what kind of product the factory is responsible from manufacturing.
The constructor for this class takes a string alias and a parameter set represented with a ConfigFile object. The supplied parameter set in particular, is passed to the Contact::establish method and can be used by contact primitive instances to parameterize their behavior. Note that this yields the ability to create multiple factories for a single contact primitive, each having a different parameterization. These parameter sets will be defined in a PCM configuration file.
Public Member Functions | |
| ContactCreator (const char *alias, utils::ConfigFile *params) | |
| Contact * | establish (DeContactEvent *event, Object *a, Object *b) |
| const char * | productName (void) |
|
||||||||||||||||
|
This constructor creates a factory for contact type . All contacts that are manufactured are configured with the supplied parameter set "p". |
|
||||||||||||||||||||
|
The derived implementation of this method creates a new contact object of type T, calls its establish method with the appropriate parameter set and returns a generic Contact pointer Implements ContactFactory. |