Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
|
Provides a set of named variables and their types, as well as the values for those variables. More...
#include <environment-impl.H>
Public Member Functions | |
EnvironmentImpl (int debug=0) | |
Constructs a new, empty environment. More... | |
virtual | ~EnvironmentImpl () |
Destroys this environment. More... | |
virtual bool | Defined (const string &varname) const |
Returns whether the specified variable has been defined in this environment. More... | |
virtual void | ReadAndSet (const string &varname, StreamTokenizer &st, const string type) |
Sets the specified variable to the value obtained from the following tokens available from the specified token stream. More... | |
virtual const string & | GetType (const string &varname) const |
Retrieves the type name of the specified variable. More... | |
virtual VarMapBase * | GetVarMap (const string &varname) |
Retrieves the VarMap instance for the specified variable. More... | |
virtual VarMapBase * | GetVarMapForType (const string &type) |
Retrieves the VarMap instance for the specified type. More... | |
virtual void | Print (ostream &os) const |
Prints a human-readable string of all the variables in this environment, their types and, if primitive, their values. More... | |
virtual void | PrintFactories (ostream &os) const |
Prints out a human-readable string with the names of all abstract base types and their concrete implementations that may be constructed. More... | |
virtual Environment * | Copy () const |
Returns a copy of this environment. More... | |
template<typename T > | |
bool | Get (const string &varname, T *value) const |
Retrieves the value of the variable with the specified name and puts into into the object pointed to by the value parameter. More... | |
Public Member Functions inherited from reranker::Environment | |
virtual | ~Environment () |
Additional Inherited Members | |
Static Public Member Functions inherited from reranker::Environment | |
static Environment * | CreateEmpty () |
A static factory method to create a new, empty Environment instance. More... | |
Provides a set of named variables and their types, as well as the values for those variables.
Definition at line 59 of file environment-impl.H.
reranker::EnvironmentImpl::EnvironmentImpl | ( | int | debug = 0 | ) |
Constructs a new, empty environment.
debug | the debug level; if greater than 0, various debugging messages will be output to std::cerr |
Definition at line 41 of file environment-impl.C.
|
inlinevirtual |
Destroys this environment.
Definition at line 68 of file environment-impl.H.
|
inlinevirtual |
Returns a copy of this environment.
Implements reranker::Environment.
Definition at line 132 of file environment-impl.H.
|
inlinevirtual |
Returns whether the specified variable has been defined in this environment.
Implements reranker::Environment.
Definition at line 77 of file environment-impl.H.
bool reranker::EnvironmentImpl::Get | ( | const string & | varname, |
T * | value | ||
) | const |
Retrieves the value of the variable with the specified name and puts into into the object pointed to by the value
parameter.
varname | the name of the variable whose value is to be retrieved | |
[out] | value | a pointer to the object whose value is to be set |
Definition at line 176 of file environment-impl.H.
|
inlinevirtual |
Retrieves the type name of the specified variable.
Implements reranker::Environment.
Definition at line 87 of file environment-impl.H.
|
inlinevirtual |
Retrieves the VarMap instance for the specified variable.
Implements reranker::Environment.
Definition at line 96 of file environment-impl.H.
|
inlinevirtual |
Retrieves the VarMap instance for the specified type.
Implements reranker::Environment.
Definition at line 101 of file environment-impl.H.
|
inlinevirtual |
Prints a human-readable string of all the variables in this environment, their types and, if primitive, their values.
Implements reranker::Environment.
Definition at line 120 of file environment-impl.H.
|
virtual |
Prints out a human-readable string with the names of all abstract base types and their concrete implementations that may be constructed.
Implements reranker::Environment.
Definition at line 241 of file environment-impl.C.
|
virtual |
Sets the specified variable to the value obtained from the following tokens available from the specified token stream.
Implements reranker::Environment.
Definition at line 107 of file environment-impl.C.