zuspec-arl-eval 0.0.7.13253972717rc0__cp312-cp312-manylinux_2_34_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.
Files changed (37) hide show
  1. zsp_arl_eval/__build_num__.py +1 -0
  2. zsp_arl_eval/__init__.py +20 -0
  3. zsp_arl_eval/__version__.py +3 -0
  4. zsp_arl_eval/core.cpython-312-x86_64-linux-gnu.so +0 -0
  5. zsp_arl_eval/core.pxd +133 -0
  6. zsp_arl_eval/decl.pxd +140 -0
  7. zsp_arl_eval/libzsp-arl-eval.so +0 -0
  8. zsp_arl_eval/pkginfo.py +24 -0
  9. zsp_arl_eval/share/include/EvalBackendClosure.h +76 -0
  10. zsp_arl_eval/share/include/EvalThreadData.h +48 -0
  11. zsp_arl_eval/share/include/zsp/arl/eval/FactoryExt.h +27 -0
  12. zsp_arl_eval/share/include/zsp/arl/eval/IBuiltinFuncInfo.h +77 -0
  13. zsp_arl_eval/share/include/zsp/arl/eval/IComponentTreeData.h +49 -0
  14. zsp_arl_eval/share/include/zsp/arl/eval/IEval.h +126 -0
  15. zsp_arl_eval/share/include/zsp/arl/eval/IEvalBackend.h +82 -0
  16. zsp_arl_eval/share/include/zsp/arl/eval/IEvalContext.h +162 -0
  17. zsp_arl_eval/share/include/zsp/arl/eval/IEvalContextActivity.h +52 -0
  18. zsp_arl_eval/share/include/zsp/arl/eval/IEvalContextInt.h +65 -0
  19. zsp_arl_eval/share/include/zsp/arl/eval/IEvalFunctionData.h +40 -0
  20. zsp_arl_eval/share/include/zsp/arl/eval/IEvalListener.h +59 -0
  21. zsp_arl_eval/share/include/zsp/arl/eval/IEvalStackFrame.h +50 -0
  22. zsp_arl_eval/share/include/zsp/arl/eval/IEvalThread.h +94 -0
  23. zsp_arl_eval/share/include/zsp/arl/eval/IEvalThreadEventListener.h +42 -0
  24. zsp_arl_eval/share/include/zsp/arl/eval/IEvalThreadId.h +41 -0
  25. zsp_arl_eval/share/include/zsp/arl/eval/IEvalValProvider.h +52 -0
  26. zsp_arl_eval/share/include/zsp/arl/eval/IFactory.h +90 -0
  27. zsp_arl_eval/share/include/zsp/arl/eval/IModelAddressSpace.h +46 -0
  28. zsp_arl_eval/share/include/zsp/arl/eval/IModelEvaluator.h +42 -0
  29. zsp_arl_eval/share/include/zsp/arl/eval/impl/EvalBackendBase.h +76 -0
  30. zsp_arl_eval/share/include/zsp/arl/eval/impl/EvalListenerBase.h +59 -0
  31. zsp_arl_eval/share/include/zsp/arl/eval/impl/TaskEvalGetLval.h +148 -0
  32. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/LICENSE +201 -0
  33. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/METADATA +27 -0
  34. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/RECORD +37 -0
  35. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/WHEEL +5 -0
  36. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/entry_points.txt +2 -0
  37. zuspec_arl_eval-0.0.7.13253972717rc0.dist-info/top_level.txt +1 -0
@@ -0,0 +1 @@
1
+ BUILD_NUM=13253972717
@@ -0,0 +1,20 @@
1
+ import os
2
+
3
+ def get_deps():
4
+ return []
5
+
6
+ def get_libs():
7
+ return ["zsp-arl-eval"]
8
+
9
+ def get_libdirs():
10
+ pkg_dir = os.path.dirname(os.path.abspath(__file__))
11
+ return [pkg_dir]
12
+
13
+ def get_incdirs():
14
+ pkg_dir = os.path.dirname(os.path.abspath(__file__))
15
+ if os.path.isdir(os.path.join(pkg_dir, "include")):
16
+ return [os.path.join(pkg_dir, "include")]
17
+ else:
18
+ root_dir = os.path.abspath(os.path.join(pkg_dir, "../.."))
19
+ return [os.path.join(root_dir, "src", "include")]
20
+
@@ -0,0 +1,3 @@
1
+ BASE="0.0.7"
2
+ SUFFIX=".13253972717rc0"
3
+ VERSION="%s%s" % (BASE, SUFFIX)
zsp_arl_eval/core.pxd ADDED
@@ -0,0 +1,133 @@
1
+ #****************************************************************************
2
+ #* arl_dm_eval core.pxd
3
+ #*
4
+ #****************************************************************************
5
+ import ctypes
6
+ cimport debug_mgr.core as dm_core
7
+ cimport vsc_solvers.core as vsc_solvers
8
+ cimport zsp_arl_dm.core as arl_dm
9
+ from zsp_arl_eval cimport decl
10
+
11
+ from libc.stdint cimport int32_t
12
+ from libcpp cimport bool
13
+ from libcpp.string cimport string as cpp_string
14
+ cimport vsc_dm.core as vsc
15
+ cimport vsc_dm.decl as vsc_decl
16
+ cimport pyapi_compat_if.core as pyapi
17
+ cimport pyapi_compat_if.decl as pyapi_decl
18
+
19
+ cdef class Factory(object):
20
+ cdef decl.IFactory *_hndl
21
+ cdef pyapi.PyEval _pyeval
22
+
23
+ cdef init(self, dm_core.Factory)
24
+
25
+ cpdef EvalContext mkEvalContextFullElab(
26
+ self,
27
+ vsc_solvers.Factory solvers_f,
28
+ arl_dm.Context ctxt,
29
+ vsc_solvers.RandState randstate,
30
+ arl_dm.DataTypeComponent root_comp,
31
+ arl_dm.DataTypeAction root_action,
32
+ EvalBackend backend)
33
+
34
+ cpdef ModelEvaluator mkModelEvaluator(
35
+ self,
36
+ kind,
37
+ vsc_solvers.Factory solvers_f,
38
+ arl_dm.Context ctxt)
39
+
40
+ cdef class EvalBackend(object):
41
+ cdef decl.EvalBackendClosure *_hndl
42
+
43
+ cdef class Eval(object):
44
+ cdef decl.IEval *_hndl
45
+ cdef bool _owned
46
+
47
+ cpdef bool eval(self)
48
+
49
+ cpdef bool hasFlags(self, flags)
50
+
51
+ cpdef vsc.ValRef getResult(self)
52
+
53
+ cpdef void setResult(self, vsc.ValRef r, flags=*)
54
+
55
+ @staticmethod
56
+ cdef Eval mk(decl.IEval *hndl, bool owned=*)
57
+
58
+ cdef class EvalContext(object):
59
+ cdef decl.IEvalContext *_hndl
60
+ cdef bool _owned
61
+
62
+ cpdef bool eval(self)
63
+
64
+ cpdef bool hasFlags(self, flags)
65
+
66
+ cpdef vsc.ValRef getResult(self)
67
+
68
+ cpdef getSolveFunctions(self)
69
+
70
+ cpdef getTargetFunctions(self)
71
+
72
+ cpdef bool addPyModule(self, str name, object mod)
73
+
74
+ cpdef vsc.ValRefInt mkValRefInt(self, int value, bool is_signed, int width)
75
+
76
+ cpdef vsc.ValRefInt getAddrHandleValue(self, vsc.ValRef val)
77
+
78
+ # cpdef EvalResult mkEvalResultVal(self, vsc.ModelVal v)
79
+
80
+ # cpdef EvalResult mkEvalResultValS(self, int val, int bits=*)
81
+
82
+ # cpdef EvalResult mkEvalResultValU(self, int val, int bits=*)
83
+
84
+ # cpdef EvalResult mkEvalResultKind(self, kind)
85
+
86
+ # cpdef EvalResult mkEvalResultRef(self, vsc.ModelField ref)
87
+
88
+ cdef decl.IEvalContext *asContext(self)
89
+
90
+ @staticmethod
91
+ cdef EvalContext mk(decl.IEvalContext *hndl, bool owned=*)
92
+
93
+ cdef class EvalThread(Eval):
94
+
95
+ cpdef void setThreadId(self, obj)
96
+
97
+ cpdef object getThreadId(self)
98
+
99
+ cpdef vsc.ValRefInt mkValRefInt(self, int value, bool is_signed, int width)
100
+
101
+ cpdef vsc.ValRefInt getAddrHandleValue(self, vsc.ValRef val)
102
+
103
+ # cpdef EvalResult mkEvalResultVal(self, vsc.ModelVal v)
104
+
105
+ # cpdef EvalResult mkEvalResultValS(self, int val, int bits=*)
106
+
107
+ # cpdef EvalResult mkEvalResultValU(self, int val, int bits=*)
108
+
109
+ # cpdef EvalResult mkEvalResultKind(self, kind)
110
+
111
+ # cpdef EvalResult mkEvalResultRef(self, vsc.ModelField ref)
112
+
113
+ cdef decl.IEvalThread *asThread(self)
114
+
115
+ @staticmethod
116
+ cdef EvalThread mk(decl.IEvalThread *hndl, bool owned=*)
117
+
118
+ cdef class ModelEvaluator(object):
119
+ cdef decl.IModelEvaluator *_hndl
120
+ cdef bool _owned
121
+
122
+ cpdef arl_dm.ModelEvalIterator eval(
123
+ self,
124
+ vsc_solvers.RandState randstate,
125
+ arl_dm.ModelFieldComponent root_comp,
126
+ arl_dm.DataTypeAction root_action)
127
+
128
+ @staticmethod
129
+ cdef ModelEvaluator mk(decl.IModelEvaluator *hndl, bool owned=*)
130
+
131
+ pass
132
+
133
+
zsp_arl_eval/decl.pxd ADDED
@@ -0,0 +1,140 @@
1
+ #****************************************************************************
2
+ #* arl_dm_eval decl.pxd
3
+ #*
4
+ #****************************************************************************
5
+ cimport vsc_dm.decl as vsc
6
+ cimport vsc_solvers.decl as vsc_solvers
7
+ cimport zsp_arl_dm.decl as arl_dm
8
+ cimport debug_mgr.decl as dm
9
+ cimport pyapi_compat_if.decl as pyapi
10
+
11
+ from libcpp.string cimport string as cpp_string
12
+ from libcpp.vector cimport vector as cpp_vector
13
+ from libcpp.memory cimport unique_ptr
14
+ from libcpp cimport bool
15
+ from libc.stdint cimport int32_t, int64_t, uint64_t
16
+ cimport cpython.ref as cpy_ref
17
+
18
+ ctypedef EvalThreadData *EvalThreadDataP
19
+ ctypedef IFactory *IFactoryP
20
+ ctypedef IEvalContext *IEvalContextP
21
+ ctypedef IEvalThread *IEvalThreadP
22
+ ctypedef IEvalThreadId *IEvalThreadIdP
23
+
24
+ cdef extern from "zsp/arl/eval/IFactory.h" namespace "zsp::arl::eval":
25
+ cdef cppclass IFactory:
26
+ void init(dm.IDebugMgr *)
27
+
28
+ IModelEvaluator *mkModelEvaluator(
29
+ ModelEvaluatorKind kind,
30
+ vsc_solvers.IFactory *solvers_f,
31
+ arl_dm.IContext *ctxt)
32
+
33
+ IEvalContext *mkEvalContextFullElab(
34
+ vsc_solvers.IFactory *solvers_f,
35
+ arl_dm.IContext *ctxt,
36
+ const vsc_solvers.IRandState *randstate,
37
+ pyapi.IPyEval *pyeval,
38
+ arl_dm.IDataTypeComponent *root_comp,
39
+ arl_dm.IDataTypeAction *root_action,
40
+ IEvalBackend *backend)
41
+
42
+ # cdef extern from "zsp/arl/eval/IEvalResult.h" namespace "zsp::arl::eval":
43
+ # cdef enum EvalResultKind:
44
+ # ResultKind_Void "zsp::arl::eval::EvalResultKind::Void"
45
+ # ResultKind_Val "zsp::arl::eval::EvalResultKind::Val"
46
+ # ResultKind_Ref "zsp::arl::eval::EvalResultKind::Ref"
47
+ # ResultKind_Break "zsp::arl::eval::EvalResultKind::Break"
48
+ # ResultKind_Continue "zsp::arl::eval::EvalResultKind::Continue"
49
+
50
+ # cdef cppclass IEvalResult(vsc.IModelVal):
51
+ # pass
52
+
53
+ cdef extern from "zsp/arl/eval/IEval.h" namespace "zsp::arl::eval":
54
+ cdef enum EvalFlags "zsp::arl::eval::EvalFlags":
55
+ EvalFlags_NoFlags "zsp::arl::eval::EvalFlags::NoFlags"
56
+ EvalFlags_Complete "zsp::arl::eval::EvalFlags::Complete"
57
+ EvalFlags_Error "zsp::arl::eval::EvalFlags::Error"
58
+ EvalFlags_Break "zsp::arl::eval::EvalFlags::Break"
59
+ EvalFlags_Continue "zsp::arl::eval::EvalFlags::Continue"
60
+ EvalFlags_Return "zsp::arl::eval::EvalFlags::Return"
61
+
62
+ cdef cppclass IEval:
63
+ bool eval()
64
+ bool hasFlags(EvalFlags flags) const
65
+ vsc.ValRef getResult()
66
+ void setResult(const vsc.ValRef &, EvalFlags flags)
67
+
68
+
69
+ cdef extern from "zsp/arl/eval/IEvalBackend.h" namespace "zsp::arl::eval":
70
+ cdef cppclass IEvalBackend:
71
+ void enterThreads(const cpp_vector[IEvalThreadP] &)
72
+
73
+ void enterThread(IEvalThread *)
74
+
75
+ void leaveThread(IEvalThread *)
76
+
77
+ void leaveThreads(const cpp_vector[IEvalThreadP] &)
78
+
79
+ void callFuncReq(
80
+ IEvalThread *thread,
81
+ arl_dm.IDataTypeFunction *func_t,
82
+ const cpp_vector[vsc.ValRef] &params)
83
+
84
+ void emitMessage(const cpp_string &msg)
85
+
86
+ cdef extern from "zsp/arl/eval/IEvalContext.h" namespace "zsp::arl::eval":
87
+ cdef cppclass IEvalContext(IEval):
88
+ IEvalBackend *getBackend() const
89
+ void setBackend(IEvalBackend *b)
90
+ const cpp_vector[arl_dm.IDataTypeFunctionP] &getSolveFunctions() const
91
+ const cpp_vector[arl_dm.IDataTypeFunctionP] &getTargetFunctions() const
92
+ bool addPyModule(const cpp_string &, pyapi.PyEvalObj *mod)
93
+
94
+ vsc.ValRefInt mkValRefInt(int64_t value, bool is_signed, int32_t width)
95
+ vsc.ValRefInt getAddrHandleValue(const vsc.ValRef &)
96
+ # IEvalResult *mkEvalResultVal(vsc.IModelVal *val)
97
+ # IEvalResult *mkEvalResultValS(int64_t val, int32_t bits)
98
+ # IEvalResult *mkEvalResultValU(uint64_t val, int32_t bits)
99
+ # IEvalResult *mkEvalResultKind(EvalResultKind kind)
100
+ # IEvalResult *mkEvalResultRef(vsc.IModelField *ref)
101
+
102
+ # const cpp_vector[arl_dm.IModelFieldExecutor] &getFunctions() const
103
+
104
+ cdef extern from "EvalBackendClosure.h" namespace "zsp::arl::eval":
105
+ cdef cppclass EvalBackendClosure(IEvalBackend):
106
+ EvalBackendClosure(cpy_ref.PyObject *)
107
+
108
+ cdef extern from "zsp/arl/eval/IEvalThreadId.h" namespace "zsp::arl::eval":
109
+ cdef cppclass IEvalThreadId:
110
+ pass
111
+
112
+ cdef extern from "zsp/arl/eval/IEvalThread.h" namespace "zsp::arl::eval":
113
+ cdef cppclass IEvalThread(IEval):
114
+ void setThreadId(IEvalThreadId *)
115
+ IEvalThreadId *getThreadId()
116
+ vsc.ValRefInt mkValRefInt(int64_t value, bool is_signed, int32_t width)
117
+ vsc.ValRefInt getAddrHandleValue(const vsc.ValRef &)
118
+ # IEvalResult *mkEvalResultVal(vsc.IModelVal *val)
119
+ # IEvalResult *mkEvalResultValS(int64_t val, int32_t bits)
120
+ # IEvalResult *mkEvalResultValU(uint64_t val, int32_t bits)
121
+ # IEvalResult *mkEvalResultKind(EvalResultKind kind)
122
+ # IEvalResult *mkEvalResultRef(vsc.IModelField *ref)
123
+
124
+ cdef extern from "EvalThreadData.h" namespace "zsp::arl::eval":
125
+ cdef cppclass EvalThreadData(IEvalThreadId):
126
+ EvalThreadData(cpy_ref.PyObject *)
127
+ object getData() const
128
+
129
+ cdef extern from "zsp/arl/eval/IModelEvaluator.h" namespace "zsp::arl::eval":
130
+ cdef enum ModelEvaluatorKind "zsp::arl::eval::ModelEvaluatorKind" :
131
+ ModelEvaluatorKind_FullElab "zsp::arl::eval::ModelEvaluatorKind::FullElab"
132
+ ModelEvaluatorKind_IncrElab "zsp::arl::eval::ModelEvaluatorKind::IncrElab"
133
+
134
+ cdef cppclass IModelEvaluator:
135
+ arl_dm.IModelEvalIterator *eval(
136
+ const vsc_solvers.IRandState *randstate,
137
+ arl_dm.IModelFieldComponent *root_comp,
138
+ arl_dm.IDataTypeAction *root_action)
139
+
140
+
Binary file
@@ -0,0 +1,24 @@
1
+ import os
2
+ import ivpm
3
+
4
+ class PkgInfo(ivpm.PkgInfo):
5
+
6
+ def __init__(self):
7
+ pkgdir = os.path.dirname(os.path.abspath(__file__))
8
+ projdir = os.path.dirname(os.path.dirname(pkgdir))
9
+ super().__init__("zuspec-arl-eval", os.path.dirname(pkgdir))
10
+
11
+ if os.path.isdir(os.path.join(projdir, "src")):
12
+ self._incdirs = [
13
+ os.path.join(projdir, "src", "include"),
14
+ os.path.join(projdir, "python")]
15
+ self._libdirs = [
16
+ os.path.join(projdir, "build", "lib"),
17
+ os.path.join(projdir, "build", "lib64")]
18
+ else:
19
+ self._incdirs = [os.path.join(pkgdir, "share", "include")]
20
+ self._libdirs = [os.path.join(pkgdir)]
21
+
22
+ self._deps = ["zuspec-arl-dm", "vsc-solvers"]
23
+
24
+ self._libs = ["zsp-arl-eval"]
@@ -0,0 +1,76 @@
1
+ /**
2
+ * EvalBackendClosure.h
3
+ *
4
+ * Copyright 2023 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 <Python.h>
23
+ #include "zsp/arl/eval/impl/EvalBackendBase.h"
24
+ #include "zsp/arl/eval/IEvalBackend.h"
25
+
26
+ namespace zsp {
27
+ namespace arl {
28
+ namespace eval {
29
+
30
+
31
+
32
+ class EvalBackendClosure : public virtual EvalBackendBase {
33
+ public:
34
+ EvalBackendClosure(PyObject *peer);
35
+
36
+ virtual ~EvalBackendClosure();
37
+
38
+ virtual void enterThreads(
39
+ const std::vector<IEvalThread *> &threads) override;
40
+
41
+ virtual void enterThread(IEvalThread *thread) override;
42
+
43
+ virtual void leaveThread(IEvalThread *thread) override;
44
+
45
+ virtual void leaveThreads(
46
+ const std::vector<IEvalThread *> &threads) override;
47
+
48
+ virtual void enterAction(
49
+ IEvalThread *thread,
50
+ dm::IDataTypeAction *action_t,
51
+ const vsc::dm::ValRef &action_v) override;
52
+
53
+ virtual void leaveAction(
54
+ IEvalThread *thread,
55
+ dm::IDataTypeAction *action_t,
56
+ const vsc::dm::ValRef &action_v) override;
57
+
58
+ virtual void callFuncReq(
59
+ IEvalThread *thread,
60
+ dm::IDataTypeFunction *func_t,
61
+ const std::vector<vsc::dm::ValRef> &params
62
+ ) override;
63
+
64
+ virtual void emitMessage(
65
+ const std::string &msg
66
+ ) override;
67
+
68
+ private:
69
+ PyObject *m_peer;
70
+ };
71
+
72
+ }
73
+ }
74
+ }
75
+
76
+
@@ -0,0 +1,48 @@
1
+ /**
2
+ * EvalThreadData.h
3
+ *
4
+ * Copyright 2023 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 <Python.h>
23
+ #include "zsp/arl/eval/IEvalThreadId.h"
24
+
25
+ namespace zsp {
26
+ namespace arl {
27
+ namespace eval {
28
+
29
+
30
+
31
+ class EvalThreadData : public virtual IEvalThreadId {
32
+ public:
33
+ EvalThreadData(PyObject *obj);
34
+
35
+ virtual ~EvalThreadData();
36
+
37
+ PyObject *getData() const { return m_obj; }
38
+
39
+ private:
40
+ PyObject *m_obj;
41
+
42
+ };
43
+
44
+ }
45
+ }
46
+ }
47
+
48
+
@@ -0,0 +1,27 @@
1
+ /**
2
+ * FactoryExt.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/eval/IFactory.h"
23
+
24
+ extern "C" zsp::arl::eval::IFactory *zsp_arl_eval_getFactory();
25
+
26
+
27
+
@@ -0,0 +1,77 @@
1
+ /**
2
+ * IBuiltinFuncInfo.h
3
+ *
4
+ * Copyright 2023 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 <functional>
23
+ #include <vector>
24
+ #include "vsc/dm/impl/UP.h"
25
+ #include "vsc/dm/impl/ValRef.h"
26
+ #include "zsp/arl/eval/IEvalThread.h"
27
+
28
+ namespace zsp {
29
+ namespace arl {
30
+ namespace eval {
31
+
32
+ enum class BuiltinFuncFlags {
33
+ NoFlags = 0,
34
+ RegFunc = (1 << 0),
35
+ RegFuncStruct = (1 << 1),
36
+ RegFuncWrite = (1 << 2)
37
+ };
38
+
39
+ static inline BuiltinFuncFlags operator | (const BuiltinFuncFlags lhs, const BuiltinFuncFlags rhs) {
40
+ return static_cast<BuiltinFuncFlags>(
41
+ static_cast<uint32_t>(lhs) | static_cast<uint32_t>(rhs));
42
+ }
43
+
44
+ static inline BuiltinFuncFlags operator & (const BuiltinFuncFlags lhs, const BuiltinFuncFlags rhs) {
45
+ return static_cast<BuiltinFuncFlags>(
46
+ static_cast<uint32_t>(lhs) & static_cast<uint32_t>(rhs));
47
+ }
48
+
49
+ static inline BuiltinFuncFlags operator ~ (const BuiltinFuncFlags lhs) {
50
+ return static_cast<BuiltinFuncFlags>(~static_cast<uint32_t>(lhs));
51
+ }
52
+
53
+ class IBuiltinFuncInfo;
54
+ using IBuiltinFuncInfoUP=vsc::dm::UP<IBuiltinFuncInfo>;
55
+ class IBuiltinFuncInfo {
56
+ public:
57
+
58
+ using FuncT=std::function<void(
59
+ IEvalThread *,
60
+ dm::IDataTypeFunction *,
61
+ const std::vector<vsc::dm::ValRef> &)>;
62
+
63
+ virtual ~IBuiltinFuncInfo() { }
64
+
65
+ virtual const FuncT &getImpl() const = 0;
66
+
67
+ virtual BuiltinFuncFlags getFlags() const = 0;
68
+
69
+ virtual bool hasFlags(BuiltinFuncFlags flags) const = 0;
70
+
71
+ };
72
+
73
+ } /* namespace eval */
74
+ } /* namespace arl */
75
+ } /* namespace zsp */
76
+
77
+
@@ -0,0 +1,49 @@
1
+ /**
2
+ * IComponentTreeData.h
3
+ *
4
+ * Copyright 2023 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 "vsc/dm/impl/UP.h"
23
+
24
+ namespace zsp {
25
+ namespace arl {
26
+ namespace eval {
27
+
28
+ class IComponentTreeData;
29
+ using IComponentTreeDataUP=vsc::dm::UP<IComponentTreeData>;
30
+ class IComponentTreeData {
31
+ public:
32
+ struct TypeMapE {
33
+ std::vector<int32_t> parent_id;
34
+ std::vector<int32_t> child_id;
35
+ };
36
+ using TypeM=std::vector<TypeMapE>;
37
+ public:
38
+
39
+ virtual ~IComponentTreeData() { }
40
+
41
+ virtual const TypeM &getTypeMap(arl::dm::IDataTypeComponent *t) = 0;
42
+
43
+ };
44
+
45
+ } /* namespace eval */
46
+ } /* namespace arl */
47
+ } /* namespace zsp */
48
+
49
+