Reference documentation for deal.II version 9.0.0
|
#include <deal.II/base/patterns.h>
Public Member Functions | |
Map (const PatternBase &key_pattern, const PatternBase &value_pattern, const unsigned int min_elements=0, const unsigned int max_elements=max_int_value, const std::string &separator=",", const std::string &key_value_separator=":") | |
Map (const Map &other) | |
virtual bool | match (const std::string &test_string) const |
virtual std::string | description (const OutputStyle style=Machine) const |
virtual std::unique_ptr< PatternBase > | clone () const |
std::size_t | memory_consumption () const |
const PatternBase & | get_key_pattern () const |
const PatternBase & | get_value_pattern () const |
const std::string & | get_separator () const |
const std::string & | get_key_value_separator () const |
Public Member Functions inherited from Patterns::PatternBase | |
virtual | ~PatternBase ()=default |
Static Public Member Functions | |
static std::unique_ptr< Map > | create (const std::string &description) |
static ::ExceptionBase & | ExcInvalidRange (int arg1, int arg2) |
Static Public Attributes | |
static const unsigned int | max_int_value = std::numeric_limits<unsigned int>::max() |
Private Attributes | |
std::unique_ptr< PatternBase > | key_pattern |
const unsigned int | min_elements |
const unsigned int | max_elements |
const std::string | separator |
const std::string | key_value_separator |
Static Private Attributes | |
static const char * | description_init = "[Map" |
Additional Inherited Members | |
Public Types inherited from Patterns::PatternBase | |
enum | OutputStyle { Machine, Text, LaTeX } |
This pattern matches a list of comma-separated values each of which denotes a pair of key and value. Both key and value have to match a pattern given to the constructor. For each entry of the map, parameters have to be entered in the form key: value
. In other words, a map is described in the form key1: value1, key2: value2, key3: value3, ...
. Two constructor arguments allow to choose a delimiter between pairs other than the comma, and a delimiter between key and value other than colon.
With two additional parameters, the number of elements this list has to have can be specified. If none is specified, the map may have zero or more entries.
Definition at line 547 of file patterns.h.
Patterns::Map::Map | ( | const PatternBase & | key_pattern, |
const PatternBase & | value_pattern, | ||
const unsigned int | min_elements = 0 , |
||
const unsigned int | max_elements = max_int_value , |
||
const std::string & | separator = "," , |
||
const std::string & | key_value_separator = ":" |
||
) |
Constructor. Take the given parameter as the specification of valid elements of the list.
The four other arguments can be used to denote minimal and maximal allowable lengths of the list as well as the separators used to delimit pairs of the map and the symbol used to separate keys and values.
Definition at line 795 of file patterns.cc.
Patterns::Map::Map | ( | const Map & | other | ) |
Copy constructor.
Definition at line 823 of file patterns.cc.
|
virtual |
Return true
if the string is a comma-separated list of strings each of which match the pattern given to the constructor.
Implements Patterns::PatternBase.
Definition at line 835 of file patterns.cc.
|
virtual |
Return a description of the pattern that valid strings are expected to match.
Implements Patterns::PatternBase.
Definition at line 864 of file patterns.cc.
|
virtual |
Return a copy of the present object, which is newly allocated on the heap. Ownership of that object is transferred to the caller of this function.
Implements Patterns::PatternBase.
Definition at line 916 of file patterns.cc.
|
static |
Create a new object if the start of description matches description_init. Ownership of that object is transferred to the caller of this function.
Definition at line 936 of file patterns.cc.
|
virtual |
Determine an estimate for the memory consumption (in bytes) of this object.
Reimplemented from Patterns::PatternBase.
Definition at line 925 of file patterns.cc.
const PatternBase & Patterns::Map::get_key_pattern | ( | ) | const |
Return a reference to the key pattern.
Definition at line 983 of file patterns.cc.
const PatternBase & Patterns::Map::get_value_pattern | ( | ) | const |
Return a reference to the value pattern.
Definition at line 990 of file patterns.cc.
const std::string & Patterns::Map::get_separator | ( | ) | const |
Return the separator of the map entries.
Definition at line 997 of file patterns.cc.
const std::string & Patterns::Map::get_key_value_separator | ( | ) | const |
Return the key-value separator.
Definition at line 1003 of file patterns.cc.
|
static |
Maximal integer value. If the numeric_limits class is available use this information to obtain the extremal values, otherwise set it so that this class understands that all values are allowed.
Definition at line 555 of file patterns.h.
|
private |
Copy of the patterns that each key and each value of the map has to satisfy.
Definition at line 647 of file patterns.h.
|
private |
Minimum number of elements the list must have.
Definition at line 653 of file patterns.h.
|
private |
Maximum number of elements the list must have.
Definition at line 658 of file patterns.h.
|
private |
Separator between elements of the list.
Definition at line 663 of file patterns.h.
|
private |
Separator between keys and values.
Definition at line 669 of file patterns.h.
|
staticprivate |
Initial part of description
Definition at line 674 of file patterns.h.