Loading...
Searching...
No Matches
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 > &l)
 Copy constructor. Copies the list of quantities.
 
 StringMatcherList (std::initializer_list< matcher_t > l)
 
virtual ~StringMatcherList ()
 Initialiser constructor.
 
StringMatcherList operator= (const StringMatcherList< matcher_t > &l)
 
StringMatcherList operator= (const std::initializer_list< matcher_t > &l)
 
void setKeys (const StringMatcherList< matcher_t > &l)
 
template<class T2 >
void setKeys (const std::initializer_list< T2 > &l)
 
template<class T2 >
void setKeys (const std::list< T2 > &l)
 
template<typename ... TT>
void setKeys (const std::string &arg, const TT &... args)
 Define the list of accepted quantities.
 
template<typename ... TT>
void addKey (const matcher_t &arg, const TT &... args)
 Append keys to existing list.matcher_t.
 
bool test (const std::string &key, bool defaultResult=true) const
 Check if key is accepted.
 
const matcher_t & retrieve (const std::string &key) const
 
bool isSet () const
 
const list_t & getList () const
 
void toStream (std::ostream &ostr) const
 

Protected Member Functions

void insertKeys (const std::string &args)
 Define the list of accepted quantities as a string.
 
void addKey ()
 
void adaptKey (const matcher_t &s)
 

Detailed Description

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

Utility for selecting a quantity label Applied by DataSelector.

Constructor & Destructor Documentation

◆ ~StringMatcherList()

template<class T = std::string>
virtual ~StringMatcherList ( )
inlinevirtual

Initialiser constructor.

Destructor

Member Function Documentation

◆ adaptKey()

template<class T >
void adaptKey ( const matcher_t &  matcher)
protected

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

◆ insertKeys()

template<class T >
void insertKeys ( const std::string &  args)
protected

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.

◆ setKeys()

template<class T = std::string>
template<typename ... TT>
void setKeys ( 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.

◆ test()

template<class T >
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: