Reference documentation for deal.II version Git 9908a4c 2017-05-26 11:41:54 +0200
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/parameter_handler.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=",")
 
 Map (const Map &other)
 
virtual bool match (const std::string &test_string) const
 
virtual std::string description (const OutputStyle style=Machine) const
 
virtual PatternBaseclone () const
 
std::size_t memory_consumption () const
 
- Public Member Functions inherited from Patterns::PatternBase
virtual ~PatternBase ()
 

Static Public Member Functions

static Mapcreate (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< PatternBasekey_pattern
 
const unsigned int min_elements
 
const unsigned int max_elements
 
const std::string 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, .... A constructor argument allows to choose a delimiter between pairs other than the comma.

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 508 of file parameter_handler.h.

Constructor & Destructor Documentation

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 = "," 
)

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 as well as the separator used to delimit pairs of the map.

Definition at line 749 of file parameter_handler.cc.

Patterns::Map::Map ( const Map other)

Copy constructor.

Definition at line 772 of file parameter_handler.cc.

Member Function Documentation

bool Patterns::Map::match ( const std::string &  test_string) const
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 783 of file parameter_handler.cc.

std::string Patterns::Map::description ( const OutputStyle  style = Machine) const
virtual

Return a description of the pattern that valid strings are expected to match.

Implements Patterns::PatternBase.

Definition at line 849 of file parameter_handler.cc.

PatternBase * Patterns::Map::clone ( ) const
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 899 of file parameter_handler.cc.

Map * Patterns::Map::create ( const std::string &  description)
static

Creates 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 918 of file parameter_handler.cc.

std::size_t Patterns::Map::memory_consumption ( ) const
virtual

Determine an estimate for the memory consumption (in bytes) of this object.

Reimplemented from Patterns::PatternBase.

Definition at line 908 of file parameter_handler.cc.

Member Data Documentation

const unsigned int Patterns::Map::max_int_value = std::numeric_limits<unsigned int>::max()
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 516 of file parameter_handler.h.

std::unique_ptr<PatternBase> Patterns::Map::key_pattern
private

Copy of the patterns that each key and each value of the map has to satisfy.

Definition at line 587 of file parameter_handler.h.

const unsigned int Patterns::Map::min_elements
private

Minimum number of elements the list must have.

Definition at line 593 of file parameter_handler.h.

const unsigned int Patterns::Map::max_elements
private

Maximum number of elements the list must have.

Definition at line 598 of file parameter_handler.h.

const std::string Patterns::Map::separator
private

Separator between elements of the list.

Definition at line 603 of file parameter_handler.h.

const char * Patterns::Map::description_init = "[Map"
staticprivate

Initial part of description

Definition at line 608 of file parameter_handler.h.


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