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.
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
-
tokens | The configuration tokens. |
- Returns
- false if the given token sequence is not understood and cannot be handled.
- Exceptions
-
std::runtime_error | if error occurs during the handling (implementations may throw other kind of exceptions). |
Implemented in EA::EventLoopConfigurationTokensHandler, EA::PersistenceConfigurationTokensHandler, and EA::DataProviderConfigurationTokensHandler.