26 #include "EntityWithOwner.h" 35 typedef std::map<std::string, boost::python::object> PythonDict;
39 static inline const std::string py_prop_prefix=
"py_prop";
41 PythonDict python_dict;
47 boost::python::object
getPyProp(
const std::string &str);
48 void setPyProp(std::string str, boost::python::object val);
53 boost::python::dict
getPyDict(
void)
const;
54 void setPyDict(
const boost::python::dict &);
void setPyProp(std::string str, boost::python::object val)
Sets/appends a value tho the Python object's dictionary.
Definition: EntityWithProperties.cc:67
boost::python::dict getPyDict(void) const
Return a Python dictionary containing the object members values.
Definition: EntityWithProperties.cc:126
boost::python::object getPyProp(const std::string &str)
Return the Python object with the name being passed as parameter.
Definition: EntityWithProperties.cc:41
Object that can return properties as Python objects.
Definition: EntityWithProperties.h:32
Entity with a pointer to its owner.
Definition: EntityWithOwner.h:34
bool isEqual(const EntityWithProperties &) const
Return true if both objects are equal.
Definition: EntityWithProperties.cc:94
EntityWithProperties(EntityWithProperties *owr=nullptr)
Default constructor.
Definition: EntityWithProperties.cc:28
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: EntityWithProperties.cc:153
void copyPropsFrom(const EntityWithProperties &)
Copy the properties from the argument.
Definition: EntityWithProperties.cc:82
bool hasPyProp(const std::string &)
Returns true if property exists.
Definition: EntityWithProperties.cc:37
const PythonDict & getPropertiesDict(void) const
Return a std::map container with the properties of the object.
Definition: EntityWithProperties.cc:90
boost::python::list getPropNames(void) const
Return the names of the object properties weightings.
Definition: EntityWithProperties.cc:73
void clearPyProps(void)
Clear python properties map.
Definition: EntityWithProperties.cc:33