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 | Protected Attributes | List of all members
infact::MemberInitializer Class Referenceabstract

An interface for data member initializers of members of a Factory-constructible object. More...

#include <factory.h>

Inheritance diagram for infact::MemberInitializer:
infact::TypedMemberInitializer< T >

Public Member Functions

 MemberInitializer (const string &name, bool required)
 Initializes this base class. More...
 
virtual ~MemberInitializer ()
 Destroys this instance. More...
 
virtual string Name ()
 Returns the name of the member initialized by this instance, as it should appear in a spec string parsed by Factory::CreateOrDie. More...
 
virtual void Init (StreamTokenizer &st, Environment *env)=0
 Initializes this instance based on the following tokens obtained from the specified StreamTokenizer. More...
 
virtual int Initialized () const
 Returns the number of times this member initializer’s Init method has been invoked. More...
 
virtual bool Required () const
 Whether this member is required to be initialized in a spec string. More...
 

Protected Attributes

string name_
 The name of this member. More...
 
int initialized_
 The number of times this member initializer’s Init method has been invoked. More...
 
bool required_
 Whether this member is required to be initialized. More...
 

Detailed Description

An interface for data member initializers of members of a Factory-constructible object.

Definition at line 232 of file factory.h.

Constructor & Destructor Documentation

infact::MemberInitializer::MemberInitializer ( const string &  name,
bool  required 
)
inline

Initializes this base class.

Parameters
namethe name of the member to be initialized, as it should Factory::CreateOrDie method
requiredwhether this member is required to be initialized in a spec string

Definition at line 241 of file factory.h.

virtual infact::MemberInitializer::~MemberInitializer ( )
inlinevirtual

Destroys this instance.

Definition at line 245 of file factory.h.

Member Function Documentation

virtual void infact::MemberInitializer::Init ( StreamTokenizer st,
Environment env 
)
pure virtual

Initializes this instance based on the following tokens obtained from the specified StreamTokenizer.

Parameters
stthe stream tokenizer whose next tokens contain the information to initialize this data member
envthe current environment, to be modified by this member’s initialization

Implemented in infact::TypedMemberInitializer< T >.

virtual int infact::MemberInitializer::Initialized ( ) const
inlinevirtual

Returns the number of times this member initializer’s Init method has been invoked.

Definition at line 266 of file factory.h.

virtual string infact::MemberInitializer::Name ( )
inlinevirtual

Returns the name of the member initialized by this instance, as it should appear in a spec string parsed by Factory::CreateOrDie.

While it is not a requirement that this name be identical to the declared name of the member in its C++ class, the convention is to use the declared name without an underscore.

Definition at line 253 of file factory.h.

virtual bool infact::MemberInitializer::Required ( ) const
inlinevirtual

Whether this member is required to be initialized in a spec string.

Definition at line 269 of file factory.h.

Member Data Documentation

int infact::MemberInitializer::initialized_
protected

The number of times this member initializer’s Init method has been invoked.

Definition at line 276 of file factory.h.

string infact::MemberInitializer::name_
protected

The name of this member.

Definition at line 273 of file factory.h.

bool infact::MemberInitializer::required_
protected

Whether this member is required to be initialized.

Definition at line 278 of file factory.h.


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