Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
reranker::VarMapBase Class Referenceabstract

A base class for a mapping from variables of a specific type to their values. More...

#include <environment.H>

Inheritance diagram for reranker::VarMapBase:
reranker::VarMap< T >

Public Member Functions

 VarMapBase (const string &name, Environment *env, bool is_primitive)
 Constructs a base class for a concrete implementation providing a mapping from variables of a particular type to their values. More...
 
virtual ~VarMapBase ()
 
virtual bool IsPrimitive () const
 Returns whether this instance contains primitive or primtive vector variables. More...
 
virtual const string & Name () const
 Returns the type name of the variables of this instance. More...
 
virtual bool Defined (const string &varname) const =0
 Returns whether the specified variable has a definition in this environment. More...
 
virtual void ReadAndSet (const string &varname, StreamTokenizer &st)=0
 Reads the next value (primitive or spec for constructing a Factory-constructible object) from the specified stream tokenizer and sets the specified variable to that value. More...
 
virtual void Print (ostream &os) const =0
 Prints out a human-readable string to the specified output stream containing the variables, their type and, if primitive, their values. More...
 
virtual VarMapBaseCopy (Environment *env) const =0
 Returns a newly constructed copy of this VarMap. More...
 

Protected Member Functions

void SetMembers (const string &name, Environment *env, bool is_primitive)
 To allow proper implementation of Copy in VarMapBase implementation, since we don't get copying of base class' members for free. More...
 

Protected Attributes

string name_
 The type name of this VarMap. More...
 
Environmentenv_
 The Environment that holds this VarMap instance. More...
 
bool is_primitive_
 Whether this VarMap instance holds variables of primitive type or vector of primitives. More...
 

Detailed Description

A base class for a mapping from variables of a specific type to their values.

Definition at line 65 of file environment.H.

Constructor & Destructor Documentation

reranker::VarMapBase::VarMapBase ( const string &  name,
Environment env,
bool  is_primitive 
)
inline

Constructs a base class for a concrete implementation providing a mapping from variables of a particular type to their values.

Parameters
namethe type name of the variables in this instance
envthe Environment that wraps this VarMapBase instance
is_primitivewhether this instance contains primitive or primitive vector variables

Definition at line 75 of file environment.H.

virtual reranker::VarMapBase::~VarMapBase ( )
inlinevirtual

Definition at line 78 of file environment.H.

Member Function Documentation

virtual VarMapBase* reranker::VarMapBase::Copy ( Environment env) const
pure virtual

Returns a newly constructed copy of this VarMap.

Implemented in reranker::VarMap< T >.

virtual bool reranker::VarMapBase::Defined ( const string &  varname) const
pure virtual

Returns whether the specified variable has a definition in this environment.

Implemented in reranker::VarMap< T >.

virtual bool reranker::VarMapBase::IsPrimitive ( ) const
inlinevirtual

Returns whether this instance contains primitive or primtive vector variables.

Definition at line 82 of file environment.H.

virtual const string& reranker::VarMapBase::Name ( ) const
inlinevirtual

Returns the type name of the variables of this instance.

Definition at line 85 of file environment.H.

virtual void reranker::VarMapBase::Print ( ostream &  os) const
pure virtual

Prints out a human-readable string to the specified output stream containing the variables, their type and, if primitive, their values.

Implemented in reranker::VarMap< T >.

virtual void reranker::VarMapBase::ReadAndSet ( const string &  varname,
StreamTokenizer st 
)
pure virtual

Reads the next value (primitive or spec for constructing a Factory-constructible object) from the specified stream tokenizer and sets the specified variable to that value.

Implemented in reranker::VarMap< T >.

void reranker::VarMapBase::SetMembers ( const string &  name,
Environment env,
bool  is_primitive 
)
inlineprotected

To allow proper implementation of Copy in VarMapBase implementation, since we don't get copying of base class' members for free.

Definition at line 108 of file environment.H.

Member Data Documentation

Environment* reranker::VarMapBase::env_
protected

The Environment that holds this VarMap instance.

Definition at line 117 of file environment.H.

bool reranker::VarMapBase::is_primitive_
protected

Whether this VarMap instance holds variables of primitive type or vector of primitives.

Definition at line 120 of file environment.H.

string reranker::VarMapBase::name_
protected

The type name of this VarMap.

Definition at line 115 of file environment.H.


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