rad 6.2.0
Loading...
Searching...
No Matches
Transition.h
Go to the documentation of this file.
1
10/*
11 * scampl4cpp/engine
12 *
13 * Copyright by European Southern Observatory, 2012
14 * All rights reserved
15 *
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
29 * 02111-1307 USA.
30 */
31
32#ifndef SCXML4CPP_TRANSITION_H
33#define SCXML4CPP_TRANSITION_H
34
35#ifndef __cplusplus
36#error This is a C++ include file and cannot be used from plain C
37#endif
38
39#ifndef SCXML4CPP_HELPER_H
40#include "scxml4cpp/Helper.h"
41#endif
42
43#ifndef SCXML4CPP_EVENT_H
44#include "scxml4cpp/Event.h"
45#endif
46
47#include <string>
48#include <list>
49
50namespace scxml4cpp
51{
52
53class State;
54class ExecutableContent;
55class Action;
56class Context;
57class Helper;
58
68{
69 public:
77 Transition();
78
86 virtual ~Transition();
87
92
96 const Event& getEvent();
97
101 std::list<State*>& getTargets();
102
108 void addTarget(State* s);
109
116 void addAction(Action* a);
117
124 void addCondition(Action* c);
125
131
137
141 bool isEnabled(Context* c);
142
147 bool isEnabled(const Event& e, Context* c);
148
154 void setSource(State* source);
155
161 void setTargets(std::list<State*>& targets);
162
166 void setEvent(const Event& e);
167
168 private:
169 Event mEvent;
170 ExecutableContent* mConditions;
171 ExecutableContent* mActions;
172 State* mSource;
173 std::list<State*> mTargets;
174 Helper mHelper;
175
176 Transition(const Transition&);
177 Transition& operator= (const Transition&);
178};
179
180} // namespace scxml4cpp
181
182#endif // SCXML4CPP_TRANSITION_H
183
Event header.
Helper header.
Definition Action.h:66
Definition Context.h:58
Definition Event.h:66
Definition ExecutableContent.h:57
Definition Helper.h:57
Definition State.h:60
Definition Transition.h:68
bool isEnabled(Context *c)
Definition Transition.cpp:91
void setSource(State *source)
Definition Transition.cpp:136
State * getSource()
Definition Transition.cpp:105
void addAction(Action *a)
Definition Transition.cpp:73
Transition()
Definition Transition.cpp:42
void setEvent(const Event &e)
Definition Transition.cpp:149
ExecutableContent * getConditions()
Definition Transition.cpp:117
void setTargets(std::list< State * > &targets)
Definition Transition.cpp:143
void addCondition(Action *c)
Definition Transition.cpp:82
virtual ~Transition()
Definition Transition.cpp:56
ExecutableContent * getActions()
Definition Transition.cpp:129
const Event & getEvent()
Definition Transition.cpp:123
void addTarget(State *s)
Definition Transition.cpp:64
std::list< State * > & getTargets()
Definition Transition.cpp:111
Definition Action.cpp:36
Definition testCoroActivity.cpp:16