Public Types | Public Member Functions | Protected Member Functions | List of all members
StringMatcherList< T > Class Template Reference

Utility for selecting a quantity label Applied by DataSelector. More...

#include <StringMatcherList.h>

Inheritance diagram for StringMatcherList< T >:
Inheritance graph
[legend]
Collaboration diagram for StringMatcherList< T >:
Collaboration graph
[legend]

Public Types

typedef T matcher_t
 
typedef std::list< T > list_t
 

Public Member Functions

template<typename ... TT>
 StringMatcherList (const TT &... args)
 Basic constructor.
 
 StringMatcherList (const StringMatcherList< T > &slct)
 Copy constructor. Copies the list of quantities.
 
virtual ~StringMatcherList ()
 Destructor.
 
template<typename ... TT>
void setKey (const std::string &arg, const TT &... args)
 Define the list of accepted quantities. More...
 
void setKeys (const std::string &args)
 Define the list of accepted quantities as a string. More...
 
template<typename ... TT>
void addKey (const std::string &arg, const TT &... args)
 Define a syntax for quantity key. Will be checked if listed quantity keys do not match. More...
 
bool test (const std::string &key, bool defaultResult=true) const
 Check if key is accepted. More...
 
bool isSet () const
 
const list_t & getList () const
 
void toStream (std::ostream &ostr) const
 

Protected Member Functions

void addKey ()
 
void adaptKey (const std::string &s)
 

Detailed Description

template<class T = std::string>
class drain::StringMatcherList< T >

Utility for selecting a quantity label Applied by DataSelector.

Member Function Documentation

◆ adaptKey()

void adaptKey ( const std::string &  s)
protected

In future, the recommended way to define desired/accepted quantities is a comma-separated list of keys.

◆ addKey()

void addKey ( const std::string &  arg,
const TT &...  args 
)
inline

Define a syntax for quantity key. Will be checked if listed quantity keys do not match.

Parameters
arg- regular expression, like "^DBZ[HV]?C?$
args- regular expressions of further quantities

◆ setKey()

void setKey ( const std::string &  arg,
const TT &...  args 
)
inline

Define the list of accepted quantities.

Parameters
arg- this first arg can be also a comma-separated list of quantities - literals or regExps.
args- separate list of quantities - literals or regExps.

◆ setKeys()

void setKeys ( const std::string &  args)

Define the list of accepted quantities as a string.

Parameters
args- comma-separated list of quantities: literals or regexps.
separators- can be also ",:" and contain ':' if that is not used in the regexps.

◆ test()

bool test ( const std::string &  key,
bool  defaultResult = true 
) const

Check if key is accepted.

Parameters
key- string to be checked.
defaultResult- if selector (list) is empty, return this value.

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