mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 06:02:14 +00:00
pickle_group renamed -> pickle_suite
[SVN r14565]
This commit is contained in:
@@ -197,15 +197,15 @@ class class_ : public objects::class_base
|
||||
self& setattr(char const* name, handle<> const&);
|
||||
|
||||
// Pickle support
|
||||
template <typename PickleGroupType>
|
||||
self& def_pickle(PickleGroupType)
|
||||
template <typename PickleSuiteType>
|
||||
self& def_pickle(PickleSuiteType)
|
||||
{
|
||||
detail::pickle_group_finalize<PickleGroupType>::register_(
|
||||
detail::pickle_suite_finalize<PickleSuiteType>::register_(
|
||||
*this,
|
||||
&PickleGroupType::getinitargs,
|
||||
&PickleGroupType::getstate,
|
||||
&PickleGroupType::setstate,
|
||||
PickleGroupType::getstate_manages_dict());
|
||||
&PickleSuiteType::getinitargs,
|
||||
&PickleSuiteType::getstate,
|
||||
&PickleSuiteType::setstate,
|
||||
PickleSuiteType::getstate_manages_dict());
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,17 +16,17 @@ handle<> make_instance_reduce_function();
|
||||
namespace error_messages {
|
||||
|
||||
template <class T>
|
||||
struct missing_pickle_group_function_or_incorrect_signature {};
|
||||
struct missing_pickle_suite_function_or_incorrect_signature {};
|
||||
|
||||
}
|
||||
|
||||
namespace detail { struct pickle_group_registration; }
|
||||
namespace detail { struct pickle_suite_registration; }
|
||||
|
||||
struct pickle_group
|
||||
struct pickle_suite
|
||||
{
|
||||
private:
|
||||
struct inaccessible {};
|
||||
friend struct detail::pickle_group_registration;
|
||||
friend struct detail::pickle_suite_registration;
|
||||
public:
|
||||
static inaccessible* getinitargs() { return 0; }
|
||||
static inaccessible* getstate() { return 0; }
|
||||
@@ -36,9 +36,9 @@ struct pickle_group
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct pickle_group_registration
|
||||
struct pickle_suite_registration
|
||||
{
|
||||
typedef pickle_group::inaccessible inaccessible;
|
||||
typedef pickle_suite::inaccessible inaccessible;
|
||||
|
||||
template <class Class_, class Tgetinitargs>
|
||||
static
|
||||
@@ -94,15 +94,15 @@ namespace detail {
|
||||
...)
|
||||
{
|
||||
typedef typename
|
||||
error_messages::missing_pickle_group_function_or_incorrect_signature<
|
||||
error_messages::missing_pickle_suite_function_or_incorrect_signature<
|
||||
Class_>::error_type error_type;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename UserPickleGroupType>
|
||||
struct pickle_group_finalize
|
||||
: UserPickleGroupType,
|
||||
pickle_group_registration
|
||||
template <typename PickleSuiteType>
|
||||
struct pickle_suite_finalize
|
||||
: PickleSuiteType,
|
||||
pickle_suite_registration
|
||||
{};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace {
|
||||
std::string get_country() const { return country; }
|
||||
};
|
||||
|
||||
struct world_pickle_group : boost::python::pickle_group
|
||||
struct world_pickle_suite : boost::python::pickle_suite
|
||||
{
|
||||
static
|
||||
boost::python::tuple
|
||||
@@ -54,7 +54,7 @@ BOOST_PYTHON_MODULE_INIT(pickle1_ext)
|
||||
.add(class_<world>("world")
|
||||
.def_init(args<const std::string&>())
|
||||
.def("greet", &world::greet)
|
||||
.def_pickle(world_pickle_group())
|
||||
.def_pickle(world_pickle_suite())
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace { // Avoid cluttering the global namespace.
|
||||
int secret_number;
|
||||
};
|
||||
|
||||
struct world_pickle_group : boost::python::pickle_group
|
||||
struct world_pickle_suite : boost::python::pickle_suite
|
||||
{
|
||||
static
|
||||
boost::python::tuple
|
||||
@@ -95,7 +95,7 @@ BOOST_PYTHON_MODULE_INIT(pickle2_ext)
|
||||
.def("greet", &world::greet)
|
||||
.def("get_secret_number", &world::get_secret_number)
|
||||
.def("set_secret_number", &world::set_secret_number)
|
||||
.def_pickle(world_pickle_group())
|
||||
.def_pickle(world_pickle_suite())
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace { // Avoid cluttering the global namespace.
|
||||
int secret_number;
|
||||
};
|
||||
|
||||
struct world_pickle_group : boost::python::pickle_group
|
||||
struct world_pickle_suite : boost::python::pickle_suite
|
||||
{
|
||||
static
|
||||
boost::python::tuple
|
||||
@@ -101,7 +101,7 @@ BOOST_PYTHON_MODULE_INIT(pickle3_ext)
|
||||
.def("greet", &world::greet)
|
||||
.def("get_secret_number", &world::get_secret_number)
|
||||
.def("set_secret_number", &world::set_secret_number)
|
||||
.def_pickle(world_pickle_group())
|
||||
.def_pickle(world_pickle_suite())
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user