rad  3.0.0
Event.h
Go to the documentation of this file.
1 /*
2  * scampl4cpp/engine
3  *
4  * Copyright by European Southern Observatory, 2012
5  * All rights reserved
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA.
21  */
22 
23 /*
24  * $Id: Event.h 1139 2016-07-20 14:57:28Z landolfa $
25  */
26 
27 #ifndef SCXML4CPP_EVENT_H
28 #define SCXML4CPP_EVENT_H
29 
30 #ifndef __cplusplus
31 #error This is a C++ include file and cannot be used from plain C
32 #endif
33 
34 #include <string>
35 
36 namespace scxml4cpp {
37 
38 class Event
39 {
40  public:
41  enum EventType{
47  };
48 
54  DEFERRED
55  };
56 
57  Event();
58  Event(const std::string& id, const EventType type);
59  Event(const Event& e);
60  Event& operator=(const Event& e);
61  virtual ~Event();
62 
63  const std::string& getId() const;
64  const EventType getType() const;
65  const EventStatus getStatus() const;
66  void* getPayload() const;
67 
68  void setId(const std::string& id);
69  void setType(const EventType type);
70  void setStatus(const EventStatus status);
71  void setPayload(void* payload);
72 
73  bool isNull() const;
74 
75  private:
76  std::string mId;
77  EventType mType;
78  EventStatus mStatus;
79  void* mPayload;
80 };
81 
82 } // namespace scxml4cpp
83 
84 #endif // SCXML4CPP_EVENT_H
scxml4cpp
Definition: Action.h:36
scxml4cpp::Event::operator=
Event & operator=(const Event &e)
Definition: Event.cpp:65
scxml4cpp::Event::ERROR_EVENT
@ ERROR_EVENT
Definition: Event.h:46
scxml4cpp::Event::SIGNAL_EVENT
@ SIGNAL_EVENT
Definition: Event.h:44
scxml4cpp::Event::DEFERRED
@ DEFERRED
Definition: Event.h:54
scxml4cpp::Event::setStatus
void setStatus(const EventStatus status)
Definition: Event.cpp:119
scxml4cpp::Event::getPayload
void * getPayload() const
Definition: Event.cpp:101
scxml4cpp::Event::setPayload
void setPayload(void *payload)
Definition: Event.cpp:125
scxml4cpp::Event::getType
const EventType getType() const
Definition: Event.cpp:89
scxml4cpp::Event::TOBEPROCESSED
@ TOBEPROCESSED
Definition: Event.h:50
scxml4cpp::Event::~Event
virtual ~Event()
Definition: Event.cpp:78
scxml4cpp::Event::REJECTED
@ REJECTED
Definition: Event.h:53
scxml4cpp::Event::setType
void setType(const EventType type)
Definition: Event.cpp:113
scxml4cpp::Event::CALL_EVENT
@ CALL_EVENT
Definition: Event.h:42
scxml4cpp::Event::Event
Event()
Definition: Event.cpp:32
scxml4cpp::Event::PROCESSED
@ PROCESSED
Definition: Event.h:51
scxml4cpp::Event::EventStatus
EventStatus
Definition: Event.h:49
scxml4cpp::Event::getStatus
const EventStatus getStatus() const
Definition: Event.cpp:95
scxml4cpp::Event::EventType
EventType
Definition: Event.h:41
scxml4cpp::Event::getId
const std::string & getId() const
Definition: Event.cpp:83
scxml4cpp::Event::setId
void setId(const std::string &id)
Definition: Event.cpp:107
scxml4cpp::Event::isNull
bool isNull() const
Definition: Event.cpp:131
scxml4cpp::Event
Definition: Event.h:39
scxml4cpp::Event::CHANGE_EVENT
@ CHANGE_EVENT
Definition: Event.h:43
scxml4cpp::Event::IGNORED
@ IGNORED
Definition: Event.h:52
scxml4cpp::Event::TIME_EVENT
@ TIME_EVENT
Definition: Event.h:45