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 OBJECT_MANAGER_DWA2002614_HPP # define OBJECT_MANAGER_DWA2002614_HPP # include
# include
# include
# include
# include
# include
# include
// Facilities for dealing with types which always manage Python // objects. Some examples are object, list, str, et. al. Different // to_python/from_python conversion rules apply here because in // contrast to other types which are typically embedded inside a // Python object, these are wrapped around a Python object. For most // object managers T, a C++ non-const T reference argument does not // imply the existence of a T lvalue embedded in the corresponding // Python argument, since mutating member functions on T actually only // modify the held Python object. // // handle
is an object manager, though strictly speaking it should // not be. In other words, even though mutating member functions of // hanlde
actually modify the handle
and not the T object, // handle
& arguments of wrapped functions will bind to "rvalues" // wrapping the actual Python argument, just as with other object // manager classes. Making an exception for handle
is simply not // worth the trouble. // // borrowed
cv* is an object manager so that we can use the general // to_python mechanisms to convert raw Python object pointers to // python, without the usual semantic problems of using raw pointers. // Object Manager Concept requirements: // // T is an Object Manager // p is a PyObject* // x is a T // // * object_manager_traits
::is_specialized == true // // * T(detail::borrowed_reference(p)) // Manages p without checking its type // // * get_managed_object(x, boost::python::tag) // Convertible to PyObject* // // Additional requirements if T can be converted from_python: // // * T(object_manager_traits
::adopt(p)) // steals a reference to p, or throws a TypeError exception if // p doesn't have an appropriate type. May assume p is non-null // // * X::check(p) // convertible to bool. True iff T(X::construct(p)) will not // throw. // Forward declarations // namespace boost { namespace python { namespace api { class object; } }} namespace boost { namespace python { namespace converter { // Specializations for handle
template
struct handle_object_manager_traits : pyobject_traits
{ private: typedef pyobject_traits
base; public: BOOST_STATIC_CONSTANT(bool, is_specialized = true); // Initialize with a null_ok pointer for efficiency, bypassing the // null check since the source is always non-null. static null_ok
* adopt(PyObject* p) { return python::allow_null(base::checked_downcast(p)); } }; template
struct default_object_manager_traits { BOOST_STATIC_CONSTANT( bool, is_specialized = python::detail::is_borrowed_ptr
::value ); }; template
struct object_manager_traits : mpl::if_c< is_handle
::value , handle_object_manager_traits
, default_object_manager_traits
>::type { }; // // Traits for detecting whether a type is an object manager or a // (cv-qualified) reference to an object manager. // template
struct is_object_manager : mpl::bool_
::is_specialized> { }; # ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template
struct is_reference_to_object_manager : mpl::false_ { }; template
struct is_reference_to_object_manager
: is_object_manager
{ }; template
struct is_reference_to_object_manager
: is_object_manager
{ }; template
struct is_reference_to_object_manager
: is_object_manager
{ }; template
struct is_reference_to_object_manager
: is_object_manager
{ }; # else namespace detail { typedef char (&yes_reference_to_object_manager)[1]; typedef char (&no_reference_to_object_manager)[2]; // A number of nastinesses go on here in order to work around MSVC6 // bugs. template
struct is_object_manager_help { typedef typename mpl::if_< is_object_manager
, yes_reference_to_object_manager , no_reference_to_object_manager >::type type; // If we just use the type instead of the result of calling this // function, VC6 will ICE. static type call(); }; // A set of overloads for each cv-qualification. The same argument // is passed twice: the first one is used to unwind the cv*, and the // second one is used to avoid relying on partial ordering for // overload resolution. template
typename is_object_manager_help
is_object_manager_helper(U*, void*); template
typename is_object_manager_help
is_object_manager_helper(U const*, void const*); template
typename is_object_manager_help
is_object_manager_helper(U volatile*, void volatile*); template
typename is_object_manager_help
is_object_manager_helper(U const volatile*, void const volatile*); template
struct is_reference_to_object_manager_nonref : mpl::false_ { }; template
struct is_reference_to_object_manager_ref { static T sample_object; BOOST_STATIC_CONSTANT( bool, value = (sizeof(is_object_manager_helper(&sample_object, &sample_object).call()) == sizeof(detail::yes_reference_to_object_manager) ) ); typedef mpl::bool_
type; }; } template
struct is_reference_to_object_manager : mpl::if_< is_reference
, detail::is_reference_to_object_manager_ref
, detail::is_reference_to_object_manager_nonref
>::type { }; # endif }}} // namespace boost::python::converter #endif // OBJECT_MANAGER_DWA2002614_HPP
object_manager.hpp
Page URL
File URL
Prev
12/27
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.