Public Member Functions | Private Types | Private Attributes

ProcessorMngr Class Reference

The processor manager. More...

#include <keyvalue/mngt/ProcessorMngr.h>

List of all members.

Public Member Functions

void add (const Processor &processor)
 Registers a Processor.
const ProcessorgetProcessor (const string &name) const
 Gets Processor of a given name.
const AbstractBuilderfindBuilder (const ::std::type_info &type) const
 Gets the Builder for a given type.
const CommandgetCommand (const string &name) const
 Gets Command of a given name.
value::Vector getCmdList () const
 Gets the list of all registered Commands.

Private Types

typedef ::std::map< string,
const Processor * > 
PrcMapType_
typedef ::std::map< string,
const Command * > 
CmdMapType_
typedef ::std::map< const
std::type_info *, const
AbstractBuilder * > 
BldMapType_

Private Attributes

PrcMapType_ prcMap_
CmdMapType_ cmdMap_
BldMapType_ bldMap_

Detailed Description

The processor manager.

This class centralises the processing of all types of results. It maps Processor's names to a corresponding pointer to Processor.

Given the Processor's name and an input sufficient for the processing, this class redirects the input to the correct Processor.

Use util::Global to access the global ProcessorMngr.


Member Function Documentation

void add ( const Processor processor  ) 

Registers a Processor.

Parameters:
processor : A pointer to the Processor to be registered.
const Processor& getProcessor ( const string &  name  )  const

Gets Processor of a given name.

Parameters:
name : The name of the Processor to be retrieved.
Returns:
The Processor.
Exceptions:
RuntimeError : If there is no registered Processor called name.
const AbstractBuilder* findBuilder ( const ::std::type_info &  type  )  const

Gets the Builder for a given type.

Recall that each concrete Builder is a template class specialisation for a given ObjectType.

Parameters:
type : The std::type_info for ObjectType.
Returns:
A pointer to the Builder for OutputType if there is such a Builder. Otherwise a null pointer.
const Command& getCommand ( const string &  name  )  const

Gets Command of a given name.

Parameters:
name : The name of the Command to be retrieved.
Returns:
The Command.
Exceptions:
RuntimeError : If there is no registered Command called name.
value::Vector getCmdList (  )  const

Gets the list of all registered Commands.

Returns:
A vector with names of registered Commands.