#include <LogicFactory.h>
Public Member Functions | |
Ilogic * | CreateObject (const Identifier &id) |
bool | Register (const Identifier &id, LogicCreator creator) |
bool | Unregister (const Identifier &id) |
Private Attributes | |
std::map< Identifier, LogicCreator > | m_associations |
email: aosorio@uniandes.edu.co
Definition at line 21 of file LogicFactory.h.
Ilogic* LogicFactory< Ilogic, Identifier, LogicCreator >::CreateObject | ( | const Identifier & | id | ) | [inline] |
Definition at line 39 of file LogicFactory.h.
Referenced by LogicTool< RBCLogic >::retrieve().
{ typename std::map<Identifier, LogicCreator>::const_iterator itr; itr = m_associations.find( id ); if ( itr != m_associations.end() ) { return ( itr->second )(); } else return NULL; // handle error }
bool LogicFactory< Ilogic, Identifier, LogicCreator >::Register | ( | const Identifier & | id, |
LogicCreator | creator | ||
) | [inline] |
Definition at line 24 of file LogicFactory.h.
Referenced by LogicTool< RBCLogic >::initialise().
{ return m_associations.insert(typename std::map<Identifier, LogicCreator>::value_type(id,creator)).second; }
bool LogicFactory< Ilogic, Identifier, LogicCreator >::Unregister | ( | const Identifier & | id | ) | [inline] |
Definition at line 29 of file LogicFactory.h.
Referenced by LogicTool< RBCLogic >::endjob().
{ typename std::map<Identifier, LogicCreator>::const_iterator itr; itr = m_associations.find(id); if( itr != m_associations.end() ) { delete ( itr->second )() ; } return m_associations.erase(id) == 1; }
std::map<Identifier, LogicCreator> LogicFactory< Ilogic, Identifier, LogicCreator >::m_associations [private] |
Definition at line 53 of file LogicFactory.h.
Referenced by LogicFactory< GenLogic, std::string >::CreateObject(), LogicFactory< GenLogic, std::string >::Register(), and LogicFactory< GenLogic, std::string >::Unregister().