7 #ifndef __DIADES__AUTOMATA__EXPERIMENTAL__FAULTYEVENTSTATEMACHINE__HH__ 8 #define __DIADES__AUTOMATA__EXPERIMENTAL__FAULTYEVENTSTATEMACHINE__HH__ 16 namespace Experimental {
18 using std::unordered_set;
19 using std::unordered_map;
28 template<
typename _StatePropertyId,
29 typename _EventPropertyId,
30 typename _NullStatePropertyId = NullValue<_StatePropertyId>,
31 typename _NullEventPropertyId = NullValue<_EventPropertyId>
66 _faultyEventPropertyIds(),
67 _normalEventPropertyIds() {
76 _faultyEventPropertyIds(machine._faultyEventPropertyIds),
77 _normalEventPropertyIds(machine._normalEventPropertyIds) {
86 if (
this != &machine) {
109 _faultyEventPropertyIds.clear();
110 _normalEventPropertyIds.clear();
181 _normalEventPropertyIds.insert(event);
193 _normalEventPropertyIds.erase(e);
194 _faultyEventPropertyIds.insert(e);
203 return _faultyEventPropertyIds.find(e) != _faultyEventPropertyIds.end();
213 const std::unordered_set<EventPropertyId> &
222 FaultyEventPropertyIdIterator
224 return _faultyEventPropertyIds.begin();
231 FaultyEventPropertyIdIterator
233 return _faultyEventPropertyIds.end();
244 _normalEventPropertyIds.insert(e);
245 _faultyEventPropertyIds.erase(e);
254 return _normalEventPropertyIds.find(e) != _normalEventPropertyIds.end();
264 const unordered_set<EventPropertyId> &
273 NormalEventPropertyIdIterator
275 return _normalEventPropertyIds.begin();
282 NormalEventPropertyIdIterator
284 return _normalEventPropertyIds.end();
unordered_set< EventPropertyId >::const_iterator FaultyEventPropertyIdIterator
EventPropertyIdIterator eventEnd() const
virtual FaultyEventStateMachine & operator=(const FaultyEventStateMachine &machine)
FaultyEventPropertyIdIterator faultyEventBegin() const
const std::unordered_set< EventPropertyId > & faultyEvents() const
void setNormal(const EventPropertyId &e)
virtual void eraseEventPropertyId(size_t eventIndex)
_NullStatePropertyId NullStatePropertyId
StateMachine & operator=(const StateMachine &machine)
bool isFaulty(const EventPropertyId &e) const
EventPropertyId getEventFromIndex(size_t index) const
virtual void eraseEventPropertyId(size_t eventIndex)
NormalEventPropertyIdIterator normalEventEnd() const
bool containsEvent(const EventPropertyId &e) const
FaultyEventStateMachine()
virtual void insertEventPropertyId(const EventPropertyId &event)
void setFaulty(const EventPropertyId &e)
unordered_set< EventPropertyId > _faultyEventPropertyIds
void copyEventPropertyIds(const FaultyEventStateMachine &m)
unordered_set< EventPropertyId > _normalEventPropertyIds
#define require(Exception, expr, message)
_StatePropertyId StatePropertyId
Namespace of the Diades project.
void copyEventPropertyId(const FaultyEventStateMachine &m, const EventPropertyId &event)
FaultyEventPropertyIdIterator faultyEventEnd() const
virtual void insertEventPropertyId(const EventPropertyId &event)
EventPropertyIdIterator eventBegin() const
unordered_set< EventPropertyId >::const_iterator NormalEventPropertyIdIterator
FaultyEventStateMachine(const FaultyEventStateMachine &machine)
const unordered_set< EventPropertyId > & normalEvents() const
virtual ~FaultyEventStateMachine()
bool isNormal(const EventPropertyId &e) const
NormalEventPropertyIdIterator normalEventBegin() const
_EventPropertyId EventPropertyId