Reference documentation for deal.II version Git 53084d8c6a 2020-10-21 00:34:33 -0400
\(\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 Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
Patterns::List Class Reference

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

Inheritance diagram for Patterns::List:
[legend]

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 PatternBaseget_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< PatternBaseclone () const override
 
std::size_t memory_consumption () const override
 

Static Public Member Functions

static std::unique_ptr< Listcreate (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< PatternBasepattern
 
const unsigned int min_elements
 
const unsigned int max_elements
 
const std::string separator
 

Static Private Attributes

static const char * description_init = "[List"
 

Detailed Description

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

Member Enumeration Documentation

◆ OutputStyle

List of possible description output formats.

Capitalization chosen for similarity to ParameterHandler::OutputStyle.

Enumerator
Machine 

Simple text suitable for machine parsing in the static public member functions for all of the built in inheriting classes.

Preferably human readable, but machine parsing is more critical.

Text 

Easily human readable plain text format suitable for plain text documentation.

LaTeX 

Easily human readable LaTeX format suitable for printing in manuals.

Definition at line 98 of file patterns.h.

Constructor & Destructor Documentation

◆ List() [1/2]

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 654 of file patterns.cc.

◆ List() [2/2]

Patterns::List::List ( const List other)

Copy constructor.

Definition at line 671 of file patterns.cc.

Member Function Documentation

◆ get_separator()

const std::string & Patterns::List::get_separator ( ) const

Return the internally stored separator.

Definition at line 680 of file patterns.cc.

◆ get_base_pattern()

const PatternBase & Patterns::List::get_base_pattern ( ) const

Return the internally stored base pattern.

Definition at line 688 of file patterns.cc.

◆ match()

bool Patterns::List::match ( const std::string &  test_string) const
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 696 of file patterns.cc.

◆ description()

std::string Patterns::List::description ( const OutputStyle  style = Machine) const
overridevirtual

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

Implements Patterns::PatternBase.

Definition at line 716 of file patterns.cc.

◆ clone()

std::unique_ptr< PatternBase > Patterns::List::clone ( ) const
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 760 of file patterns.cc.

◆ create()

std::unique_ptr< List > Patterns::List::create ( const std::string &  description)
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 777 of file patterns.cc.

◆ memory_consumption()

std::size_t Patterns::List::memory_consumption ( ) const
overridevirtual

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

Reimplemented from Patterns::PatternBase.

Definition at line 768 of file patterns.cc.

Member Data Documentation

◆ max_int_value

const unsigned int Patterns::List::max_int_value
static
Initial value:

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

◆ pattern

std::unique_ptr<PatternBase> Patterns::List::pattern
private

Copy of the pattern that each element of the list has to satisfy.

Definition at line 546 of file patterns.h.

◆ min_elements

const unsigned int Patterns::List::min_elements
private

Minimum number of elements the list must have.

Definition at line 551 of file patterns.h.

◆ max_elements

const unsigned int Patterns::List::max_elements
private

Maximum number of elements the list must have.

Definition at line 556 of file patterns.h.

◆ separator

const std::string Patterns::List::separator
private

Separator between elements of the list.

Definition at line 561 of file patterns.h.

◆ description_init

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

Initial part of description

Definition at line 566 of file patterns.h.


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