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 type.

Static Public Member Functions

static ProcessorMngrgetInstance ()
 Gets the unique instance of this class.

Private Types

typedef std::map< string,
const Processor * > 
MapType_

Private Attributes

MapType_ map_
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.

This class is a singleton that is constructed only when its getInstance() method is called for the first time.


Member Function Documentation

static ProcessorMngr& getInstance (  )  [static]

Gets the unique instance of this class.

Returns:
A reference to the unique instance.
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 type.

Parameters:
type : The type Processor's type;
Returns:
The Processor.
Exceptions:
RuntimeError() : If there is no registered Processor for type.

Member Data Documentation

const Processor* kvProcessors_[] [static, private]

An array of registers of KeyValue Processor implementations is needed to have at least one symbol in KeyValue library which refer to the registers. Otherwise they won't be included by the linker and, consequently, registration won't occur.

This variable is set in keyvalue/mngt/Register.cpp

const Processor* processors_[] [static, private]

Similarly to kvProcessors_ but for Processors of core library objects and results.

This variable must be set by the bridge library.


Generated on Sat Mar 20 15:08:30 2010 for KeyValue by  doxygen 1.6.1