16 #ifndef dealii_patterns_h 17 #define dealii_patterns_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/base/exceptions.h> 23 #include <deal.II/base/point.h> 24 #include <deal.II/base/std_cxx14/algorithm.h> 25 #include <deal.II/base/std_cxx14/memory.h> 26 #include <deal.II/base/std_cxx14/utility.h> 27 #include <deal.II/base/subscriptor.h> 28 #include <deal.II/base/template_constraints.h> 29 #include <deal.II/base/utilities.h> 31 #include <deal.II/fe/component_mask.h> 33 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
34 #include <boost/archive/basic_archive.hpp> 35 #include <boost/core/demangle.hpp> 36 #include <boost/property_tree/ptree_fwd.hpp> 37 #include <boost/property_tree/ptree_serialization.hpp> 38 #include <boost/serialization/split_member.hpp> 39 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
48 #include <type_traits> 49 #include <unordered_map> 50 #include <unordered_set> 54 DEAL_II_NAMESPACE_OPEN
90 match(
const std::string &test_string)
const = 0;
132 virtual std::unique_ptr<PatternBase>
157 std::unique_ptr<PatternBase>
225 match(
const std::string &test_string)
const override;
240 virtual std::unique_ptr<PatternBase>
241 clone()
const override;
248 static std::unique_ptr<Integer>
321 match(
const std::string &test_string)
const override;
336 virtual std::unique_ptr<PatternBase>
337 clone()
const override;
346 static std::unique_ptr<Double>
395 match(
const std::string &test_string)
const override;
410 virtual std::unique_ptr<PatternBase>
411 clone()
const override;
425 static std::unique_ptr<Selection>
495 match(
const std::string &test_string)
const override;
509 virtual std::unique_ptr<PatternBase>
510 clone()
const override;
517 static std::unique_ptr<List>
538 <<
"The values " << arg1 <<
" and " << arg2
539 <<
" do not form a valid range.");
618 match(
const std::string &test_string)
const override;
632 virtual std::unique_ptr<PatternBase>
633 clone()
const override;
640 static std::unique_ptr<Map>
685 <<
"The values " << arg1 <<
" and " << arg2
686 <<
" do not form a valid range.");
694 std::unique_ptr<PatternBase> value_pattern;
783 Tuple(
const std::vector<std::unique_ptr<PatternBase>> &
patterns,
791 Tuple(
const std::vector<std::unique_ptr<PatternBase>> &
patterns,
802 template <
class... PatternTypes>
812 template <
class... PatternTypes>
833 match(
const std::string &test_string)
const override;
847 virtual std::unique_ptr<PatternBase>
848 clone()
const override;
855 static std::unique_ptr<Tuple>
881 std::vector<std::unique_ptr<PatternBase>>
patterns;
918 match(
const std::string &test_string)
const override;
933 virtual std::unique_ptr<PatternBase>
934 clone()
const override;
941 static std::unique_ptr<MultipleSelection>
962 <<
"A comma was found at position " << arg1
963 <<
" of your input string, but commas are not allowed here.");
1002 virtual std::unique_ptr<PatternBase>
1003 clone()
const override;
1010 static std::unique_ptr<Bool>
1037 match(
const std::string &test_string)
const override;
1051 virtual std::unique_ptr<PatternBase>
1052 clone()
const override;
1059 static std::unique_ptr<Anything>
1114 match(
const std::string &test_string)
const override;
1128 virtual std::unique_ptr<PatternBase>
1129 clone()
const override;
1141 static std::unique_ptr<FileName>
1177 match(
const std::string &test_string)
const override;
1191 virtual std::unique_ptr<PatternBase>
1192 clone()
const override;
1199 static std::unique_ptr<DirectoryName>
1302 template <
class T,
class Enable =
void>
1314 static std::unique_ptr<Patterns::PatternBase>
1329 const std::unique_ptr<Patterns::PatternBase> &p =
1343 const std::unique_ptr<Patterns::PatternBase> &p =
1367 template <
typename T>
1398 template <
typename T>
1400 to_value(
const std::string &s, T &t);
1413 <<
"The string " << arg1 <<
" does not match the pattern \"" 1423 template <
class... PatternTypes>
1426 Tuple(
std::string(separator), ps...)
1431 template <
class... PatternTypes>
1433 : separator(separator)
1436 "Not all of the input arguments of this function " 1437 "are derived from PatternBase");
1438 static_assert(
sizeof...(ps) > 0,
1439 "The number of PatternTypes must be greater than zero!");
1440 auto pattern_pointers = {(
static_cast<const PatternBase *
>(&ps))...};
1441 for (
const auto p : pattern_pointers)
1447 template <
class... PatternTypes>
1485 template <
class T,
class Enable =
void>
1488 static constexpr
int list_rank = 0;
1489 static constexpr
int map_rank = 0;
1496 typename
std::enable_if<std::is_arithmetic<T>::value>::type>
1498 template <
typename Dummy = T>
1500 typename std::enable_if<std::is_same<Dummy, T>::value &&
1501 std::is_same<T, bool>::value,
1502 std::unique_ptr<Patterns::PatternBase>>::type
1505 return std_cxx14::make_unique<Patterns::Bool>();
1508 template <
typename Dummy = T>
1510 typename std::enable_if<std::is_same<Dummy, T>::value &&
1511 !std::is_same<T, bool>::value &&
1512 std::is_integral<T>::value,
1513 std::unique_ptr<Patterns::PatternBase>>::type
1516 return std_cxx14::make_unique<Patterns::Integer>(
1517 std::numeric_limits<T>::lowest(), std::numeric_limits<T>::max());
1520 template <
typename Dummy = T>
1522 typename std::enable_if<std::is_same<Dummy, T>::value &&
1523 !std::is_same<T, bool>::value &&
1524 std::is_floating_point<T>::value,
1525 std::unique_ptr<Patterns::PatternBase>>::type
1528 return std_cxx14::make_unique<Patterns::Double>(
1529 std::numeric_limits<T>::lowest(), std::numeric_limits<T>::max());
1534 const std::unique_ptr<Patterns::PatternBase> &p =
1537 std::stringstream str;
1538 if (std::is_same<T, unsigned char>::value ||
1539 std::is_same<T, signed char>::value || std::is_same<T, char>::value)
1540 str << static_cast<int>(value);
1541 else if (std::is_same<T, bool>::value)
1542 str << (static_cast<bool>(value) ?
"true" :
"false");
1551 const std::unique_ptr<Patterns::PatternBase> &p =
1556 if (std::is_same<T, bool>::value)
1557 value = (s ==
"true");
1560 std::istringstream is(s);
1561 if (std::is_same<T, unsigned char>::value ||
1562 std::is_same<T, signed char>::value ||
1563 std::is_same<T, char>::value)
1581 ExcMessage(
"Failed to convert from \"" + s +
"\" to the type \"" +
1582 boost::core::demangle(
typeid(T).name()) +
"\""));
1590 constexpr std::array<const char *, 4> default_list_separator{
1591 {
",",
";",
"|",
"%"}};
1592 constexpr std::array<const char *, 4> default_map_separator{
1593 {
":",
"=",
"@",
"#"}};
1596 template <
typename T>
1597 struct is_list_compatible : std::false_type
1599 template <
typename T, std::
size_t N>
1600 struct is_list_compatible<
std::array<T, N>> : std::true_type
1602 template <
typename... Args>
1603 struct is_list_compatible<
std::vector<Args...>> : std::true_type
1605 template <
typename... Args>
1606 struct is_list_compatible<
std::deque<Args...>> : std::true_type
1608 template <
typename... Args>
1609 struct is_list_compatible<
std::list<Args...>> : std::true_type
1611 template <
typename... Args>
1612 struct is_list_compatible<
std::
set<Args...>> : std::true_type
1614 template <
typename... Args>
1615 struct is_list_compatible<
std::multiset<Args...>> : std::true_type
1617 template <
typename... Args>
1618 struct is_list_compatible<
std::unordered_set<Args...>> : std::true_type
1620 template <
typename... Args>
1621 struct is_list_compatible<
std::unordered_multiset<Args...>>
1625 template <
typename T>
1626 struct is_map_compatible : std::false_type
1628 template <
class Key,
class T,
class Compare,
class Allocator>
1629 struct is_map_compatible<
std::map<Key, T, Compare, Allocator>>
1632 template <
class Key,
class T,
class Compare,
class Allocator>
1633 struct is_map_compatible<
std::multimap<Key, T, Compare, Allocator>>
1636 template <
class Key,
class T,
class Hash,
class KeyEqual,
class Allocator>
1637 struct is_map_compatible<
1638 std::unordered_map<Key, T, Hash, KeyEqual, Allocator>> : std::true_type
1640 template <
class Key,
class T,
class Hash,
class KeyEqual,
class Allocator>
1641 struct is_map_compatible<
1642 std::unordered_multimap<Key, T, Hash, KeyEqual, Allocator>>
1649 template <
typename T>
1650 struct is_list_compatible
1652 static constexpr
bool const value =
1653 internal::is_list_compatible<typename std::decay<T>::type>::value;
1656 template <
typename T>
1657 struct is_map_compatible
1659 static constexpr
bool const value =
1660 internal::is_map_compatible<typename std::decay<T>::type>::value;
1670 return RankInfo<T>::list_rank;
1673 template <
class T1,
class T2,
class... Types>
1677 return std_cxx14::max(RankInfo<T1>::list_rank,
1678 max_list_rank<T2, Types...>());
1686 return RankInfo<T>::map_rank;
1689 template <
class T1,
class T2,
class... Types>
1693 return std_cxx14::max(RankInfo<T1>::map_rank,
1694 max_map_rank<T2, Types...>());
1701 typename
std::enable_if<is_list_compatible<T>::value>::type>
1703 static constexpr
int list_rank =
1704 RankInfo<typename T::value_type>::list_rank + 1;
1705 static constexpr
int map_rank =
1706 RankInfo<typename T::value_type>::map_rank;
1713 typename
std::enable_if<is_map_compatible<T>::value>::type>
1715 static constexpr
int list_rank =
1716 max_list_rank<typename T::key_type, typename T::mapped_type>() + 1;
1717 static constexpr
int map_rank =
1718 max_map_rank<typename T::key_type, typename T::mapped_type>() + 1;
1722 template <
int rank,
int dim,
class Number>
1723 struct RankInfo<
Tensor<rank, dim, Number>>
1725 static constexpr
int list_rank = rank + RankInfo<Number>::list_rank;
1726 static constexpr
int map_rank = RankInfo<Number>::map_rank;
1729 template <
int dim,
class Number>
1730 struct RankInfo<
Point<dim, Number>> : RankInfo<Tensor<1, dim, Number>>
1734 template <
class Number>
1735 struct RankInfo<
std::complex<Number>>
1737 static constexpr
int list_rank = RankInfo<Number>::list_rank + 1;
1738 static constexpr
int map_rank = RankInfo<Number>::map_rank;
1743 struct RankInfo<
std::unique_ptr<FunctionParser<dim>>>
1745 static constexpr
int list_rank = 1;
1746 static constexpr
int map_rank = 0;
1753 static constexpr
int list_rank = 1;
1754 static constexpr
int map_rank = 0;
1758 template <
class Key,
class Value>
1759 struct RankInfo<
std::pair<Key, Value>>
1761 static constexpr
int list_rank =
1762 std_cxx14::max(RankInfo<Key>::list_rank, RankInfo<Value>::list_rank);
1763 static constexpr
int map_rank =
1764 std_cxx14::max(RankInfo<Key>::map_rank, RankInfo<Value>::map_rank) +
1769 template <
class... Types>
1770 struct RankInfo<
std::tuple<Types...>>
1772 static constexpr
int list_rank = max_list_rank<Types...>();
1773 static constexpr
int map_rank = max_map_rank<Types...>() + 1;
1780 typename
std::enable_if<is_list_compatible<T>::value>::type>
1782 static std::unique_ptr<Patterns::PatternBase>
1785 static_assert(internal::RankInfo<T>::list_rank > 0,
1786 "Cannot use this class for non List-compatible types.");
1787 return std_cxx14::make_unique<Patterns::List>(
1790 std::numeric_limits<unsigned int>::max(),
1791 internal::default_list_separator[internal::RankInfo<T>::list_rank -
1797 const std::unique_ptr<Patterns::PatternBase> &pattern =
1802 ExcMessage(
"I need a List pattern to convert a " 1803 "string to a List type."));
1804 auto base_p = p->get_base_pattern().clone();
1805 std::vector<std::string> vec(t.size());
1808 for (
const auto &entry : t)
1814 for (
unsigned int i = 1; i < vec.size(); ++i)
1815 s += p->get_separator() +
" " + vec[i];
1823 const std::unique_ptr<Patterns::PatternBase> &pattern =
1830 ExcMessage(
"I need a List pattern to convert a string " 1831 "to a List type."));
1833 auto base_p = p->get_base_pattern().clone();
1837 for (
const auto &str : v)
1848 typename
std::enable_if<is_map_compatible<T>::value>::type>
1850 static std::unique_ptr<Patterns::PatternBase>
1853 static_assert(internal::RankInfo<T>::list_rank > 0,
1854 "Cannot use this class for non List-compatible types.");
1855 static_assert(internal::RankInfo<T>::map_rank > 0,
1856 "Cannot use this class for non Map-compatible types.");
1857 return std_cxx14::make_unique<Patterns::Map>(
1861 std::numeric_limits<unsigned int>::max(),
1862 internal::default_list_separator[internal::RankInfo<T>::list_rank -
1864 internal::default_map_separator[internal::RankInfo<T>::map_rank - 1]);
1869 const std::unique_ptr<Patterns::PatternBase> &pattern =
1872 auto p =
dynamic_cast<const Patterns::Map *
>(pattern.get());
1874 ExcMessage(
"I need a Map pattern to convert a string to " 1875 "a Map compatible type."));
1876 auto key_p = p->get_key_pattern().clone();
1877 auto val_p = p->get_value_pattern().clone();
1878 std::vector<std::string> vec(t.size());
1881 for (
const auto &ti : t)
1884 p->get_key_value_separator() +
1890 for (
unsigned int i = 1; i < vec.size(); ++i)
1891 s += p->get_separator() +
" " + vec[i];
1899 const std::unique_ptr<Patterns::PatternBase> &pattern =
1904 auto p =
dynamic_cast<const Patterns::Map *
>(pattern.get());
1906 ExcMessage(
"I need a Map pattern to convert a " 1907 "string to a Map compatible type."));
1909 auto key_p = p->get_key_pattern().clone();
1910 auto val_p = p->get_value_pattern().clone();
1914 for (
const auto &str : v)
1919 t.insert(std::make_pair(
1929 template <
int rank,
int dim,
class Number>
1930 struct Convert<
Tensor<rank, dim, Number>>
1933 static std::unique_ptr<Patterns::PatternBase>
1936 static_assert(internal::RankInfo<T>::list_rank > 0,
1937 "Cannot use this class for non List-compatible types.");
1938 return std_cxx14::make_unique<Patterns::List>(
1942 internal::default_list_separator[internal::RankInfo<T>::list_rank -
1948 const std::unique_ptr<Patterns::PatternBase> &pattern =
1953 ExcMessage(
"I need a List pattern to convert a string " 1954 "to a List compatible type."));
1955 auto base_p = p->get_base_pattern().clone();
1956 std::vector<std::string> vec(dim);
1958 for (
unsigned int i = 0; i < dim; ++i)
1964 for (
unsigned int i = 1; i < vec.size(); ++i)
1965 s += p->get_separator() +
" " + vec[i];
1973 const std::unique_ptr<Patterns::PatternBase> &pattern =
1980 ExcMessage(
"I need a List pattern to convert a string " 1981 "to a List compatible type."));
1983 auto base_p = p->get_base_pattern().clone();
1988 for (
const auto &str : v)
1996 template <
int dim,
class Number>
1997 struct Convert<
Point<dim, Number>>
2001 static std::unique_ptr<Patterns::PatternBase>
2009 const std::unique_ptr<Patterns::PatternBase> &pattern =
2012 return Convert<Tensor<1, dim, Number>>
::to_string(
2018 const std::unique_ptr<Patterns::PatternBase> &pattern =
2027 struct Convert<
std::unique_ptr<FunctionParser<dim>>>
2029 using T = std::unique_ptr<FunctionParser<dim>>;
2031 static std::unique_ptr<Patterns::PatternBase>
2034 static_assert(internal::RankInfo<T>::list_rank > 0,
2035 "Cannot use this class for non List-compatible types.");
2037 return std_cxx14::make_unique<Patterns::List>(
2041 internal::default_list_separator[internal::RankInfo<T>::list_rank -
2047 const std::unique_ptr<Patterns::PatternBase> &pattern =
2052 ExcMessage(
"I need a List pattern to convert a string " 2053 "to a List compatible type."));
2055 const auto &expressions = t->get_expressions();
2056 if (expressions.size() == 0)
2057 return std::string();
2059 std::string s = expressions[0];
2060 for (
unsigned int i = 1; i < expressions.size(); ++i)
2061 s = s + p->get_separator() + expressions[i];
2069 const std::unique_ptr<Patterns::PatternBase> &pattern =
2076 ExcMessage(
"I need a List pattern to convert a string " 2077 "to a List compatible type."));
2079 const auto expressions =
2082 T t = std_cxx14::make_unique<FunctionParser<dim>>(expressions.size());
2083 const std::string var =
2086 t->initialize(var, expressions, constants,
true);
2097 static std::unique_ptr<Patterns::PatternBase>
2105 const std::unique_ptr<Patterns::PatternBase> &pattern =
2108 std::vector<bool> mask(t.size());
2109 for (
unsigned int i = 0; i < t.size(); ++i)
2112 return Convert<std::vector<bool>>
::to_string(mask, pattern);
2117 const std::unique_ptr<Patterns::PatternBase> &pattern =
2120 const auto mask = Convert<std::vector<bool>>
::to_value(s, pattern);
2126 template <
class Number>
2127 struct Convert<
std::complex<Number>>
2129 using T = std::complex<Number>;
2131 static std::unique_ptr<Patterns::PatternBase>
2134 static_assert(internal::RankInfo<T>::list_rank > 0,
2135 "Cannot use this class for non List-compatible types.");
2136 return std_cxx14::make_unique<Patterns::List>(
2140 internal::default_list_separator[internal::RankInfo<T>::list_rank -
2146 const std::unique_ptr<Patterns::PatternBase> &pattern =
2151 ExcMessage(
"I need a List pattern to convert a string " 2152 "to a List compatible type."));
2154 auto base_p = p->get_base_pattern().clone();
2157 p->get_separator() +
" " +
2169 const std::unique_ptr<Patterns::PatternBase> &pattern =
2176 ExcMessage(
"I need a List pattern to convert a string " 2177 "to a List compatible type."));
2179 auto base_p = p->get_base_pattern().clone();
2191 struct Convert<
std::string>
2193 using T = std::string;
2195 static std::unique_ptr<Patterns::PatternBase>
2198 return std_cxx14::make_unique<Patterns::Anything>();
2203 const std::unique_ptr<Patterns::PatternBase> &pattern =
2212 const std::unique_ptr<Patterns::PatternBase> &pattern =
2221 template <
class Key,
class Value>
2222 struct Convert<
std::pair<Key, Value>>
2224 using T = std::pair<Key, Value>;
2226 static std::unique_ptr<Patterns::PatternBase>
2229 static_assert(internal::RankInfo<T>::map_rank > 0,
2230 "Cannot use this class for non Map-compatible types.");
2231 return std_cxx14::make_unique<Patterns::Map>(
2238 internal::default_list_separator[internal::RankInfo<T>::list_rank],
2239 internal::default_map_separator[internal::RankInfo<T>::map_rank - 1]);
2244 const std::unique_ptr<Patterns::PatternBase> &pattern =
2247 std::unordered_map<Key, Value> m;
2256 const std::unique_ptr<Patterns::PatternBase> &pattern =
2259 std::unordered_map<Key, Value> m;
2266 template <
class... Args>
2267 struct Convert<
std::tuple<Args...>>
2269 using T = std::tuple<Args...>;
2271 static std::unique_ptr<Patterns::PatternBase>
2274 static_assert(internal::RankInfo<T>::map_rank > 0,
2275 "Cannot use this class for non tuple-compatible types.");
2276 return std_cxx14::make_unique<Patterns::Tuple>(
2277 internal::default_map_separator[internal::RankInfo<T>::map_rank - 1],
2283 const std::unique_ptr<Patterns::PatternBase> &pattern =
2288 ExcMessage(
"I need a Tuple pattern to convert a tuple " 2291 const auto string_array = Convert<T>::to_string_internal_2(t, *p);
2293 for (
unsigned int i = 0; i < string_array.size(); ++i)
2294 str += (i ?
" " + p->get_separator() +
" " :
"") + string_array[i];
2301 const std::unique_ptr<Patterns::PatternBase> &pattern =
2308 ExcMessage(
"I need a Tuple pattern to convert a string " 2309 "to a tuple type."));
2313 return Convert<T>::to_value_internal_2(v, *p);
2317 template <std::size_t... U>
2318 static std::array<std::string, std::tuple_size<T>::value>
2319 to_string_internal_1(
const T & t,
2321 std_cxx14::index_sequence<U...>)
2323 std::array<std::string, std::tuple_size<T>::value> a = {
2324 {Convert<typename std::tuple_element<U, T>::type>
::to_string(
2329 static std::array<std::string, std::tuple_size<T>::value>
2332 return Convert<T>::to_string_internal_1(
2335 std_cxx14::make_index_sequence<std::tuple_size<T>::value>{});
2338 template <std::size_t... U>
2340 to_value_internal_1(
const std::vector<std::string> &s,
2342 std_cxx14::index_sequence<U...>)
2344 return std::make_tuple(
2345 Convert<
typename std::tuple_element<U, T>::type>::
to_value(
2350 to_value_internal_2(
const std::vector<std::string> &s,
2353 return Convert<T>::to_value_internal_1(
2356 std_cxx14::make_index_sequence<std::tuple_size<T>::value>{});
2361 template <
typename T>
2369 template <
typename T>
2379 DEAL_II_NAMESPACE_CLOSE
const std::string & get_separator() const
std::vector< std::string > split_string_list(const std::string &s, const std::string &delimiter=",")
virtual std::string description(const OutputStyle style=Machine) const override
const std::string & get_separator() const
#define DeclException2(Exception2, type1, type2, outsequence)
#define AssertDimension(dim1, dim2)
static std::unique_ptr< FileName > create(const std::string &description)
static const char * description_init
static const char * description_init
static std::unique_ptr< Tuple > create(const std::string &description)
virtual bool match(const std::string &test_string) const override
const PatternBase & get_pattern(const unsigned int i) const
virtual std::unique_ptr< PatternBase > clone() const override
virtual std::unique_ptr< PatternBase > clone() const override
virtual std::unique_ptr< PatternBase > clone() const override
const PatternBase & get_value_pattern() const
const std::string separator
const std::string separator
static std::unique_ptr< List > create(const std::string &description)
std::unique_ptr< PatternBase > pattern
static const unsigned int max_int_value
virtual std::unique_ptr< PatternBase > clone() const =0
static const char * description_init
std::size_t memory_consumption() const override
virtual std::unique_ptr< PatternBase > clone() const override
virtual bool match(const std::string &test_string) const override
static const int max_int_value
#define AssertThrow(cond, exc)
const std::string & get_separator() const
const unsigned int max_elements
static ::ExceptionBase & ExcCommasNotAllowed(int arg1)
static const char * description_init
virtual std::string description(const OutputStyle style=Machine) const override
static std::unique_ptr< Anything > create(const std::string &description)
virtual std::unique_ptr< PatternBase > clone() const override
virtual bool match(const std::string &test_string) const override
static const int min_int_value
virtual std::unique_ptr< PatternBase > clone() const override
static std::string default_variable_names()
static ::ExceptionBase & ExcInvalidRange(int arg1, int arg2)
FileName(const FileType type=input)
virtual bool match(const std::string &test_string) const override
static const char * description_init
virtual bool match(const std::string &test_string) const override
static ::ExceptionBase & ExcMessage(std::string arg1)
virtual std::unique_ptr< PatternBase > clone() const override
static const char * description_init
static std::unique_ptr< DirectoryName > create(const std::string &description)
std::size_t memory_consumption() const override
static const char * description_init
#define DeclException1(Exception1, type1, outsequence)
std::vector< std::unique_ptr< PatternBase > > patterns
const PatternBase & get_key_pattern() const
Double(const double lower_bound=min_double_value, const double upper_bound=max_double_value)
List(const PatternBase &base_pattern, const unsigned int min_elements=0, const unsigned int max_elements=max_int_value, const std::string &separator=",")
MultipleSelection(const std::string &seq)
virtual std::size_t memory_consumption() const
static const char * description_init
static std::unique_ptr< Map > create(const std::string &description)
virtual bool match(const std::string &test_string) const override
static ::ExceptionBase & ExcInvalidRange(int arg1, int arg2)
static const char * description_init
virtual bool match(const std::string &test_string) const override
std::unique_ptr< PatternBase > key_pattern
virtual std::string description(const OutputStyle style=Machine) const override
const PatternBase & get_base_pattern() const
std::size_t memory_consumption() const override
static std::unique_ptr< Double > create(const std::string &description)
virtual ~PatternBase()=default
virtual std::string description(const OutputStyle style=Machine) const override
static const double min_double_value
virtual bool match(const std::string &test_string) const override
std::unique_ptr< PatternBase > pattern_factory(const std::string &description)
std::size_t memory_consumption() const override
static const char * description_init
const std::string & get_key_value_separator() const
virtual bool match(const std::string &test_string) const override
virtual bool match(const std::string &test_string) const =0
virtual std::unique_ptr< PatternBase > clone() const override
std::size_t memory_consumption() const override
static const char * description_init
__global__ void set(Number *val, const Number s, const size_type N)
static const double max_double_value
static ::ExceptionBase & ExcNoMatch(std::string arg1, const Patterns::PatternBase *arg2)
virtual std::unique_ptr< PatternBase > clone() const override
virtual std::string description(const OutputStyle style=Machine) const override
virtual std::string description(const OutputStyle style=Machine) const =0
static std::unique_ptr< MultipleSelection > create(const std::string &description)
virtual bool match(const std::string &test_string) const override
Integer(const int lower_bound=min_int_value, const int upper_bound=max_int_value)
static std::unique_ptr< Bool > create(const std::string &description)
static std::unique_ptr< Selection > create(const std::string &description)
std::map< std::string, double > ConstMap
Selection(const std::string &seq)
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=":")
Tuple(const std::vector< std::unique_ptr< PatternBase >> &patterns, const std::string &separator=":")
virtual std::string description(const OutputStyle style=Machine) const override
virtual std::string description(const OutputStyle style=Machine) const override
const unsigned int min_elements
static const unsigned int max_int_value
virtual std::string description(const OutputStyle style=Machine) const override
virtual std::string description(const OutputStyle style=Machine) const override
const std::string separator
const std::string key_value_separator
const unsigned int max_elements
virtual std::string description(const OutputStyle style=Machine) const override
virtual std::string description(const OutputStyle style=Machine) const override
const unsigned int min_elements
static std::unique_ptr< Integer > create(const std::string &description)
virtual std::unique_ptr< PatternBase > clone() const override
virtual std::unique_ptr< PatternBase > clone() const override