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 INHERITANCE_DWA200216_HPP # define INHERITANCE_DWA200216_HPP # include
# include
# include
# include
# include
# include
namespace boost { namespace python { namespace objects { typedef type_info class_id; using python::type_id; // Types used to get address and id of most derived type typedef std::pair
dynamic_id_t; typedef dynamic_id_t (*dynamic_id_function)(void*); BOOST_PYTHON_DECL void register_dynamic_id_aux( class_id static_id, dynamic_id_function get_dynamic_id); BOOST_PYTHON_DECL void add_cast( class_id src_t, class_id dst_t, void* (*cast)(void*), bool is_downcast); // // a generator with an execute() function which, given a source type // and a pointer to an object of that type, returns its most-derived // /reachable/ type identifier and object pointer. // // first, the case where T has virtual functions template
struct polymorphic_id_generator { static dynamic_id_t execute(void* p_) { T* p = static_cast
(p_); return std::make_pair(dynamic_cast
(p), class_id(typeid(*p))); } }; // now, the non-polymorphic case. template
struct non_polymorphic_id_generator { static dynamic_id_t execute(void* p_) { return std::make_pair(p_, python::type_id
()); } }; // Now the generalized selector template
struct dynamic_id_generator : mpl::if_< boost::is_polymorphic
, boost::python::objects::polymorphic_id_generator
, boost::python::objects::non_polymorphic_id_generator
> {}; // Register the dynamic id function for T with the type-conversion // system. template
void register_dynamic_id(T* = 0) { typedef typename dynamic_id_generator
::type generator; register_dynamic_id_aux( python::type_id
(), &generator::execute); } // // a generator with an execute() function which, given a void* // pointing to an object of type Source will attempt to convert it to // an object of type Target. // template
struct dynamic_cast_generator { static void* execute(void* source) { return dynamic_cast
( static_cast
(source)); } }; template
struct implicit_cast_generator { static void* execute(void* source) { Target* result = static_cast
(source); return result; } }; template
struct cast_generator : mpl::if_< is_base_and_derived
, implicit_cast_generator
, dynamic_cast_generator
> { }; template
inline void register_conversion( bool is_downcast = ::boost::is_base_and_derived
::value // These parameters shouldn't be used; they're an MSVC bug workaround , Source* = 0, Target* = 0) { typedef typename cast_generator
::type generator; add_cast( python::type_id
() , python::type_id
() , &generator::execute , is_downcast ); } }}} // namespace boost::python::object #endif // INHERITANCE_DWA200216_HPP
inheritance.hpp
Page URL
File URL
Prev
13/27
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.