mCRL2
Loading...
Searching...
No Matches
mcrl2::lps::pins_data_type Class Referenceabstract

Models a pins data type. A pins data type maintains a mapping between known values of a data type and integers. More...

#include <ltsmin.h>

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

Classes

class  index_iterator
 Forward iterator used for iterating over indices. More...
 

Public Member Functions

 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

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 a pins data type. A pins data type maintains a mapping between known values of a data type and integers.

Definition at line 70 of file ltsmin.h.

Constructor & Destructor Documentation

◆ pins_data_type()

mcrl2::lps::pins_data_type::pins_data_type ( const data::data_specification &  data,
const process::action_label_list &  action_labels,
bool  is_bounded = false 
)
inline

Constructor.

Definition at line 115 of file ltsmin.h.

◆ ~pins_data_type()

virtual mcrl2::lps::pins_data_type::~pins_data_type ( )
virtualdefault

Destructor.

Member Function Documentation

◆ deserialize()

virtual std::size_t mcrl2::lps::pins_data_type::deserialize ( const std::string &  s)
pure virtual

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 }

Implemented in mcrl2::lps::state_data_type, and mcrl2::lps::action_label_data_type.

◆ generate_values()

virtual std::vector< std::string > mcrl2::lps::pins_data_type::generate_values ( std::size_t  max_size) const
pure virtual

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

Implemented in mcrl2::lps::state_data_type, and mcrl2::lps::action_label_data_type.

◆ get()

atermpp::aterm mcrl2::lps::pins_data_type::get ( std::size_t  i)
inline

Returns the value at index i.

Definition at line 187 of file ltsmin.h.

◆ index_begin()

index_iterator mcrl2::lps::pins_data_type::index_begin ( ) const
inline

Returns an iterator to the beginning of the indices.

Definition at line 169 of file ltsmin.h.

◆ index_end()

index_iterator mcrl2::lps::pins_data_type::index_end ( ) const
inline

Returns an iterator to the end of the indices.

Definition at line 175 of file ltsmin.h.

◆ indexed_set() [1/2]

utilities::indexed_set< atermpp::aterm > & mcrl2::lps::pins_data_type::indexed_set ( )
inline

Returns the indexed_set holding the values.

Definition at line 193 of file ltsmin.h.

◆ indexed_set() [2/2]

const utilities::indexed_set< atermpp::aterm > & mcrl2::lps::pins_data_type::indexed_set ( ) const
inline

Returns the indexed_set holding the values.

Definition at line 199 of file ltsmin.h.

◆ is_bounded()

bool mcrl2::lps::pins_data_type::is_bounded ( ) const
inline

Returns true if the number of elements is bounded. If this property can not be computed for a data type, false is returned.

Definition at line 157 of file ltsmin.h.

◆ name()

virtual const std::string & mcrl2::lps::pins_data_type::name ( ) const
pure virtual

Returns the name of the data type.

Implemented in mcrl2::lps::state_data_type, and mcrl2::lps::action_label_data_type.

◆ operator[]()

std::size_t mcrl2::lps::pins_data_type::operator[] ( const atermpp::aterm &  x)
inline

Returns the index of the value x.

Definition at line 181 of file ltsmin.h.

◆ parse()

virtual std::size_t mcrl2::lps::pins_data_type::parse ( const std::string &  s)
pure virtual

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 }

Implemented in mcrl2::lps::state_data_type, and mcrl2::lps::action_label_data_type.

◆ print()

virtual std::string mcrl2::lps::pins_data_type::print ( int  i) const
pure virtual

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

Implemented in mcrl2::lps::state_data_type, and mcrl2::lps::action_label_data_type.

◆ serialize()

virtual std::string mcrl2::lps::pins_data_type::serialize ( int  i) const
pure virtual

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

Implemented in mcrl2::lps::state_data_type, and mcrl2::lps::action_label_data_type.

◆ size()

std::size_t mcrl2::lps::pins_data_type::size ( ) const
inline

Returns the number of values that are stored in the map.

Definition at line 163 of file ltsmin.h.

Member Data Documentation

◆ m_action_labels

const process::action_label_list& mcrl2::lps::pins_data_type::m_action_labels
protected

Definition at line 75 of file ltsmin.h.

◆ m_data

const data::data_specification& mcrl2::lps::pins_data_type::m_data
protected

Definition at line 74 of file ltsmin.h.

◆ m_indexed_set

utilities::indexed_set<atermpp::aterm> mcrl2::lps::pins_data_type::m_indexed_set
protected

Definition at line 73 of file ltsmin.h.

◆ m_is_bounded

bool mcrl2::lps::pins_data_type::m_is_bounded
protected

Definition at line 76 of file ltsmin.h.


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