|
35 | 35 | #include "../shell/Shell.h" |
36 | 36 | #include "../shell/Wildcard.h" |
37 | 37 | #include "../shell/Neutral.h" |
| 38 | +#include "../builtins/Variable.h" |
38 | 39 |
|
39 | 40 | #include "helper.h" |
40 | 41 | #include "pymoose.h" |
@@ -78,6 +79,9 @@ py::object getFieldElement(const ObjId& oid, const string& fname) |
78 | 79 | + "'. Available: ", avl); |
79 | 80 | return pybind11::none(); |
80 | 81 | } |
| 82 | + // FIXME: I am here. |
| 83 | + Variable res = LookupField<unsigned int, Variable>::get(oid, fname, 0); |
| 84 | + return py::cast(res); |
81 | 85 | } |
82 | 86 |
|
83 | 87 | py::object getFieldGeneric(const ObjId& oid, const string& fname) |
@@ -112,7 +116,7 @@ py::object getFieldGeneric(const ObjId& oid, const string& fname) |
112 | 116 | return py::cast(getProp<Id>(oid, fname)); |
113 | 117 | else if (ftype == "ObjId") |
114 | 118 | return py::cast(getProp<ObjId>(oid, fname)); |
115 | | - else if (ftype == typeid(Variable).name()) |
| 119 | + else if (ftype == "Variable") |
116 | 120 | return py::cast(getProp<Variable>(oid, fname)); |
117 | 121 | py::print("pymoose::getFieldGeneric::Warning: Unsupported type " + ftype); |
118 | 122 | return pybind11::none(); |
@@ -199,15 +203,9 @@ PYBIND11_MODULE(_cmoose, m) |
199 | 203 | ">"; |
200 | 204 | }); |
201 | 205 |
|
202 | | - py::class_<FinfoWrapper>(m, "_FinfoWrapper") |
203 | | - .def(py::init<const Finfo*>()) |
204 | | - .def_property_readonly("name", &FinfoWrapper::getName) |
205 | | - .def_property_readonly("doc", &FinfoWrapper::docs) |
206 | | - .def_property_readonly("type", &FinfoWrapper::type) |
207 | | - .def_property_readonly("src", &FinfoWrapper::src, |
208 | | - py::return_value_policy::reference) |
209 | | - .def_property_readonly("dest", &FinfoWrapper::dest, |
210 | | - py::return_value_policy::reference); |
| 206 | + py::class_<Variable>(m, "_Variable") |
| 207 | + .def(py::init<>()) |
| 208 | + ; |
211 | 209 |
|
212 | 210 | py::class_<Cinfo>(m, "_Cinfo") |
213 | 211 | .def(py::init<>()) |
|
0 commit comments