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
#ifndef BOOST_INTRUSIVE_PTR_HPP_INCLUDED #define BOOST_INTRUSIVE_PTR_HPP_INCLUDED // // intrusive_ptr.hpp // // Copyright (c) 2001, 2002 Peter Dimov // // 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) // // See http://www.boost.org/libs/smart_ptr/intrusive_ptr.html for documentation. // #include
#ifdef BOOST_MSVC // moved here to work around VC++ compiler crash # pragma warning(push) # pragma warning(disable:4284) // odd return type for operator-> #endif #include
#include
#include
// for std::less #include
// for std::basic_ostream namespace boost { // // intrusive_ptr // // A smart pointer that uses intrusive reference counting. // // Relies on unqualified calls to // // void intrusive_ptr_add_ref(T * p); // void intrusive_ptr_release(T * p); // // (p != 0) // // The object is responsible for destroying itself. // template
class intrusive_ptr { private: typedef intrusive_ptr this_type; public: typedef T element_type; intrusive_ptr(): p_(0) { } intrusive_ptr(T * p, bool add_ref = true): p_(p) { if(p_ != 0 && add_ref) intrusive_ptr_add_ref(p_); } #if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) template
intrusive_ptr(intrusive_ptr
const & rhs): p_(rhs.get()) { if(p_ != 0) intrusive_ptr_add_ref(p_); } #endif intrusive_ptr(intrusive_ptr const & rhs): p_(rhs.p_) { if(p_ != 0) intrusive_ptr_add_ref(p_); } ~intrusive_ptr() { if(p_ != 0) intrusive_ptr_release(p_); } #if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES) template
intrusive_ptr & operator=(intrusive_ptr
const & rhs) { this_type(rhs).swap(*this); return *this; } #endif intrusive_ptr & operator=(intrusive_ptr const & rhs) { this_type(rhs).swap(*this); return *this; } intrusive_ptr & operator=(T * rhs) { this_type(rhs).swap(*this); return *this; } void reset( T * rhs ) { this_type( rhs ).swap( *this ); } T * get() const { return p_; } T & operator*() const { BOOST_ASSERT( p_ != 0 ); return *p_; } T * operator->() const { BOOST_ASSERT( p_ != 0 ); return p_; } #if defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530) operator bool () const { return p_ != 0; } #elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) typedef T * (this_type::*unspecified_bool_type)() const; operator unspecified_bool_type() const // never throws { return p_ == 0? 0: &this_type::get; } #else typedef T * this_type::*unspecified_bool_type; operator unspecified_bool_type () const { return p_ == 0? 0: &this_type::p_; } #endif // operator! is a Borland-specific workaround bool operator! () const { return p_ == 0; } void swap(intrusive_ptr & rhs) { T * tmp = p_; p_ = rhs.p_; rhs.p_ = tmp; } private: T * p_; }; template
inline bool operator==(intrusive_ptr
const & a, intrusive_ptr
const & b) { return a.get() == b.get(); } template
inline bool operator!=(intrusive_ptr
const & a, intrusive_ptr
const & b) { return a.get() != b.get(); } template
inline bool operator==(intrusive_ptr
const & a, U * b) { return a.get() == b; } template
inline bool operator!=(intrusive_ptr
const & a, U * b) { return a.get() != b; } template
inline bool operator==(T * a, intrusive_ptr
const & b) { return a == b.get(); } template
inline bool operator!=(T * a, intrusive_ptr
const & b) { return a != b.get(); } #if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 // Resolve the ambiguity between our op!= and the one in rel_ops template
inline bool operator!=(intrusive_ptr
const & a, intrusive_ptr
const & b) { return a.get() != b.get(); } #endif template
inline bool operator<(intrusive_ptr
const & a, intrusive_ptr
const & b) { return std::less
()(a.get(), b.get()); } template
void swap(intrusive_ptr
& lhs, intrusive_ptr
& rhs) { lhs.swap(rhs); } // mem_fn support template
T * get_pointer(intrusive_ptr
const & p) { return p.get(); } template
intrusive_ptr
static_pointer_cast(intrusive_ptr
const & p) { return static_cast
(p.get()); } template
intrusive_ptr
const_pointer_cast(intrusive_ptr
const & p) { return const_cast
(p.get()); } template
intrusive_ptr
dynamic_pointer_cast(intrusive_ptr
const & p) { return dynamic_cast
(p.get()); } // operator<< #if defined(__GNUC__) && (__GNUC__ < 3) template
std::ostream & operator<< (std::ostream & os, intrusive_ptr
const & p) { os << p.get(); return os; } #else // in STLport's no-iostreams mode no iostream symbols can be used #ifndef _STLP_NO_IOSTREAMS # if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300 && __SGI_STL_PORT) // MSVC6 has problems finding std::basic_ostream through the using declaration in namespace _STL using std::basic_ostream; template
basic_ostream
& operator<< (basic_ostream
& os, intrusive_ptr
const & p) # else template
std::basic_ostream
& operator<< (std::basic_ostream
& os, intrusive_ptr
const & p) # endif { os << p.get(); return os; } #endif // _STLP_NO_IOSTREAMS #endif // __GNUC__ < 3 } // namespace boost #ifdef BOOST_MSVC # pragma warning(pop) #endif #endif // #ifndef BOOST_INTRUSIVE_PTR_HPP_INCLUDED
intrusive_ptr.hpp
Page URL
File URL
Prev
45/113
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.