Ginga  0.13.6
 All Classes Namespaces Functions Variables
FormatterLinkConverter.h
1 /******************************************************************************
2 Este arquivo eh parte da implementacao do ambiente declarativo do middleware
3 Ginga (Ginga-NCL).
4 
5 Direitos Autorais Reservados (c) 1989-2007 PUC-Rio/Laboratorio TeleMidia
6 
7 Este programa eh software livre; voce pode redistribui-lo e/ou modificah-lo sob
8 os termos da Licenca Publica Geral GNU versao 2 conforme publicada pela Free
9 Software Foundation.
10 
11 Este programa eh distribuido na expectativa de que seja util, porem, SEM
12 NENHUMA GARANTIA; nem mesmo a garantia implicita de COMERCIABILIDADE OU
13 ADEQUACAO A UMA FINALIDADE ESPECIFICA. Consulte a Licenca Publica Geral do
14 GNU versao 2 para mais detalhes.
15 
16 Voce deve ter recebido uma copia da Licenca Publica Geral do GNU versao 2 junto
17 com este programa; se nao, escreva para a Free Software Foundation, Inc., no
18 endereco 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
19 
20 Para maiores informacoes:
21 ncl @ telemidia.puc-rio.br
22 http://www.ncl.org.br
23 http://www.ginga.org.br
24 http://www.telemidia.puc-rio.br
25 ******************************************************************************
26 This file is part of the declarative environment of middleware Ginga (Ginga-NCL)
27 
28 Copyright: 1989-2007 PUC-RIO/LABORATORIO TELEMIDIA, All Rights Reserved.
29 
30 This program is free software; you can redistribute it and/or modify it under
31 the terms of the GNU General Public License version 2 as published by
32 the Free Software Foundation.
33 
34 This program is distributed in the hope that it will be useful, but WITHOUT ANY
35 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
36 PARTICULAR PURPOSE. See the GNU General Public License version 2 for more
37 details.
38 
39 You should have received a copy of the GNU General Public License version 2
40 along with this program; if not, write to the Free Software
41 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
42 
43 For further information contact:
44 ncl @ telemidia.puc-rio.br
45 http://www.ncl.org.br
46 http://www.ginga.org.br
47 http://www.telemidia.puc-rio.br
48 *******************************************************************************/
49 
50 #ifndef FORMATTERLINKCONVERTER_H_
51 #define FORMATTERLINKCONVERTER_H_
52 
53 #include "ncl/connectors/Action.h"
54 #include "ncl/connectors/AssessmentStatement.h"
55 #include "ncl/connectors/CausalConnector.h"
56 #include "ncl/connectors/ValueAssessment.h"
57 #include "ncl/connectors/CompoundAction.h"
58 #include "ncl/connectors/CompoundStatement.h"
59 #include "ncl/connectors/CompoundCondition.h"
60 #include "ncl/connectors/ConditionExpression.h"
61 #include "ncl/connectors/AttributeAssessment.h"
62 #include "ncl/connectors/Role.h"
63 #include "ncl/connectors/SimpleAction.h"
64 #include "ncl/connectors/SimpleCondition.h"
65 #include "ncl/connectors/Statement.h"
66 #include "ncl/connectors/TriggerExpression.h"
67 #include "ncl/connectors/EventUtil.h"
68 using namespace ::br::pucrio::telemidia::ncl::connectors;
69 
70 #include "ncl/link/Bind.h"
71 #include "ncl/link/CausalLink.h"
72 #include "ncl/link/Link.h"
73 using namespace ::br::pucrio::telemidia::ncl::link;
74 
75 #include "ncl/components/Node.h"
76 using namespace ::br::pucrio::telemidia::ncl::components;
77 
78 #include "ncl/interfaces/InterfacePoint.h"
79 using namespace ::br::pucrio::telemidia::ncl::interfaces;
80 
81 #include "ncl/Parameter.h"
82 using namespace ::br::pucrio::telemidia::ncl;
83 
84 #include "../model/FormatterCausalLink.h"
85 #include "../model/LinkAction.h"
86 #include "../model/LinkAssessment.h"
87 #include "../model/LinkAndCompoundTriggerCondition.h"
88 #include "../model/LinkAssessmentStatement.h"
89 #include "../model/LinkValueAssessment.h"
90 #include "../model/LinkAssignmentAction.h"
91 #include "../model/LinkCompoundAction.h"
92 #include "../model/LinkAttributeAssessment.h"
93 #include "../model/LinkCompoundStatement.h"
94 #include "../model/LinkCompoundTriggerCondition.h"
95 #include "../model/LinkRepeatAction.h"
96 #include "../model/LinkSimpleAction.h"
97 #include "../model/LinkCondition.h"
98 #include "../model/LinkStatement.h"
99 #include "../model/LinkTriggerCondition.h"
100 #include "../model/LinkTransitionTriggerCondition.h"
101 using namespace ::br::pucrio::telemidia::ginga::ncl::model::link;
102 
103 #include "../model/FormatterEvent.h"
104 using namespace ::br::pucrio::telemidia::ginga::ncl::model::event;
105 
106 #include "../model/CompositeExecutionObject.h"
107 #include "../model/ExecutionObject.h"
108 #include "../model/NodeNesting.h"
109 using namespace ::br::pucrio::telemidia::ginga::ncl::model::components;
110 
111 #include "FormatterConverter.h"
112 #include "ObjectCreationForbiddenException.h"
113 
114 #include <string>
115 #include <vector>
116 using namespace std;
117 
118 namespace br {
119 namespace pucrio {
120 namespace telemidia {
121 namespace ginga {
122 namespace ncl {
123 namespace emconverter {
125  private:
126  FormatterConverter* compiler;
127 
128  public:
131 
132  FormatterCausalLink* createCausalLink(
133  CausalLink* ncmLink,
134  CompositeExecutionObject* parentObject,
135  int depthLevel);
136 
137  private:
138  void setImplicitRefAssessment(
139  string roleId, CausalLink* ncmLink, FormatterEvent* event);
140 
141  LinkAction* createAction(
142  Action* actionExpression,
143  CausalLink* ncmLink,
144  CompositeExecutionObject* parentObject,
145  int depthLevel);
146 
147  LinkCondition* createCondition(
148  ConditionExpression* ncmExpression,
149  CausalLink* ncmLink,
150  CompositeExecutionObject* parentObject,
151  int depthLevel);
152 
153  LinkCompoundTriggerCondition* createCompoundTriggerCondition(
154  short op,
155  double delay,
156  vector<ConditionExpression*>* ncmChildConditions,
157  CausalLink* ncmLink,
158  CompositeExecutionObject* parentObject,
159  int depthLevel);
160 
161  LinkCondition* createCondition(
162  TriggerExpression* triggerExpression,
163  CausalLink* ncmLink,
164  CompositeExecutionObject* parentObject,
165  int depthLevel);
166 
167  LinkAssessmentStatement* createAssessmentStatement(
168  AssessmentStatement* assessmentStatement,
169  Bind* bind,
170  Link* ncmLink,
171  CompositeExecutionObject* parentObject,
172  int depthLevel);
173 
174  LinkStatement* createStatement(
175  Statement* statementExpression,
176  Link* ncmLink,
177  CompositeExecutionObject* parentObject,
178  int depthLevel);
179 
180  LinkAttributeAssessment* createAttributeAssessment(
181  AttributeAssessment* attributeAssessment,
182  Bind* bind,
183  Link* ncmLink,
184  CompositeExecutionObject* parentObject,
185  int depthLevel);
186 
187  LinkSimpleAction* createSimpleAction(
188  SimpleAction* sae,
189  Bind* bind,
190  Link* ncmLink,
191  CompositeExecutionObject* parentObject,
192  int depthLevel);
193 
194  LinkCompoundAction* createCompoundAction(
195  short op,
196  double delay,
197  vector<Action*>* ncmChildActions,
198  CausalLink* ncmLink,
199  CompositeExecutionObject* parentObject,
200  int depthLevel);
201 
202  LinkTriggerCondition* createSimpleCondition(
203  SimpleCondition* condition,
204  Bind* bind,
205  Link* ncmLink,
206  CompositeExecutionObject* parentObject,
207  int depthLevel);
208 
209  FormatterEvent* createEvent(
210  Bind* bind,
211  Link* ncmLink,
212  CompositeExecutionObject* parentObject,
213  int depthLevel);
214 
215  double getDelayParameter(
216  Link* ncmLink, Parameter* connParam, Bind* ncmBind);
217 
218  string getBindKey(Link* ncmLink, Bind* ncmBind);
219  double compileDelay(Link* ncmLink, string delayObject, Bind* bind);
220  };
221 }
222 }
223 }
224 }
225 }
226 }
227 
228 #endif /*FORMATTERLINKCONVERTER_H_*/