Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
Patterns::Map Class Reference

#include <deal.II/base/patterns.h>

Inheritance diagram for Patterns::Map:
[legend]

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 override
 
virtual std::string description (const OutputStyle style=Machine) const override
 
virtual std::unique_ptr< PatternBaseclone () const override
 
std::size_t memory_consumption () const override
 
const PatternBaseget_key_pattern () const
 
const PatternBaseget_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< Mapcreate (const std::string &description)
 
static ::ExceptionBaseExcInvalidRange (int arg1, int arg2)
 

Static Public Attributes

static const unsigned int max_int_value
 

Private Attributes

std::unique_ptr< PatternBasekey_pattern
 
std::unique_ptr< PatternBasevalue_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 }
 

Detailed Description

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 585 of file patterns.h.


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