DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
// Copyright Gottfried Gan�auge 2003..2006. // 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) /* * Generic Conversion of opaque C++-pointers to a Python-Wrapper. */ # ifndef OPAQUE_POINTER_CONVERTER_HPP_ # define OPAQUE_POINTER_CONVERTER_HPP_ # include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
// opaque -- // // registers to- and from- python conversions for a type Pointee. // // Note: // In addition you need to define specializations for type_id // on the type pointed to by Pointer using // BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) // // For an example see libs/python/test/opaque.cpp // namespace boost { namespace python { template
struct opaque { opaque() { if (type_object.tp_name == 0) { type_object.tp_name = const_cast
(type_id
().name()); if (PyType_Ready (&type_object) < 0) { throw error_already_set(); } this->register_self(); } } static opaque instance; private: static void* extract(PyObject* op) { return PyObject_TypeCheck(op, &type_object) ? static_cast
(implicit_cast
(op))->x : 0 ; } static PyObject* wrap(void const* px) { Pointee* x = *static_cast
(px); if (x == 0) return detail::none(); if ( python_instance *o = PyObject_New(python_instance, &type_object) ) { o->x = x; return static_cast
(implicit_cast
(o)); } else { throw error_already_set(); } } void register_self() { converter::registration const *existing = converter::registry::query (type_id
()); if ((existing == 0) || (existing->m_to_python == 0)) { #ifndef BOOST_PYTHON_NO_PY_SIGNATURES converter::registry::insert(&extract, type_id
(), &get_pytype); converter::registry::insert(&wrap, type_id
(), &get_pytype); #else converter::registry::insert(&extract, type_id
()); converter::registry::insert(&wrap, type_id
()); #endif } } struct python_instance { PyObject_HEAD Pointee* x; }; static PyTypeObject type_object; #ifndef BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const *get_pytype(){return &type_object; } #endif }; template
opaque
opaque
::instance; template
PyTypeObject opaque
::type_object = { PyObject_HEAD_INIT(0) 0, 0, sizeof( BOOST_DEDUCED_TYPENAME opaque
::python_instance ), 0, ::boost::python::detail::dealloc, 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ 0, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ #if PYTHON_API_VERSION >= 1012 0 /* tp_del */ #endif }; }} // namespace boost::python # if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) # define BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) # else // If you change the below, don't forget to alter the end of type_id.hpp # define BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) \ namespace boost { namespace python { \ template<> \ inline type_info type_id
(BOOST_PYTHON_EXPLICIT_TT_DEF(Pointee)) \ { \ return type_info (typeid (Pointee *)); \ } \ template<> \ inline type_info type_id
( \ BOOST_PYTHON_EXPLICIT_TT_DEF(const volatile Pointee&)) \ { \ return type_info (typeid (Pointee *)); \ } \ }} # endif # endif // OPAQUE_POINTER_CONVERTER_HPP_
opaque_pointer_converter.hpp
Page URL
File URL
Prev
53/85
Next
Download
( 6 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.