ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
Context.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 CONTEXT_H
19#define CONTEXT_H
20
21#include "Composition.h"
22#include "Event.h"
23
24namespace ginga {
25
26class Context : public Composition
27{
28public:
29 explicit Context (const string &);
30 virtual ~Context ();
31
32 // Object:
33 string getObjectTypeAsString () override;
34 string toString () override;
35 string getProperty (const string &) override;
36 void setProperty (const string &, const string &, Time dur = 0) override;
37 void sendKey (const string &, bool) override;
38 void sendTick (Time, Time, Time) override;
39 bool beforeTransition (Event *, Event::Transition) override;
40 bool afterTransition (Event *, Event::Transition) override;
41
42 // Context:
43 const list<Event *> *getPorts ();
44 void addPort (Event *);
45
46 const list<pair<list<Action>, list<Action> > > *getLinks ();
47 void addLink (list<Action>, list<Action>);
48
49 void incAwakeChildren ();
50 void decAwakeChildren ();
51
52 bool getLinksStatus ();
53 void setLinksStatus (bool);
54
55private:
56 list<Event *> _ports;
57 list<pair<list<Action>, list<Action> > > _links;
59 bool _status;
60};
61
62}
63
64#endif // CONTEXT_H
Definition Composition.h:26
Definition Context.h:27
bool afterTransition(Event *, Event::Transition) override
Finishes event transition.
Definition Context.cpp:236
list< pair< list< Action >, list< Action > > > _links
List of links.
Definition Context.h:57
list< Event * > _ports
List of ports.
Definition Context.h:56
bool _status
Whether links are active.
Definition Context.h:59
int _awakeChildren
Counts awake children.
Definition Context.h:58
bool beforeTransition(Event *, Event::Transition) override
Initiates event transition.
Definition Context.cpp:171
Event state machine.
Definition Event.h:32
Transition
Event state transitions.
Definition Event.h:79