InFact
Interpreter and factory for easily creating C++ objects at run-time
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
infact::FactoryConstructible Class Reference

An interface simply to make it easier to implement Factory-constructible types by implementing both required methods to do nothing (use of this interface is completely optional; read more for more information). More...

#include <factory.h>

Inheritance diagram for infact::FactoryConstructible:
infact::Animal infact::Date infact::Person infact::PetOwner infact::Cow infact::Sheep infact::DateImpl infact::PersonImpl infact::HumanPetOwner

Public Member Functions

virtual ~FactoryConstructible ()
 Destroys this instance. More...
 
virtual void RegisterInitializers (Initializers &initializers)
 Registers data members of this class for initialization when an instance is constructed via the Factory::CreateOrDie method. More...
 
virtual void PostInit (const Environment *env, const string &init_str)
 Does any additional initialization after an instance of this class has been constructed, crucially giving access to the Environment that was in use and modified during construction by the Factory::CreateOrDie method. More...
 

Detailed Description

An interface simply to make it easier to implement Factory-constructible types by implementing both required methods to do nothing (use of this interface is completely optional; read more for more information).

The Factory class simply requires its template type to have the two methods defined in this class, and so it is not a requirement that all Factory-constructible classes derive from this class; they must merely have methods with the exact signatures of the methods of this class.

Definition at line 549 of file factory.h.

Constructor & Destructor Documentation

virtual infact::FactoryConstructible::~FactoryConstructible ( )
inlinevirtual

Destroys this instance.

Definition at line 552 of file factory.h.

Member Function Documentation

virtual void infact::FactoryConstructible::PostInit ( const Environment env,
const string &  init_str 
)
inlinevirtual

Does any additional initialization after an instance of this class has been constructed, crucially giving access to the Environment that was in use and modified during construction by the Factory::CreateOrDie method.

Parameters
envthe environment in use during construction by the Factory::CreateOrDie method
init_strthe entire string used to initialize this object (for example, PersonImpl(name("Fred")))

Reimplemented in infact::Sheep.

Definition at line 583 of file factory.h.

virtual void infact::FactoryConstructible::RegisterInitializers ( Initializers initializers)
inlinevirtual

Registers data members of this class for initialization when an instance is constructed via the Factory::CreateOrDie method.

Adding a data member for initialization is done via the templated Initializers::Add method. Please see infact::PersonImpl::RegisterInitializers for an example implementation.

Parameters
initializersan object that stores the initializers for various data members of this class that can be initialized by the Factory::CreateOrDie method
See Also
infact::Initializers::Add

Reimplemented in infact::HumanPetOwner, infact::Sheep, infact::Cow, infact::PersonImpl, and infact::DateImpl.

Definition at line 570 of file factory.h.


The documentation for this class was generated from the following file: