FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python/include/boost/python/object/pickle_support.hpp at python313 · boostorg/python · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
boostorg
/
python
Public
Notifications
You must be signed in to change notification settings
Fork
223
Star
537
Code
Issues
173
Pull requests
34
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python
/
include
/
boost
/
python
/
object
/
pickle_support.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
124 lines (104 loc) · 3.11 KB
Breadcrumbs
python
/
include
/
boost
/
python
/
object
/
pickle_support.hpp
Copy path
File metadata and controls
124 lines (104 loc) · 3.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//
(C) Copyright R.W. Grosse-Kunstleve 2002.
//
Distributed under the Boost Software License, Version 1.0. (See
//
accompanying file LICENSE_1_0.txt or copy at
//
http://www.boost.org/LICENSE_1_0.txt)
#
ifndef
BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_RWGK20020603_HPP
#
define
BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_RWGK20020603_HPP
#
include
<
boost/python/detail/prefix.hpp
>
namespace
boost
{
namespace
python
{
namespace
api
{
class
object
;
}
using
api::object;
class
tuple
;
BOOST_PYTHON_DECL
object
const
&
make_instance_reduce_function
();
struct
pickle_suite
;
namespace
error_messages
{
template
<
class
T
>
struct
missing_pickle_suite_function_or_incorrect_signature
{};
inline
void
must_be_derived_from_pickle_suite
(pickle_suite
const
&) {}
}
namespace
detail
{
struct
pickle_suite_registration
; }
struct
pickle_suite
{
private:
struct
inaccessible
{};
friend
struct
detail
::pickle_suite_registration;
public:
static
inaccessible*
getinitargs
() {
return
0
; }
static
inaccessible*
getstate
() {
return
0
; }
static
inaccessible*
setstate
() {
return
0
; }
static
bool
getstate_manages_dict
() {
return
false
; }
};
namespace
detail
{
struct
pickle_suite_registration
{
typedef
pickle_suite::inaccessible inaccessible;
template
<
class
Class_
,
class
Tgetinitargs
>
static
void
register_
(
Class_& cl,
tuple
(*getinitargs_fn)(Tgetinitargs),
inaccessible* (*
/*
getstate_fn
*/
)(),
inaccessible* (*
/*
setstate_fn
*/
)(),
bool)
{
cl.
enable_pickling_
(
false
);
cl.
def
(
"
__getinitargs__
"
, getinitargs_fn);
}
template
<
class
Class_
,
class
Rgetstate
,
class
Tgetstate
,
class
Tsetstate
,
class
Ttuple
>
static
void
register_
(
Class_& cl,
inaccessible* (*
/*
getinitargs_fn
*/
)(),
Rgetstate (*getstate_fn)(Tgetstate),
void (*setstate_fn)(Tsetstate, Ttuple),
bool getstate_manages_dict)
{
cl.
enable_pickling_
(getstate_manages_dict);
cl.
def
(
"
__getstate__
"
, getstate_fn);
cl.
def
(
"
__setstate__
"
, setstate_fn);
}
template
<
class
Class_
,
class
Tgetinitargs
,
class
Rgetstate
,
class
Tgetstate
,
class
Tsetstate
,
class
Ttuple
>
static
void
register_
(
Class_& cl,
tuple
(*getinitargs_fn)(Tgetinitargs),
Rgetstate (*getstate_fn)(Tgetstate),
void (*setstate_fn)(Tsetstate, Ttuple),
bool getstate_manages_dict)
{
cl.
enable_pickling_
(getstate_manages_dict);
cl.
def
(
"
__getinitargs__
"
, getinitargs_fn);
cl.
def
(
"
__getstate__
"
, getstate_fn);
cl.
def
(
"
__setstate__
"
, setstate_fn);
}
template
<
class
Class_
>
static
void
register_
(
Class_&,
...)
{
typedef
typename
error_messages::missing_pickle_suite_function_or_incorrect_signature<
Class_>::error_type error_type
BOOST_ATTRIBUTE_UNUSED
;
}
};
template
<
typename
PickleSuiteType>
struct
pickle_suite_finalize
: PickleSuiteType,
pickle_suite_registration
{};
}
//
namespace detail
}}
//
namespace boost::python
#endif
//
BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_RWGK20020603_HPP
Back
|
FazBrowse Home
|
New Git URL