mCRL2
Loading...
Searching...
No Matches
transition.h
Go to the documentation of this file.
1// Author(s): Muck van Weerdenburg, Jan Friso Groote
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9
17#ifndef MCRL2_LTS_TRANSITION_H
18#define MCRL2_LTS_TRANSITION_H
19
20#include <functional>
21
22namespace mcrl2
23{
24namespace lts
25{
26
27static const std::size_t const_tau_label_index=0;
28
34{
40 target
41};
42
47{
48 public:
50 typedef std::size_t size_type;
51
52 private:
56
57 public:
58 // There is no default constructor
59 transition() = delete;
60
62 transition(const std::size_t f,
63 const std::size_t l,
64 const std::size_t t):m_from(f),m_label(l),m_to(t)
65 {}
66
68 transition(const transition& t) = default;
69
71 transition(transition&& t) = default;
72
74 transition& operator=(const transition& t) = default;
75
78
81 from() const
82 {
83 return m_from;
84 }
85
88 {
89 return m_label;
90 }
91
94 to() const
95 {
96 return m_to;
97 }
98
100 void
102 {
103 m_from = from;
104 }
105
107 void
109 {
110 m_label = label;
111 }
112
114 void
116 {
117 m_to = to;
118 }
119
121 bool
122 operator ==(const transition& t) const
123 {
124 return m_from == t.m_from && m_label == t.m_label && m_to == t.m_to;
125 }
126
128 bool
129 operator !=(const transition& t) const
130 {
131 return !(*this==t);
132 }
133
138 bool
139 operator <(const transition& t) const
140 {
141 return m_from < t.m_from || (m_from == t.m_from && (m_label
142 < t.m_label || (m_label == t.m_label && m_to < t.m_to)));
143 }
144};
145
146} // namespace lts
147} // namespace mcrl2
148
149namespace std
150{
151
153template<>
154struct hash<mcrl2::lts::transition>
155{
156 std::size_t operator()(const mcrl2::lts::transition& t) const
157 {
158 return t.from() << 2 ^ t.label() << 1 ^ t.to();
159 }
160};
161
162} // namespace std
163
164
166
167#endif // MCRL2_LTS_TRANSITION_H
A class containing triples, source label and target representing transitions.
Definition transition.h:47
void set_label(const size_type label)
Set the label of the transition.
Definition transition.h:108
transition & operator=(const transition &t)=default
Assignment.
void set_to(const size_type to)
Set the target of the transition.
Definition transition.h:115
bool operator<(const transition &t) const
Standard lexicographic ordering on transitions.
Definition transition.h:139
transition(const std::size_t f, const std::size_t l, const std::size_t t)
Constructor (there is no default constructor).
Definition transition.h:62
size_type from() const
The source of the transition.
Definition transition.h:81
transition & operator=(transition &&t)=default
Move assignment.
bool operator!=(const transition &t) const
Standard inequality on transitions.
Definition transition.h:129
size_type label() const
The label of the transition.
Definition transition.h:87
size_type to() const
The target of the transition.
Definition transition.h:94
void set_from(const size_type from)
Set the source of the transition.
Definition transition.h:101
transition(transition &&t)=default
Move constructor.
transition(const transition &t)=default
Copy constructor.
std::size_t size_type
The type of the elements in a transition.
Definition transition.h:50
bool operator==(const transition &t) const
Standard equality on transitions.
Definition transition.h:122
transition_sort_style
Transition sort styles.
Definition transition.h:34
static const std::size_t const_tau_label_index
Definition transition.h:27
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
STL namespace.
std::size_t operator()(const mcrl2::lts::transition &t) const
Definition transition.h:156
#define hash(l, r, m)
Definition tree_set.cpp:23