1 #ifndef __DIADES__PETRI__EVENT__HH__
2 #define __DIADES__PETRI__EVENT__HH__
5 #include<unordered_map>
28 EventInvalid(
const string& whatArg) : runtime_error(whatArg), domain_error(whatArg){
29 ::std::cerr <<
"EXCEPTION Event -> " << whatArg << ::std::endl;
68 size_t id()
const {
return _id; }
122 bool isNull()
const {
return _data == 0; }
156 size_t id()
const {
if(_data == 0) {
return 0; }
return _data->
id(); }
227 unordered_map<string,Event>::const_iterator it =
_mapping.find(type);
const Event & getEvent(size_t id) const
bool operator>(const Event &e) const
friend std::ostream & operator<<(std::ostream &os, const Event &e)
static EventFactory * _instance
const Event & getEvent(const string &type)
const string & type() const
unordered_map< string, Event > _mapping
EventInvalid(const string &whatArg)
static EventFactory * Instance()
bool operator<(const Event &e) const
#define require(Exception, expr, message)
Namespace of the Diades project.
Event(const string &type, size_t id)
Event(const Event &event)
EventData(const string &type, size_t id)
size_t operator()(const Diades::Petri::Event &e) const
bool operator==(const Event &e) const
size_t numberOfCurrentEvents() const