Public Member Functions | Private Types | Private Attributes | Static 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 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_

Private Attributes

PrcMapType_ prcMap_
CmdMapType_ cmdMap_
bool dummy_

Static Private Attributes

static const ProcessorkvProcessors_
static const Processorprocessors_

Detailed Description

The processor manager.

This class centralizes 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 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.

Member Data Documentation

bool dummy_ [private]

The following three data members are used to refer to ProcessorInstantiators implemented by bridge libraries. Otherwise, the processor pointers won't be included by the linker and, consequently, registration won't occur.