2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-28 07:22:31 +00:00

Added module name retrieval for pickling support

[SVN r8246]
This commit is contained in:
Dave Abrahams
2000-11-17 20:22:30 +00:00
parent 12cdb1d2c7
commit a3fa57d58f
2 changed files with 23 additions and 6 deletions

View File

@@ -11,6 +11,7 @@
# include "pyconfig.h"
# include "pyptr.h"
# include "objects.h"
# include "functions.h"
namespace py {
@@ -19,13 +20,13 @@ class Module
{
typedef PyObject * (*RawFunctionPtr)(py::Tuple const &, py::Dict const &);
public:
public:
// Create a module. REQUIRES: only one Module is created per module.
Module(const char* name);
// Add elements to the module
void add(Function* x, const char* name);
void add(PyTypeObject* x, const char* name = 0);
void add(Ptr x, const char*name);
template <class Fn>
@@ -39,6 +40,9 @@ public:
{
add(new_wrapped_function(fn), name);
}
static String name();
private:
PyObject* m_module;
static PyMethodDef initial_methods[1];