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 | Static Public Member Functions | List of all members
reranker::Environment Class Referenceabstract

An interface for an environment in which variables of various types are mapped to their values. More...

#include <environment.H>

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

Public Member Functions

virtual ~Environment ()
 
virtual bool Defined (const string &varname) const =0
 Returns whether the specified variable has been defined in this environment. More...
 
virtual void ReadAndSet (const string &varname, StreamTokenizer &st, const string type="")=0
 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 =0
 Retrieves the type name of the specified variable. More...
 
virtual VarMapBaseGetVarMap (const string &varname)=0
 Retrieves the VarMap instance for the specified variable. More...
 
virtual VarMapBaseGetVarMapForType (const string &type)=0
 Retrieves the VarMap instance for the specified type, or NULL if there is no such VarMap. More...
 
virtual void Print (ostream &os) const =0
 Prints a human-readable string of all the variables in this environment, their types and, if primitive, their values. More...
 
virtual EnvironmentCopy () const =0
 Returns a copy of this environment. More...
 
virtual void PrintFactories (ostream &os) const =0
 Prints out a human-readable string with the names of all abstract base types and their concrete implementations that may be constructed. More...
 

Static Public Member Functions

static EnvironmentCreateEmpty ()
 A static factory method to create a new, empty Environment instance. More...
 

Detailed Description

An interface for an environment in which variables of various types are mapped to their values.

Definition at line 125 of file environment.H.

Constructor & Destructor Documentation

virtual reranker::Environment::~Environment ( )
inlinevirtual

Definition at line 127 of file environment.H.

Member Function Documentation

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

Returns a copy of this environment.

Implemented in reranker::EnvironmentImpl.

Environment * reranker::Environment::CreateEmpty ( )
static

A static factory method to create a new, empty Environment instance.

Definition at line 43 of file environment.C.

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

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

Implemented in reranker::EnvironmentImpl.

virtual const string& reranker::Environment::GetType ( const string &  varname) const
pure virtual

Retrieves the type name of the specified variable.

Implemented in reranker::EnvironmentImpl.

virtual VarMapBase* reranker::Environment::GetVarMap ( const string &  varname)
pure virtual

Retrieves the VarMap instance for the specified variable.

Implemented in reranker::EnvironmentImpl.

virtual VarMapBase* reranker::Environment::GetVarMapForType ( const string &  type)
pure virtual

Retrieves the VarMap instance for the specified type, or NULL if there is no such VarMap.

The specified type must either be a primitive type, a primitive vector type, a Factory-constructible type or a vector of Factory-constructible types.

If the specified type is a concrete implementation of a Factory-constructible type, then the pointer to the VarMap for its abstract base type is returned; for example, if the specified type is "RankFeatureExtactor" then this method will return the VarMap containing "FeatureExtractor" instances.

TODO(dbikel): Support returning the VarMap for vectors of abstract type when the user specifies a vector of concrete type. E.g., if the specified type is "RankFeatureExtractor[]" then this method should return the VarMap containing "FeatureExtractor[]" instances.

Implemented in reranker::EnvironmentImpl.

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

Prints a human-readable string of all the variables in this environment, their types and, if primitive, their values.

Implemented in reranker::EnvironmentImpl.

virtual void reranker::Environment::PrintFactories ( ostream &  os) const
pure 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

Implemented in reranker::EnvironmentImpl.

virtual void reranker::Environment::ReadAndSet ( const string &  varname,
StreamTokenizer st,
const string  type = "" 
)
pure virtual

Sets the specified variable to the value obtained from the following tokens available from the specified token stream.

Implemented in reranker::EnvironmentImpl.


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