Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

ContactCreator< T > Class Template Reference

#include <ContactFactory.hh>

Inherits ContactFactory.

List of all members.


Detailed Description

template<class T>
class ContactCreator< T >

Family of contact factory implementations templated on various contact types.

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)
Contactestablish (DeContactEvent *event, Object *a, Object *b)
const char * productName (void)


Constructor & Destructor Documentation

template<class T>
ContactCreator< T >::ContactCreator const char *  alias,
utils::ConfigFile *  params
[inline]
 

This constructor creates a factory for contact type . All contacts that are manufactured are configured with the supplied parameter set "p".


Member Function Documentation

template<class T>
Contact* ContactCreator< T >::establish DeContactEvent *  event,
Object a,
Object b
[inline, virtual]
 

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.


SimLib Reference Documentation