mirror of
https://github.com/boostorg/python.git
synced 2026-01-26 06:42:27 +00:00
Enhanced pickle safety measures.
[SVN r9358]
This commit is contained in:
@@ -16,18 +16,21 @@ class class_builder
|
||||
: python_extension_class_converters<T, U> // Works around MSVC6.x/GCC2.95.2 bug described below
|
||||
{
|
||||
public:
|
||||
class_builder(module_builder& module, const char* name,
|
||||
bool auto_pickle = false)
|
||||
class_builder(module_builder& module, const char* name)
|
||||
: m_class(new detail::extension_class<T, U>(name))
|
||||
{
|
||||
module.add(ref(as_object(m_class.get()), ref::increment_count), name);
|
||||
if (auto_pickle) {
|
||||
add(ref(BOOST_PYTHON_CONVERSION::to_python(1)), "__auto_pickle__");
|
||||
}
|
||||
}
|
||||
|
||||
~class_builder()
|
||||
{}
|
||||
|
||||
inline void dict_defines_state() {
|
||||
add(ref(BOOST_PYTHON_CONVERSION::to_python(1)), "__dict_defines_state__");
|
||||
}
|
||||
inline void getstate_manages_dict() {
|
||||
add(ref(BOOST_PYTHON_CONVERSION::to_python(1)), "__getstate_manages_dict__");
|
||||
}
|
||||
|
||||
// define constructors
|
||||
template <class signature>
|
||||
|
||||
Reference in New Issue
Block a user