Skip to content

Commit

Permalink
Re #6151 Small API changes to prepare for v2 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Nov 16, 2012
1 parent e1ba46f commit e61b019
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ using namespace boost::python;
void export_algorithm()
{
REGISTER_SHARED_PTR_TO_PYTHON(Algorithm);
class_<Algorithm, bases<IAlgorithm>, boost::noncopyable>("Algorithm", "Base-class for C algorithms", no_init);
class_<Algorithm, bases<IAlgorithm>, boost::noncopyable>("Algorithm", "Base-class for C algorithms", no_init)
.def("fromString", &Algorithm::fromString, "Initializes the algorithm")
.staticmethod("fromString")
;

REGISTER_SHARED_PTR_TO_PYTHON(AlgorithmProxy);
class_<AlgorithmProxy, bases<IAlgorithm>, boost::noncopyable>("AlgorithmProxy", "Proxy class returned by managed algorithms", no_init);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ void export_IPropertyManager()
.def("setPropertyValue", &IPropertyManager::setPropertyValue,
"Set the value of the named property via a string")
.def("setProperty", &setProperty, "Set the value of the named property")
.def("existsProperty", &IPropertyManager::existsProperty,
"Returns whether a property exists")
// Special methods so that IPropertyManager acts like a dictionary
.def("__len__", &IPropertyManager::propertyCount)
.def("__contains__", &IPropertyManager::existsProperty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ void export_PropertyManager()
REGISTER_SHARED_PTR_TO_PYTHON(PropertyManager);
class_<PropertyManager, bases<IPropertyManager>, boost::noncopyable>("PropertyManager")
.def("propertyCount", &PropertyManager::propertyCount, "Returns the number of properties being managed")
.def("getProperty", &PropertyManager::getProperty, return_value_policy<return_by_value>(),
"Returns the property of the given name. Use .value to give the value")
//.def("getProperty", &PropertyManager::getProperty, return_value_policy<return_by_value>(),
// "Returns the property of the given name. Use .value to give the value")
.def("getPropertyValue", &PropertyManager::getPropertyValue,
"Returns a string representation of the named property's value")
.def("getProperties", &PropertyManager::getProperties, return_value_policy<copy_const_reference>(),
Expand All @@ -100,7 +100,7 @@ void export_PropertyManager()
// Special methods to act like a dictionary
.def("__len__", &PropertyManager::propertyCount)
.def("__contains__", &PropertyManager::existsProperty)
.def("__getitem__", &PropertyManager::getProperty)
//.def("__getitem__", &PropertyManager::getProperty)
.def("__setitem__", &declareOrSetProperty)
;
}
Expand Down

0 comments on commit e61b019

Please sign in to comment.