deal.II version GIT relicensing-2055-gd703fda1ad 2024-10-30 20:00:00+00:00
|
#include <deal.II/base/patterns.h>
Public Types | |
enum | OutputStyle { Machine , Text , LaTeX } |
Public Member Functions | |
List (const PatternBase &base_pattern, const unsigned int min_elements=0, const unsigned int max_elements=max_int_value, const std::string &separator=",") | |
const std::string & | get_separator () const |
const PatternBase & | get_base_pattern () const |
List (const List &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 |
Static Public Member Functions | |
static std::unique_ptr< List > | create (const std::string &description) |
static ::ExceptionBase & | ExcInvalidRange (int arg1, int arg2) |
Static Public Attributes | |
static const unsigned int | max_int_value |
Private Attributes | |
std::unique_ptr< PatternBase > | pattern |
const unsigned int | min_elements |
const unsigned int | max_elements |
const std::string | separator |
Static Private Attributes | |
static const char * | description_init = "[List" |
This pattern matches a list of values separated by commas (or another string), each of which have to match a pattern given to the constructor. With two additional parameters, the number of elements this list has to have can be specified. If none is specified, the list may have zero or more entries.
Definition at line 452 of file patterns.h.
|
inherited |
List of possible description output formats.
Capitalization chosen for similarity to ParameterHandler::OutputStyle.
Definition at line 100 of file patterns.h.
Patterns::List::List | ( | const PatternBase & | base_pattern, |
const unsigned int | min_elements = 0 , |
||
const unsigned int | max_elements = max_int_value , |
||
const std::string & | separator = "," |
||
) |
Constructor. Take the given parameter as the specification of valid elements of the list.
The three other arguments can be used to denote minimal and maximal allowable lengths of the list, and the string that is used as a separator between elements of the list.
Definition at line 651 of file patterns.cc.
Patterns::List::List | ( | const List & | other | ) |
Copy constructor.
Definition at line 668 of file patterns.cc.
const std::string & Patterns::List::get_separator | ( | ) | const |
Return the internally stored separator.
Definition at line 677 of file patterns.cc.
const PatternBase & Patterns::List::get_base_pattern | ( | ) | const |
Return the internally stored base pattern.
Definition at line 685 of file patterns.cc.
|
overridevirtual |
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 693 of file patterns.cc.
|
overridevirtual |
Return a description of the pattern that valid strings are expected to match.
Implements Patterns::PatternBase.
Definition at line 713 of file patterns.cc.
|
overridevirtual |
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 757 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 774 of file patterns.cc.
|
overridevirtual |
Determine an estimate for the memory consumption (in bytes) of this object.
Reimplemented from Patterns::PatternBase.
Definition at line 765 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 460 of file patterns.h.
|
private |
Copy of the pattern that each element of the list has to satisfy.
Definition at line 548 of file patterns.h.
|
private |
Minimum number of elements the list must have.
Definition at line 553 of file patterns.h.
|
private |
Maximum number of elements the list must have.
Definition at line 558 of file patterns.h.
|
private |
Separator between elements of the list.
Definition at line 563 of file patterns.h.
|
staticprivate |
Initial part of description
Definition at line 568 of file patterns.h.