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::Cow Class Reference

A class to represent a cow. More...

#include <example.h>

Inheritance diagram for infact::Cow:
infact::Animal infact::FactoryConstructible

Public Member Functions

 Cow ()
 Constructs a cow. More...
 
virtual ~Cow ()
 
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 const string & name () const
 Returns the name of this animal. More...
 
virtual int age () const
 Returns the age of this animal. More...
 
- Public Member Functions inherited from infact::Animal
 Animal ()
 Constructs a generic animal. More...
 
virtual ~Animal ()
 Destroys this animal. More...
 
- Public Member Functions inherited from infact::FactoryConstructible
virtual ~FactoryConstructible ()
 Destroys this instance. 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

A class to represent a cow.

Definition at line 179 of file example.h.

Constructor & Destructor Documentation

infact::Cow::Cow ( )
inline

Constructs a cow.

Definition at line 182 of file example.h.

virtual infact::Cow::~Cow ( )
inlinevirtual

Definition at line 187 of file example.h.

Member Function Documentation

virtual int infact::Cow::age ( ) const
inlinevirtual

Returns the age of this animal.

Implements infact::Animal.

Definition at line 196 of file example.h.

virtual const string& infact::Cow::name ( ) const
inlinevirtual

Returns the name of this animal.

Implements infact::Animal.

Definition at line 195 of file example.h.

virtual void infact::Cow::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 from infact::FactoryConstructible.

Definition at line 189 of file example.h.


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