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 | List of all members
reranker::EnvironmentImpl Class Reference

Provides a set of named variables and their types, as well as the values for those variables. More...

#include <environment-impl.H>

Inheritance diagram for reranker::EnvironmentImpl:
reranker::Environment

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 VarMapBaseGetVarMap (const string &varname)
 Retrieves the VarMap instance for the specified variable. More...
 
virtual VarMapBaseGetVarMapForType (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 EnvironmentCopy () 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 EnvironmentCreateEmpty ()
 A static factory method to create a new, empty Environment instance. More...
 

Detailed Description

Provides a set of named variables and their types, as well as the values for those variables.

See Also
Interpreter

Definition at line 59 of file environment-impl.H.

Constructor & Destructor Documentation

reranker::EnvironmentImpl::EnvironmentImpl ( int  debug = 0)

Constructs a new, empty environment.

Parameters
debugthe debug level; if greater than 0, various debugging messages will be output to std::cerr

Definition at line 41 of file environment-impl.C.

virtual reranker::EnvironmentImpl::~EnvironmentImpl ( )
inlinevirtual

Destroys this environment.

Definition at line 68 of file environment-impl.H.

Member Function Documentation

virtual Environment* reranker::EnvironmentImpl::Copy ( ) const
inlinevirtual

Returns a copy of this environment.

Implements reranker::Environment.

Definition at line 132 of file environment-impl.H.

virtual bool reranker::EnvironmentImpl::Defined ( const string &  varname) const
inlinevirtual

Returns whether the specified variable has been defined in this environment.

Implements reranker::Environment.

Definition at line 77 of file environment-impl.H.

template<typename T >
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.

Parameters
varnamethe name of the variable whose value is to be retrieved
[out]valuea pointer to the object whose value is to be set
Returns
whether the specified variable exists and its value was successfully set by this method

Definition at line 176 of file environment-impl.H.

virtual const string& reranker::EnvironmentImpl::GetType ( const string &  varname) const
inlinevirtual

Retrieves the type name of the specified variable.

Implements reranker::Environment.

Definition at line 87 of file environment-impl.H.

virtual VarMapBase* reranker::EnvironmentImpl::GetVarMap ( const string &  varname)
inlinevirtual

Retrieves the VarMap instance for the specified variable.

Implements reranker::Environment.

Definition at line 96 of file environment-impl.H.

virtual VarMapBase* reranker::EnvironmentImpl::GetVarMapForType ( const string &  type)
inlinevirtual

Retrieves the VarMap instance for the specified type.

Implements reranker::Environment.

Definition at line 101 of file environment-impl.H.

virtual void reranker::EnvironmentImpl::Print ( ostream &  os) const
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.

void reranker::EnvironmentImpl::PrintFactories ( ostream &  os) const
virtual

Prints out a human-readable string with the names of all abstract base types and their concrete implementations that may be constructed.

See Also
reranker::FactoryContainer::Print

Implements reranker::Environment.

Definition at line 241 of file environment-impl.C.

void reranker::EnvironmentImpl::ReadAndSet ( const string &  varname,
StreamTokenizer st,
const string  type 
)
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.


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