Commit ed56ed14 authored by Jason Rhinelander's avatar Jason Rhinelander

Change id and simulation to properties

parent abfb872d
......@@ -10,9 +10,9 @@ void bind_members(py::module &m) {
py::class_<Member, SharedMember<Member>, PyMember<>> member(m, "Member");
member
.def(py::init<>())
.def("id", &Member::id, "Returns the unique (per simulation) id of this member. Returns 0 if the object is not part of a simulation. Note that a Member-derived object can also be implicitly converted to its integer id, and so can often be used directly wherever an id is required.")
.def_property_readonly("id", &Member::id, "Accesses the unique (per simulation) id of this member. Returns 0 if the object is not part of a simulation. Note that a Member-derived object can also be implicitly converted to its integer id, and so can often be used directly wherever an id is required.")
.def("has_simulation", &Member::hasSimulation, "Returns true if this member belongs to a simulation, false otherwise.")
.def("simulation", (std::shared_ptr<Simulation> (Member::*)() const) &Member::simulation, "Returns the simulation this object belongs to.")
.def_property_readonly("simulation", (std::shared_ptr<Simulation> (Member::*)() const) &Member::simulation, "Accesses the simulation this object belongs to.")
// Don't import simAgent/simGood, etc: they are useful shortcuts in C++ because of the
// templated type casting, but really aren't that useful in Python since types are dynamic
.def("depends_on", &Member::dependsOn, "Records a dependency with the member's simulation; typically invoked in the _added() method.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment