| 25 | } |
| 26 | |
| 27 | PyComponent::PyComponent(py::object pythonComponent) : |
| 28 | mPythonComponent(std::move(pythonComponent)) |
| 29 | { |
| 30 | EngineRoot* engine = getGlobalEngineRoot(); |
| 31 | if (!engine) |
| 32 | { |
| 33 | throw std::runtime_error("Global EngineRoot not instantiated"); |
| 34 | } |
| 35 | |
| 36 | refl::TypeRegistry* typeRegistry = engine->typeRegistry.get(); |
| 37 | |
| 38 | auto properties = getRequiredAttr(mPythonComponent, "properties"); |
| 39 | mPropertiesDict = properties.attr("__dict__"); |
| 40 | for (const auto& [name, property] : mPropertiesDict) |
| 41 | { |
| 42 | addProperty(*typeRegistry, py::cast<std::string>(name), property); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | PyComponent::~PyComponent() = default; |
| 47 |
nothing calls this directly
no test coverage detected