EventAnalysis  1.3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EA::ConfigurationTokensHandler Class Referenceabstract

Interface of configuration token handler classes. More...

#include <ConfigurationTokensHandler.h>

Inheritance diagram for EA::ConfigurationTokensHandler:
EA::DataProviderConfigurationTokensHandler EA::EventLoopConfigurationTokensHandler EA::PersistenceConfigurationTokensHandler

Public Member Functions

 ConfigurationTokensHandler (AnalysisManager &manager, const CommandLineParameters &clParams)
 Constructor. More...
 
virtual ~ConfigurationTokensHandler ()
 Destructor. More...
 
virtual bool HandleTokens (const std::vector< std::string > &tokens)=0
 Configures the analysis according to given tokens. More...
 

Protected Member Functions

bool SetParameter (const std::string &name, const std::string &value, Configurable &obj)
 Set a parameter of a given Configurable object. More...
 

Protected Attributes

AnalysisManageranManager
 
const CommandLineParametersclParameters
 

Detailed Description

Interface of configuration token handler classes.

Classes implementing this interface configure the analysis according to a vector of configuration strings (tokens) read from a single line of a text file.

Derived classes handles a specific text file command and eventual sub-commands. Instances of derived classes are created by #TokenizedConfigLineHandler; to allow for automatic construction, derived classes must be registered in the ConfigurationTokensHandler Factory using the command name as the builder name.

Constructor & Destructor Documentation

◆ ConfigurationTokensHandler()

EA::ConfigurationTokensHandler::ConfigurationTokensHandler ( AnalysisManager manager,
const CommandLineParameters clParams 
)
inline

Constructor.

Parameters
managerThe analysis manager to be configured.

◆ ~ConfigurationTokensHandler()

virtual EA::ConfigurationTokensHandler::~ConfigurationTokensHandler ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ HandleTokens()

virtual bool EA::ConfigurationTokensHandler::HandleTokens ( const std::vector< std::string > &  tokens)
pure virtual

Configures the analysis according to given tokens.

The configuration tokens are processed. If the token sequence is not understood (e.g. wrong command name) then the method should return false; this is a soft error signal, since other token handlers might be able to understand and process the command. In case of hard errors (wrong number/type of arguments, other errors generated during the execution) an exception is thrown.

Parameters
tokensThe configuration tokens.
Returns
false if the given token sequence is not understood and cannot be handled.
Exceptions
std::runtime_errorif error occurs during the handling (implementations may throw other kind of exceptions).

Implemented in EA::EventLoopConfigurationTokensHandler, EA::PersistenceConfigurationTokensHandler, and EA::DataProviderConfigurationTokensHandler.

◆ SetParameter()

bool EA::ConfigurationTokensHandler::SetParameter ( const std::string &  name,
const std::string &  value,
Configurable obj 
)
protected

Set a parameter of a given Configurable object.

Converts the parameter value from string to the correct type and then sets the value in the given Configurable object.

Member Data Documentation

◆ anManager

AnalysisManager& EA::ConfigurationTokensHandler::anManager
protected

◆ clParameters

const CommandLineParameters& EA::ConfigurationTokensHandler::clParameters
protected

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