Reference documentation for deal.II version 9.2.0
|
#include <deal.II/base/patterns.h>
Public Member Functions | |
Tuple (const std::vector< std::unique_ptr< PatternBase >> &patterns, const std::string &separator=":") | |
Tuple (const std::vector< std::unique_ptr< PatternBase >> &patterns, const char *separator) | |
template<class... PatternTypes> | |
Tuple (const std::string &separator, const PatternTypes &... patterns) | |
template<class... PatternTypes> | |
Tuple (const char *separator, const PatternTypes &... patterns) | |
template<typename... Patterns> | |
Tuple (const Patterns &... patterns) | |
Tuple (const Tuple &other) | |
virtual bool | match (const std::string &test_string) const override |
virtual std::string | description (const OutputStyle style=Machine) const override |
virtual std::unique_ptr< PatternBase > | clone () const override |
std::size_t | memory_consumption () const override |
const PatternBase & | get_pattern (const unsigned int i) const |
const std::string & | get_separator () const |
template<class... PatternTypes> | |
Tuple (const PatternTypes &... ps) | |
Public Member Functions inherited from Patterns::PatternBase | |
virtual | ~PatternBase ()=default |
virtual std::string | description (const OutputStyle style=Machine) const =0 |
Static Public Member Functions | |
static std::unique_ptr< Tuple > | create (const std::string &description) |
Private Attributes | |
std::vector< std::unique_ptr< PatternBase > > | patterns |
const std::string | separator |
Static Private Attributes | |
static const char * | description_init = "[Tuple" |
Additional Inherited Members | |
Public Types inherited from Patterns::PatternBase | |
enum | OutputStyle { Machine, Text, LaTeX } |
This pattern matches colon-separated values of arbitrary types. Each type has to match a pattern given to the constructor.
An example usage is the following:
or, if you want to exploit ParameterHandler::add_parameter():
The constructor expects a vector of Patterns, and optionally a string specifying the separator to use when parsing the Tuple from a string.
The default separator is a colon, owing to the fact that a pair is in fact a tuple with two elements.
Definition at line 774 of file patterns.h.