ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
Event.h
1/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia
2
3This file is part of Ginga (Ginga-NCL).
4
5Ginga is free software: you can redistribute it and/or modify it
6under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10Ginga is distributed in the hope that it will be useful, but WITHOUT
11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Ginga. If not, see <https://www.gnu.org/licenses/>. */
17
18#ifndef EVENT_H
19#define EVENT_H
20
21#include "aux-ginga.h"
22#include "Predicate.h"
23
24namespace ginga {
25
26class Object;
27
31class Event
32{
33public:
35 enum Type
36 {
44
52
60
67 };
68
70 enum State
71 {
75 };
76
86
87 Event (Event::Type, Object *, const string &id);
88 ~Event ();
89
90 Event::Type getType ();
91 Object *getObject ();
92 string getId ();
93 string getFullId ();
94 Event::State getState ();
95 string toString ();
96
97 bool isLambda ();
98 void getInterval (Time *, Time *);
99 void setInterval (Time, Time);
100
101 bool hasLabel ();
102 std::string getLabel ();
103 void setLabel (const std::string &);
104
105 bool getParameter (const string &, string *);
106 bool setParameter (const string &, const string &);
107
109 void reset ();
110
111public:
112 static string getEventTypeAsString (Event::Type);
113 static string getEventStateAsString (Event::State);
114 static string getEventTransitionAsString (Event::Transition);
115 static Event::Transition getStringAsTransition (string str);
116
117private:
120 string _id;
122 Time _begin;
123 Time _end;
124 std::string _label;
125 map<string, string> _parameters;
126};
127
140
141}
142
143#endif // EVENT_H
Event state machine.
Definition Event.h:32
Transition
Event state transitions.
Definition Event.h:79
@ RESUME
Resume.
Definition Event.h:82
@ START
Start.
Definition Event.h:83
@ STOP
Stop.
Definition Event.h:84
@ PAUSE
Pause.
Definition Event.h:81
@ ABORT
Abort.
Definition Event.h:80
Event::Type _type
Event type.
Definition Event.h:118
bool transition(Event::Transition)
Transitions event.
Definition Event.cpp:185
Type
Event type.
Definition Event.h:36
@ SELECTION
Selection event.
Definition Event.h:59
@ ATTRIBUTION
Attribution event.
Definition Event.h:43
@ PRESENTATION
Presentation event.
Definition Event.h:51
@ LOOKAT
lookAt event.
Definition Event.h:66
string _id
Event id.
Definition Event.h:120
Time _begin
Begin time.
Definition Event.h:122
map< string, string > _parameters
Parameters.
Definition Event.h:125
std::string _label
Label.
Definition Event.h:124
Object * _object
Target object.
Definition Event.h:119
Event::State _state
Event state.
Definition Event.h:121
State
Event state.
Definition Event.h:71
@ SLEEPING
Sleeping.
Definition Event.h:74
@ OCCURRING
Occurring.
Definition Event.h:72
@ PAUSED
Paused.
Definition Event.h:73
Time _end
End time.
Definition Event.h:123
Definition Object.h:30
Definition Predicate.h:26
Action.
Definition Event.h:132
Event::Transition transition
Desired transition.
Definition Event.h:134
string delay
Delay.
Definition Event.h:138
string value
Value to set (if attribution).
Definition Event.h:136
Event * event
Target event.
Definition Event.h:133
Predicate * predicate
Predicate conditioning the execution.
Definition Event.h:135
string duration
Duration.
Definition Event.h:137