aboutsummaryrefslogtreecommitdiff
path: root/python/choices.cc
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2013-08-27 21:56:44 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2013-08-27 21:56:44 +0100
commit64f0d9760ea6c390c8fc7b5366dc8cb2a31f38be (patch)
treef6ea9b9749987348ee528325cf3d693565d89d9e /python/choices.cc
parent2d3a4c3ba2c414fa7d92713465c46d54a63f22d3 (diff)
downloadpaludis-64f0d9760ea6c390c8fc7b5366dc8cb2a31f38be.tar.gz
paludis-64f0d9760ea6c390c8fc7b5366dc8cb2a31f38be.tar.xz
Another attempt at new Boost compatibility
Instead of weird hacks with const_cast that aren't compatible with Boost's get_pointer implementation for shared_ptr, use non-const pointers as the representation and register conversions, like most of the classes did already.
Diffstat (limited to 'python/choices.cc')
-rw-r--r--python/choices.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/choices.cc b/python/choices.cc
index 18287effe..b4658da12 100644
--- a/python/choices.cc
+++ b/python/choices.cc
@@ -30,7 +30,8 @@ namespace bp = boost::python;
void expose_choices()
{
- bp::class_<Choices, std::shared_ptr<const Choices>, boost::noncopyable> choices(
+ register_shared_ptrs_to_python<Choices>(rsp_const);
+ bp::class_<Choices, std::shared_ptr<Choices>, boost::noncopyable> choices(
"Choices",
"A collection of configurable values for a PackageID",
bp::init<>("__init__()")
@@ -50,7 +51,8 @@ void expose_choices()
)
;
- bp::class_<Choice, std::shared_ptr<const Choice>, boost::noncopyable> choice(
+ register_shared_ptrs_to_python<Choice>(rsp_const);
+ bp::class_<Choice, std::shared_ptr<Choice>, boost::noncopyable> choice(
"Choice",
"An individual choice in a Choices collection.",
bp::no_init
@@ -90,7 +92,8 @@ void expose_choices()
)
;
- bp::class_<ChoiceValue, std::shared_ptr<const ChoiceValue>, boost::noncopyable> choice_value(
+ register_shared_ptrs_to_python<ChoiceValue>(rsp_const);
+ bp::class_<ChoiceValue, std::shared_ptr<ChoiceValue>, boost::noncopyable> choice_value(
"ChoiceValue",
"An individual value in a ChoiceValue",
bp::no_init