Base class for storing properties of mCRL2 types. Properties are (key, value) pairs stored as strings in KEY = VALUE
format. The data_property_map has some predefined functions for types in the Data Library. The optional type argument is used by derived classes. The type represents the name of a derived class as per CRTP.
More...
#include <data_property_map.h>
|
| data_property_map (const std::string &text) |
| The strings may appear in a random order, and not all of them need to be present.
|
|
std::string | to_string () const |
| Returns a string representation of the properties.
|
|
const std::map< std::string, std::string > & | data () const |
| Returns the stored properties.
|
|
std::string | operator[] (const std::string &key) const |
| Returns the value corresponding to key. Throws an exception if the key is not found.
|
|
std::string | compare (const data_property_map &other) const |
| Compares this property map with another property map. The function compare_property must be defined properly for all available properties.
|
|
|
std::string | print (std::size_t n) const |
|
std::string | print (std::string s) const |
|
std::string | print (const core::identifier_string &s) const |
|
std::string | print (const data::variable &v) const |
|
template<typename Container > |
std::string | print (const Container &v, typename atermpp::enable_if_container< Container >::type *=nullptr) const |
|
template<typename Container > |
std::string | print (const Container &v, bool print_separators, typename atermpp::enable_if_container< Container >::type *=nullptr) const |
|
unsigned int | parse_unsigned_int (std::string const &text) const |
|
std::set< std::string > | parse_set_string (std::string const &text) const |
|
std::set< std::multiset< std::string > > | parse_set_multiset_string (std::string const &text) const |
|
std::string | compare (const std::string &property, unsigned int x, unsigned int y) const |
| Compares two integers, and returns a message if they are different. If if they are equal the empty string is returned.
|
|
template<typename T > |
std::string | compare (const std::string &property, const std::set< T > &x, const std::set< T > &y) const |
| Compares two sets and returns a string with the differences encountered. Elements present in the first one but not in the second are printed with a '+' in front of it, elements present in the seconde but not in the first one with a '-' in front of it. A value x of the type T is printed using print(x), so this operation must be defined. If no differences are found the empty string is returned.
|
|
std::string | compare_property (const std::string &property, const std::string &, const std::string &) const |
| Compares two values x and y of a given property. This function should be redefined in derived classes.
|
|
unsigned int | max_key_length () const |
| Returns the maximum length of the property names.
|
|
std::string | align (const std::string &s, unsigned int n) const |
|
template<typename Container > |
std::set< core::identifier_string > | names (const Container &v) const |
| Collects the names of the elements of the container. The name of element x is retrieved by x.name().
|
|
| data_property_map () |
| Default constructor for derived types.
|
|
void | parse_text (const std::string &text) |
| Initializes the property map with text containing lines in KEY = VALUE format.
|
|
|
template<typename Container > |
static std::string | add_separators (std::string const &c, typename std::enable_if< atermpp::is_set< Container >::value >::type *=nullptr) |
| Add start/end separators for non-set container types.
|
|
template<typename Container > |
static std::string | add_separators (std::string const &c, typename std::enable_if< !atermpp::is_set< Container >::value >::type *=0) |
| Add start/end separators for set container types.
|
|
|
std::map< std::string, std::string > | m_data |
| Contains a normalized string representation of the properties.
|
|
template<typename Derived = void>
class mcrl2::data::detail::data_property_map< Derived >
Base class for storing properties of mCRL2 types. Properties are (key, value) pairs stored as strings in KEY = VALUE
format. The data_property_map has some predefined functions for types in the Data Library. The optional type argument is used by derived classes. The type represents the name of a derived class as per CRTP.
Definition at line 33 of file data_property_map.h.
◆ data_property_map() [1/2]
template<typename Derived = void>
◆ data_property_map() [2/2]
template<typename Derived = void>
The strings may appear in a random order, and not all of them need to be present.
Definition at line 247 of file data_property_map.h.
◆ add_separators() [1/2]
template<typename Derived = void>
template<typename Container >
◆ add_separators() [2/2]
template<typename Derived = void>
template<typename Container >
◆ align()
template<typename Derived = void>
◆ compare() [1/3]
template<typename Derived = void>
Compares this property map with another property map. The function compare_property must be defined properly for all available properties.
- Returns
- A string describing the differences found.
Definition at line 286 of file data_property_map.h.
◆ compare() [2/3]
template<typename Derived = void>
template<typename T >
Compares two sets and returns a string with the differences encountered. Elements present in the first one but not in the second are printed with a '+' in front of it, elements present in the seconde but not in the first one with a '-' in front of it. A value x of the type T is printed using print(x), so this operation must be defined. If no differences are found the empty string is returned.
Definition at line 150 of file data_property_map.h.
◆ compare() [3/3]
template<typename Derived = void>
Compares two integers, and returns a message if they are different. If if they are equal the empty string is returned.
Definition at line 132 of file data_property_map.h.
◆ compare_property()
template<typename Derived = void>
Compares two values x and y of a given property. This function should be redefined in derived classes.
- Returns
- An empty string if the two values are equal, otherwise a string indicating the differences between the two.
Definition at line 183 of file data_property_map.h.
◆ data()
template<typename Derived = void>
◆ max_key_length()
template<typename Derived = void>
◆ names()
template<typename Derived = void>
template<typename Container >
Collects the names of the elements of the container. The name of element x is retrieved by x.name().
Definition at line 214 of file data_property_map.h.
◆ operator[]()
template<typename Derived = void>
Returns the value corresponding to key. Throws an exception if the key is not found.
Definition at line 272 of file data_property_map.h.
◆ parse_set_multiset_string()
template<typename Derived = void>
◆ parse_set_string()
template<typename Derived = void>
◆ parse_text()
template<typename Derived = void>
Initializes the property map with text containing lines in KEY = VALUE
format.
Definition at line 231 of file data_property_map.h.
◆ parse_unsigned_int()
template<typename Derived = void>
◆ print() [1/6]
template<typename Derived = void>
template<typename Container >
◆ print() [2/6]
template<typename Derived = void>
template<typename Container >
◆ print() [3/6]
template<typename Derived = void>
◆ print() [4/6]
template<typename Derived = void>
◆ print() [5/6]
template<typename Derived = void>
◆ print() [6/6]
template<typename Derived = void>
◆ to_string()
template<typename Derived = void>
◆ m_data
template<typename Derived = void>
Contains a normalized string representation of the properties.
Definition at line 52 of file data_property_map.h.
The documentation for this class was generated from the following file: