mCRL2
Loading...
Searching...
No Matches
mcrl2::lps::action_label_data_type Class Reference

Models the mapping of mCRL2 action labels to integers. More...

#include <ltsmin.h>

Inheritance diagram for mcrl2::lps::action_label_data_type:
mcrl2::lps::pins_data_type

Public Member Functions

 action_label_data_type (const data::data_specification &data, const process::action_label_list &action_labels)
 
std::string serialize (int i) const override
 Serializes the i-th value of the data type to a binary string. It is guaranteed that serialize(deserialize(i)) == i.
 
std::size_t deserialize (const std::string &s) override
 Deserializes a string to a data value, and returns the corresponding index. If the value is not in the mapping, it will be added.
 
std::string print (int i) const override
 Returns a human readable representation of the value with index i. N.B. It is not guaranteed that parse(print(i)) == i.
 
std::size_t parse (const std::string &s) override
 Parses a string to a data value, and returns the corresponding index. If the value is not in the mapping, it will be added.
 
const std::string & name () const override
 Returns the name of the data type.
 
std::vector< std::string > generate_values (std::size_t) const override
 Generates possible values of the data type (at most max_size).
 
- Public Member Functions inherited from mcrl2::lps::pins_data_type
 pins_data_type (const data::data_specification &data, const process::action_label_list &action_labels, bool is_bounded=false)
 Constructor.
 
virtual ~pins_data_type ()=default
 Destructor.
 
virtual std::string serialize (int i) const =0
 Serializes the i-th value of the data type to a binary string. It is guaranteed that serialize(deserialize(i)) == i.
 
virtual std::size_t deserialize (const std::string &s)=0
 Deserializes a string to a data value, and returns the corresponding index. If the value is not in the mapping, it will be added.
 
virtual std::string print (int i) const =0
 Returns a human readable representation of the value with index i. N.B. It is not guaranteed that parse(print(i)) == i.
 
virtual std::size_t parse (const std::string &s)=0
 Parses a string to a data value, and returns the corresponding index. If the value is not in the mapping, it will be added.
 
virtual const std::string & name () const =0
 Returns the name of the data type.
 
virtual std::vector< std::string > generate_values (std::size_t max_size) const =0
 Generates possible values of the data type (at most max_size).
 
bool is_bounded () const
 Returns true if the number of elements is bounded. If this property can not be computed for a data type, false is returned.
 
std::size_t size () const
 Returns the number of values that are stored in the map.
 
index_iterator index_begin () const
 Returns an iterator to the beginning of the indices.
 
index_iterator index_end () const
 Returns an iterator to the end of the indices.
 
std::size_t operator[] (const atermpp::aterm &x)
 Returns the index of the value x.
 
atermpp::aterm get (std::size_t i)
 Returns the value at index i.
 
utilities::indexed_set< atermpp::aterm > & indexed_set ()
 Returns the indexed_set holding the values.
 
const utilities::indexed_set< atermpp::aterm > & indexed_set () const
 Returns the indexed_set holding the values.
 

Protected Attributes

std::string m_name
 
- Protected Attributes inherited from mcrl2::lps::pins_data_type
utilities::indexed_set< atermpp::aterm > m_indexed_set
 
const data::data_specification & m_data
 
const process::action_label_list & m_action_labels
 
bool m_is_bounded
 

Detailed Description

Models the mapping of mCRL2 action labels to integers.

Definition at line 270 of file ltsmin.h.

Constructor & Destructor Documentation

◆ action_label_data_type()

mcrl2::lps::action_label_data_type::action_label_data_type ( const data::data_specification &  data,
const process::action_label_list &  action_labels 
)
inline

Definition at line 276 of file ltsmin.h.

Member Function Documentation

◆ deserialize()

std::size_t mcrl2::lps::action_label_data_type::deserialize ( const std::string &  s)
inlineoverridevirtual

Deserializes a string to a data value, and returns the corresponding index. If the value is not in the mapping, it will be added.

Returns
The index of the data value.
Exceptions
<std::runtime_error>{ if deserialization failed }

Implements mcrl2::lps::pins_data_type.

Definition at line 287 of file ltsmin.h.

◆ generate_values()

std::vector< std::string > mcrl2::lps::action_label_data_type::generate_values ( std::size_t  max_size) const
inlineoverridevirtual

Generates possible values of the data type (at most max_size).

Implements mcrl2::lps::pins_data_type.

Definition at line 309 of file ltsmin.h.

◆ name()

const std::string & mcrl2::lps::action_label_data_type::name ( ) const
inlineoverridevirtual

Returns the name of the data type.

Implements mcrl2::lps::pins_data_type.

Definition at line 303 of file ltsmin.h.

◆ parse()

std::size_t mcrl2::lps::action_label_data_type::parse ( const std::string &  s)
inlineoverridevirtual

Parses a string to a data value, and returns the corresponding index. If the value is not in the mapping, it will be added.

Returns
The index of the data value.
Exceptions
<std::runtime_error>{ if parsing failed }

Implements mcrl2::lps::pins_data_type.

Definition at line 297 of file ltsmin.h.

◆ print()

std::string mcrl2::lps::action_label_data_type::print ( int  i) const
inlineoverridevirtual

Returns a human readable representation of the value with index i. N.B. It is not guaranteed that parse(print(i)) == i.

Precondition
i is a valid index

Implements mcrl2::lps::pins_data_type.

Definition at line 292 of file ltsmin.h.

◆ serialize()

std::string mcrl2::lps::action_label_data_type::serialize ( int  i) const
inlineoverridevirtual

Serializes the i-th value of the data type to a binary string. It is guaranteed that serialize(deserialize(i)) == i.

Precondition
i is a valid index

Implements mcrl2::lps::pins_data_type.

Definition at line 282 of file ltsmin.h.

Member Data Documentation

◆ m_name

std::string mcrl2::lps::action_label_data_type::m_name
protected

Definition at line 273 of file ltsmin.h.


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