zuspec-arl-dm 0.1.0.15264414400rc0__cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zsp_arl_dm/__build_num__.py +1 -0
- zsp_arl_dm/__init__.py +22 -0
- zsp_arl_dm/__version__.py +3 -0
- zsp_arl_dm/core.cpython-39-x86_64-linux-gnu.so +0 -0
- zsp_arl_dm/core.pxd +395 -0
- zsp_arl_dm/decl.pxd +317 -0
- zsp_arl_dm/libzsp-arl-dm.so +0 -0
- zsp_arl_dm/pkginfo.py +23 -0
- zsp_arl_dm/py_val_to_val_ref.py +46 -0
- zsp_arl_dm/share/include/TypeFieldAddrClaim.cpp +39 -0
- zsp_arl_dm/share/include/TypeFieldAddrClaim.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/FactoryExt.h +6 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IAccept.h +28 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IArl.h +30 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IComponentMap.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IContext.h +443 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IContextDumper.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IContextLoader.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAction.h +43 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivity.h +37 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityBind.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityParallel.h +17 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityReplicate.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivitySchedule.h +25 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityScope.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivitySequence.h +26 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityTraverse.h +33 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeActivityTraverseType.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrClaim.h +42 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrClaimTransparent.h +42 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrHandle.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrSpaceC.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeAddrSpaceTransparentC.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeArlStruct.h +51 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeComponent.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeCoreLibComponent.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeFlowObj.h +36 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeFunction.h +115 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeFunctionImport.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeFunctionParamDecl.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypePackedStruct.h +48 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypePureComponent.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypePyObj.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeReg.h +55 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeRegGroup.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeResource.h +22 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IDataTypeTransparentAddrSpace.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IFactory.h +64 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IMarker.h +56 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivity.h +39 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityBind.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityParallel.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityReplicate.h +49 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivitySchedule.h +30 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityScope.h +52 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivitySequence.h +28 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelActivityTraverse.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelBuildContext.h +36 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelComponentTreeData.h +92 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelEvalIterator.h +72 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelEvalIteratorListener.h +62 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelEvaluator.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelExec.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldAction.h +34 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldClaim.h +43 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldComponent.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldComponentRoot.h +51 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldExecutor.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldExecutorClaim.h +42 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldExecutorGroup.h +50 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldInOut.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldPool.h +38 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldRegGroup.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldRegGroupRef.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IModelFieldRegRef.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IPoolBindDirective.h +33 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IPyImport.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IRegGroup.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IRewriteContext.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IType.h +30 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeAction.h +25 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExec.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExecGroup.h +50 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExecProc.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExecTargetTmpl.h +59 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprMethodCallContext.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprMethodCallStatic.h +49 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPureCompMethodCall.h +50 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPyImportRef.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPythonFieldRef.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPythonMethodCall.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPythonModuleRef.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeExprPythonSubscript.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldActivity.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldAddrClaim.h +52 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldAddrClaimTransparent.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldClaim.h +27 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldExecutor.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldExecutorClaim.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldInOut.h +27 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldMethod.h +39 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldPool.h +29 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldReg.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldRegGroup.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldRegGroupArr.h +49 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldRegRef.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeFieldRegVec.h +52 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeModelDumper.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmt.h +43 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtAssign.h +61 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtBreak.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtContinue.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtDeclScope.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtExpr.h +44 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtForeach.h +41 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtIfClause.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtIfElse.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtMatch.h +53 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtMatchChoice.h +48 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtRepeat.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtRepeatWhile.h +46 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtReturn.h +45 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtScope.h +62 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtVarDecl.h +50 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtWhile.h +47 -0
- zsp_arl_dm/share/include/zsp/arl/dm/ITypeProcStmtYield.h +42 -0
- zsp_arl_dm/share/include/zsp/arl/dm/IVisitor.h +246 -0
- zsp_arl_dm/share/include/zsp/arl/dm/TypeKindE.h +23 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ContextDelegator.h +549 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/CopyVisitor.h +204 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/IsResourcePool.h +55 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ModelBuildContext.h +52 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ModelEvalIteratorListenerBase.h +60 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/RewriteVisitorBase.h +346 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskActionHasMemClaim.h +76 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskCollectTopLevelActivities.h +63 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskFindExecutor.h +69 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskGetExprDataType.h +84 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskGetSubField.h +98 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskGetTypeBitWidth.h +76 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsDataTypeFlowObj.h +73 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsDataTypePyObj.h +55 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsPackedStruct.h +57 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsRefGroupRef.h +60 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsTypeFieldRegGroup.h +60 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskIsTypeFieldRegGroupArr.h +40 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskPackStruct2Int.h +80 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskUnpackInt2Struct.h +123 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskVisitActionTypeClaimRef.h +70 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskVisitModelFieldClaim.h +64 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/TaskVisitModelFieldInOut.h +64 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefAction.h +43 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefActivity.h +63 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefActivityScope.h +51 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefPyObj.h +75 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/ValRefRegGroup.h +32 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/VisitorBase.h +456 -0
- zsp_arl_dm/share/include/zsp/arl/dm/impl/VisitorDelegator.h +356 -0
- zsp_arl_dm/share/include/zsp/arl/dm/loader.h +39 -0
- zsp_arl_dm/val_ref_to_py_val.py +58 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/METADATA +25 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/RECORD +166 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/WHEEL +6 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/entry_points.txt +2 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/licenses/LICENSE +201 -0
- zuspec_arl_dm-0.1.0.15264414400rc0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,204 @@
|
|
1
|
+
/**
|
2
|
+
* CopyVisitor.h
|
3
|
+
*
|
4
|
+
* Copyright 2022 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include "zsp/arl/dm/IContext.h"
|
23
|
+
#include "zsp/arl/dm/IModelBuildContext.h"
|
24
|
+
#include "zsp/arl/dm/impl/ModelBuildContext.h"
|
25
|
+
#include "zsp/arl/dm/impl/VisitorDelegator.h"
|
26
|
+
#include "vsc/dm/impl/CopyVisitor.h"
|
27
|
+
#include "dmgr/IDebugMgr.h"
|
28
|
+
#include "dmgr/impl/DebugMacros.h"
|
29
|
+
|
30
|
+
namespace zsp {
|
31
|
+
namespace arl {
|
32
|
+
namespace dm {
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
class CopyVisitor : public virtual VisitorDelegator {
|
37
|
+
public:
|
38
|
+
CopyVisitor(
|
39
|
+
IContext *ctxt,
|
40
|
+
IModelBuildContext *build_ctxt=0) : VisitorDelegator(&m_core),
|
41
|
+
m_dbg(0), m_ctxt(ctxt), m_build_ctxt(build_ctxt?build_ctxt:&m_build_ctxt_l),
|
42
|
+
m_build_ctxt_l(ctxt), m_core(ctxt, m_build_ctxt, this) {
|
43
|
+
DEBUG_INIT("CopyVisitor", ctxt->getDebugMgr());
|
44
|
+
}
|
45
|
+
|
46
|
+
virtual ~CopyVisitor() { }
|
47
|
+
|
48
|
+
vsc::dm::IAccept *copy(vsc::dm::IAccept *o) {
|
49
|
+
return m_core.copy(o);
|
50
|
+
}
|
51
|
+
|
52
|
+
template <class T> T *copyT(vsc::dm::IAccept *o) {
|
53
|
+
return dynamic_cast<T *>(copy(o));
|
54
|
+
}
|
55
|
+
|
56
|
+
virtual void visitDataTypeComponent(IDataTypeComponent *t) override {
|
57
|
+
|
58
|
+
}
|
59
|
+
|
60
|
+
virtual void visitDataTypeFlowObj(IDataTypeFlowObj *t) override { }
|
61
|
+
|
62
|
+
virtual void visitDataTypeFunction(IDataTypeFunction *t) override { }
|
63
|
+
|
64
|
+
virtual void visitDataTypeResource(IDataTypeResource *t) override { }
|
65
|
+
|
66
|
+
virtual void visitModelActivityParallel(IModelActivityParallel *a) override { }
|
67
|
+
|
68
|
+
virtual void visitModelActivityReplicate(IModelActivityReplicate *a) override {
|
69
|
+
vsc::dm::IModelExpr *count_e = copyT<vsc::dm::IModelExpr>(a->getCountExpr());
|
70
|
+
IModelActivityReplicate *ac = m_ctxt->mkModelActivityReplicate(count_e);
|
71
|
+
|
72
|
+
for (std::vector<vsc::dm::IModelFieldUP>::const_iterator
|
73
|
+
it=a->getFields().begin();
|
74
|
+
it!=a->getFields().end(); it++) {
|
75
|
+
ac->addField(copyT<vsc::dm::IModelField>(it->get()));
|
76
|
+
}
|
77
|
+
|
78
|
+
for (std::vector<vsc::dm::IModelConstraintUP>::const_iterator
|
79
|
+
it=a->getConstraints().begin();
|
80
|
+
it!=a->getConstraints().end(); it++) {
|
81
|
+
ac->addConstraint(copyT<vsc::dm::IModelConstraint>(it->get()));
|
82
|
+
}
|
83
|
+
|
84
|
+
for (std::vector<IModelActivity *>::const_iterator
|
85
|
+
it=a->activities().begin();
|
86
|
+
it!=a->activities().end(); it++) {
|
87
|
+
IModelActivity *it_c = copyT<IModelActivity>(*it);
|
88
|
+
ac->addActivity(it_c, true);
|
89
|
+
}
|
90
|
+
|
91
|
+
ret(ac);
|
92
|
+
}
|
93
|
+
|
94
|
+
virtual void visitModelActivitySchedule(IModelActivitySchedule *a) override { }
|
95
|
+
|
96
|
+
virtual void visitModelActivityScope(IModelActivityScope *a) override {
|
97
|
+
IModelActivityScope *ac = m_ctxt->mkModelActivityScope(a->getType());
|
98
|
+
|
99
|
+
for (std::vector<IModelActivity *>::const_iterator
|
100
|
+
it=a->activities().begin();
|
101
|
+
it!=a->activities().end(); it++) {
|
102
|
+
IModelActivity *it_c = copyT<IModelActivity>(*it);
|
103
|
+
ac->addActivity(it_c, true);
|
104
|
+
}
|
105
|
+
|
106
|
+
ret(ac);
|
107
|
+
}
|
108
|
+
|
109
|
+
virtual void visitModelActivitySequence(IModelActivitySequence *a) override { }
|
110
|
+
|
111
|
+
virtual void visitModelActivityTraverse(IModelActivityTraverse *a) override {
|
112
|
+
DEBUG_ENTER("visitModelActivityTravserse");
|
113
|
+
vsc::dm::IModelConstraint *with_c = 0;
|
114
|
+
if (a->getWithC()) {
|
115
|
+
with_c = copyT<vsc::dm::IModelConstraint>(a->getWithC());
|
116
|
+
}
|
117
|
+
|
118
|
+
DEBUG("target=%p target_c=%p",
|
119
|
+
a->getTarget(), get_copyT<IModelFieldAction>(a->getTarget()));
|
120
|
+
|
121
|
+
IModelActivity *activity = 0;
|
122
|
+
if (a->getActivity()) {
|
123
|
+
activity = copyT<IModelActivity>(a->getActivity());
|
124
|
+
}
|
125
|
+
|
126
|
+
IModelActivityTraverse *ac = m_ctxt->mkModelActivityTraverse(
|
127
|
+
get_copyT<IModelFieldAction>(a->getTarget()),
|
128
|
+
with_c,
|
129
|
+
true,
|
130
|
+
activity,
|
131
|
+
true
|
132
|
+
);
|
133
|
+
|
134
|
+
ret(ac);
|
135
|
+
DEBUG_LEAVE("visitModelActivityTravserse");
|
136
|
+
}
|
137
|
+
|
138
|
+
virtual void visitModelFieldAction(IModelFieldAction *f) override {
|
139
|
+
DEBUG_ENTER("visitModelFieldAction");
|
140
|
+
IModelFieldAction *fc = m_ctxt->mkModelFieldActionRoot(
|
141
|
+
f->name(),
|
142
|
+
f->getDataTypeT<IDataTypeAction>()
|
143
|
+
);
|
144
|
+
|
145
|
+
DEBUG("src=%p copy=%p", f, fc);
|
146
|
+
add_copy(f, fc);
|
147
|
+
|
148
|
+
for (std::vector<vsc::dm::IModelFieldUP>::const_iterator
|
149
|
+
it=f->getFields().begin();
|
150
|
+
it!=f->getFields().end(); it++) {
|
151
|
+
fc->addField(copyT<vsc::dm::IModelField>(it->get()));
|
152
|
+
}
|
153
|
+
|
154
|
+
for (std::vector<vsc::dm::IModelConstraintUP>::const_iterator
|
155
|
+
it=f->getConstraints().begin();
|
156
|
+
it!=f->getConstraints().end(); it++) {
|
157
|
+
fc->addConstraint(copyT<vsc::dm::IModelConstraint>(it->get()));
|
158
|
+
}
|
159
|
+
|
160
|
+
if (f->getActivity()) {
|
161
|
+
fc->setActivity(copyT<IModelActivityScope>(f->getActivity()));
|
162
|
+
}
|
163
|
+
DEBUG_LEAVE("visitModelFieldAction");
|
164
|
+
}
|
165
|
+
|
166
|
+
virtual void visitModelFieldComponent(IModelFieldComponent *f) override { }
|
167
|
+
|
168
|
+
virtual void visitModelFieldExecutor(IModelFieldExecutor *f) override { }
|
169
|
+
|
170
|
+
virtual void visitModelFieldExecutorClaim(IModelFieldExecutorClaim *f) override { }
|
171
|
+
|
172
|
+
virtual void visitModelFieldPool(IModelFieldPool *f) override { }
|
173
|
+
|
174
|
+
public:
|
175
|
+
|
176
|
+
void ret(vsc::dm::IAccept *ret) { m_core.ret(ret); }
|
177
|
+
|
178
|
+
vsc::dm::IAccept *get_copy(vsc::dm::IAccept *s) {
|
179
|
+
return m_core.get_copy(s);
|
180
|
+
}
|
181
|
+
|
182
|
+
template <class T> T *get_copyT(vsc::dm::IAccept *s) {
|
183
|
+
return dynamic_cast<T *>(get_copy(s));
|
184
|
+
}
|
185
|
+
|
186
|
+
void add_copy(vsc::dm::IAccept *s, vsc::dm::IAccept *c) {
|
187
|
+
m_core.add_copy(s, c);
|
188
|
+
}
|
189
|
+
|
190
|
+
protected:
|
191
|
+
dmgr::IDebug *m_dbg;
|
192
|
+
IContext *m_ctxt;
|
193
|
+
IModelBuildContext *m_build_ctxt;
|
194
|
+
ModelBuildContext m_build_ctxt_l;
|
195
|
+
vsc::dm::CopyVisitor m_core;
|
196
|
+
|
197
|
+
};
|
198
|
+
|
199
|
+
|
200
|
+
}
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/**
|
2
|
+
* IsResourcePool.h
|
3
|
+
*
|
4
|
+
* Copyright 2022 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include "zsp/arl/dm/impl/VisitorBase.h"
|
23
|
+
|
24
|
+
namespace zsp {
|
25
|
+
namespace arl {
|
26
|
+
namespace dm {
|
27
|
+
|
28
|
+
|
29
|
+
class IsResourcePool : public VisitorBase {
|
30
|
+
public:
|
31
|
+
IsResourcePool() : m_ret(false) { }
|
32
|
+
|
33
|
+
virtual ~IsResourcePool() { }
|
34
|
+
|
35
|
+
bool test(IModelFieldPool *pool) {
|
36
|
+
m_ret = false;
|
37
|
+
pool->getDataTypePool()->accept(m_this);
|
38
|
+
return m_ret;
|
39
|
+
}
|
40
|
+
|
41
|
+
virtual void visitDataTypeFlowObj(IDataTypeFlowObj *t) override { }
|
42
|
+
|
43
|
+
virtual void visitDataTypeResource(IDataTypeResource *t) override {
|
44
|
+
m_ret = true;
|
45
|
+
}
|
46
|
+
|
47
|
+
private:
|
48
|
+
bool m_ret;
|
49
|
+
};
|
50
|
+
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/*
|
2
|
+
* ModelBuildContext.h
|
3
|
+
*
|
4
|
+
* Created on: Jun 12, 2022
|
5
|
+
* Author: mballance
|
6
|
+
*/
|
7
|
+
|
8
|
+
#pragma once
|
9
|
+
#include "zsp/arl/dm/IModelBuildContext.h"
|
10
|
+
#include "vsc/dm/impl/ModelBuildContext.h"
|
11
|
+
#include "vsc/dm/IModelField.h"
|
12
|
+
#include <vector>
|
13
|
+
|
14
|
+
namespace zsp {
|
15
|
+
namespace arl {
|
16
|
+
namespace dm {
|
17
|
+
|
18
|
+
|
19
|
+
class ModelBuildContext : public virtual IModelBuildContext, public virtual vsc::dm::ModelBuildContext {
|
20
|
+
public:
|
21
|
+
ModelBuildContext(IContext *ctxt) : vsc::dm::ModelBuildContext(ctxt) { }
|
22
|
+
|
23
|
+
virtual ~ModelBuildContext() { }
|
24
|
+
|
25
|
+
virtual void pushActivityScope(IModelActivityScope *a) override {
|
26
|
+
m_activity_scope_s.push_back(a);
|
27
|
+
}
|
28
|
+
|
29
|
+
virtual IModelActivityScope *getActivityScope() override {
|
30
|
+
return (m_activity_scope_s.size())?m_activity_scope_s.back():0;
|
31
|
+
}
|
32
|
+
|
33
|
+
virtual IModelActivityScope *popActivityScope() override {
|
34
|
+
IModelActivityScope *ret = getActivityScope();
|
35
|
+
if (ret) {
|
36
|
+
m_activity_scope_s.pop_back();
|
37
|
+
}
|
38
|
+
return ret;
|
39
|
+
}
|
40
|
+
|
41
|
+
virtual IContext *ctxt() const override { return dynamic_cast<IContext *>(m_ctxt); }
|
42
|
+
|
43
|
+
protected:
|
44
|
+
|
45
|
+
std::vector<IModelActivityScope *> m_activity_scope_s;
|
46
|
+
|
47
|
+
};
|
48
|
+
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
@@ -0,0 +1,60 @@
|
|
1
|
+
/**
|
2
|
+
* ModelEvalIteratorListenerBase.h
|
3
|
+
*
|
4
|
+
* Copyright 2022 Matthew Ballance and Contributors
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
7
|
+
* not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at:
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*
|
18
|
+
* Created on:
|
19
|
+
* Author:
|
20
|
+
*/
|
21
|
+
#pragma once
|
22
|
+
#include "zsp/arl/dm/IModelEvalIteratorListener.h"
|
23
|
+
|
24
|
+
namespace zsp {
|
25
|
+
namespace arl {
|
26
|
+
namespace dm {
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
class ModelEvalIteratorListenerBase : public virtual IModelEvalIteratorListener {
|
31
|
+
public:
|
32
|
+
ModelEvalIteratorListenerBase() { }
|
33
|
+
|
34
|
+
virtual ~ModelEvalIteratorListenerBase() { }
|
35
|
+
|
36
|
+
virtual void enterCompoundAction(IModelFieldAction *a) override { }
|
37
|
+
|
38
|
+
virtual void leaveCompoundAction(IModelFieldAction *a) override { }
|
39
|
+
|
40
|
+
virtual void atomicAction(IModelFieldAction *a) override { }
|
41
|
+
|
42
|
+
virtual void enterParallel(IModelActivityScope *p) override { }
|
43
|
+
|
44
|
+
virtual void enterParallelBranch(IModelActivity *a) override { }
|
45
|
+
|
46
|
+
virtual void leaveParallelBranch(IModelActivity *a) override { }
|
47
|
+
|
48
|
+
virtual void leaveParallel(IModelActivityScope *p) override { }
|
49
|
+
|
50
|
+
virtual void enterSequence(IModelActivityScope *a) override { }
|
51
|
+
|
52
|
+
virtual void leaveSequence(IModelActivityScope *a) override { }
|
53
|
+
|
54
|
+
};
|
55
|
+
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
|