Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
|
A container to hold the mapping between named variables of a specific type and their values. More...
#include <environment.H>
Public Member Functions | |
VarMap (const string &name, Environment *env, bool is_primitive=true) | |
Constructs a mapping from variables of a particular type to their values. More... | |
virtual | ~VarMap () |
bool | Get (const string &varname, T *value) const |
Assigns the value of the specified variable to the object pointed to by the value parameter. More... | |
virtual bool | Defined (const string &varname) const |
Returns whether the specified variable has a definition in this environment. More... | |
void | Set (const string &varname, T value) |
Sets the specified variable to the specified value. More... | |
virtual void | ReadAndSet (const string &varname, StreamTokenizer &st) |
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 |
Prints out a human-readable string to the specified output stream containing the variables, their type and, if primitive, their values. More... | |
virtual VarMapBase * | Copy (Environment *env) const |
Returns a newly constructed copy of this VarMap. More... | |
Public Member Functions inherited from reranker::VarMapBase | |
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... | |
Additional Inherited Members | |
Protected Member Functions inherited from reranker::VarMapBase | |
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 inherited from reranker::VarMapBase | |
string | name_ |
The type name of this VarMap. More... | |
Environment * | env_ |
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... | |
A container to hold the mapping between named variables of a specific type and their values.
T | the type of variables held by this variable map |
Definition at line 256 of file environment.H.
|
inline |
Constructs a mapping from variables of a particular type to their values.
name | the type name of the variables in this instance |
env | the Environment that contains this VarMap instance |
is_primitive | whether this instance contains primitive or primitive vector variables |
Definition at line 265 of file environment.H.
|
inlinevirtual |
Definition at line 268 of file environment.H.
|
inlinevirtual |
Returns a newly constructed copy of this VarMap.
Implements reranker::VarMapBase.
Definition at line 360 of file environment.H.
|
inlinevirtual |
Returns whether the specified variable has a definition in this environment.
Implements reranker::VarMapBase.
Definition at line 288 of file environment.H.
|
inline |
Assigns the value of the specified variable to the object pointed to by the value
parameter.
Definition at line 277 of file environment.H.
|
inlinevirtual |
Prints out a human-readable string to the specified output stream containing the variables, their type and, if primitive, their values.
Implements reranker::VarMapBase.
Definition at line 345 of file environment.H.
|
inlinevirtual |
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.
Implements reranker::VarMapBase.
Definition at line 298 of file environment.H.
|
inline |
Sets the specified variable to the specified value.
Definition at line 293 of file environment.H.