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 David Abrahams 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 LVALUE_FROM_PYTYPE_DWA2002130_HPP # define LVALUE_FROM_PYTYPE_DWA2002130_HPP # include
#ifndef BOOST_PYTHON_NO_PY_SIGNATURES # include
#endif # include
# include
# include
namespace boost { namespace python { namespace detail { // Given a pointer-to-function of 1 parameter returning a reference // type, return the type_id of the function's return type. template
inline type_info extractor_type_id(T&(*)(U)) { return type_id
(); } // A function generator whose static execute() function is an lvalue // from_python converter using the given Extractor. U is expected to // be the actual type of the PyObject instance from which the result // is being extracted. template
struct normalized_extractor { static inline void* execute(PyObject* op) { typedef typename boost::add_reference
::type param; return &Extractor::execute( boost::python::detail::void_ptr_to_reference( op, (param(*)())0 ) ); } }; // Given an Extractor type and a pointer to its execute function, // return a new object whose static execute function does the same // job but is a conforming lvalue from_python conversion function. // // usage: normalize
(&Extractor::execute) template
inline normalized_extractor
normalize(T(*)(U), Extractor* = 0) { return normalized_extractor
(); } } // An Extractor which extracts the given member from a Python object // whose instances are stored as InstanceType. template
struct extract_member { static MemberType& execute(InstanceType& c) { (void)c.ob_type; // static assertion return c.*member; } }; // An Extractor which simply extracts the entire python object // instance of InstanceType. template
struct extract_identity { static InstanceType& execute(InstanceType& c) { (void)c.ob_type; // static assertion return c; } }; // Registers a from_python conversion which extracts lvalues using // Extractor's static execute function from Python objects whose type // object is python_type. template
struct lvalue_from_pytype { lvalue_from_pytype() { converter::registry::insert ( &extract , detail::extractor_type_id(&Extractor::execute) #ifndef BOOST_PYTHON_NO_PY_SIGNATURES , &get_pytype #endif ); } private: static void* extract(PyObject* op) { return PyObject_TypeCheck(op, const_cast
(python_type)) ? const_cast
( static_cast
( detail::normalize
(&Extractor::execute).execute(op))) : 0 ; } #ifndef BOOST_PYTHON_NO_PY_SIGNATURES static PyTypeObject const*get_pytype() { return python_type; } #endif }; }} // namespace boost::python #endif // LVALUE_FROM_PYTYPE_DWA2002130_HPP
lvalue_from_pytype.hpp
Page URL
File URL
Prev
36/85
Next
Download
( 3 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.