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
////////////////////////////////////////////////////////////////////////////// // // This file is the adaptation for Interprocess of boost/intrusive_ptr.hpp // // (C) Copyright Peter Dimov 2001, 2002 // (C) Copyright Ion Gaztanaga 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) // // See http://www.boost.org/libs/interprocess for documentation. // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_INTERPROCESS_INTRUSIVE_PTR_HPP_INCLUDED #define BOOST_INTERPROCESS_INTRUSIVE_PTR_HPP_INCLUDED //!\file //!Describes an intrusive ownership pointer. #include
#include
#include
#include
#include
// for std::less #include
// for std::basic_ostream namespace boost { namespace interprocess { //!The intrusive_ptr class template stores a pointer to an object //!with an embedded reference count. intrusive_ptr is parameterized on //!T (the type of the object pointed to) and VoidPointer(a void pointer type //!that defines the type of pointer that intrusive_ptr will store). //!intrusive_ptr
defines a class with a T* member whereas //!intrusive_ptr
> defines a class with a offset_ptr
member. //!Relies on unqualified calls to: //! //! void intrusive_ptr_add_ref(T * p); //! void intrusive_ptr_release(T * p); //! //! with (p != 0) //! //!The object is responsible for destroying itself. template
class intrusive_ptr { public: //!Provides the type of the internal stored pointer. typedef typename detail::pointer_to_other
::type pointer; //!Provides the type of the stored pointer. typedef T element_type; /// @cond private: typedef VoidPointer VP; typedef intrusive_ptr this_type; typedef pointer this_type::*unspecified_bool_type; /// @endcond public: //!Constructor. Initializes internal pointer to 0. //!Does not throw intrusive_ptr(): m_ptr(0) {} //!Constructor. Copies pointer and if "p" is not zero and //!"add_ref" is true calls intrusive_ptr_add_ref(get_pointer(p)). //!Does not throw intrusive_ptr(const pointer &p, bool add_ref = true): m_ptr(p) { if(m_ptr != 0 && add_ref) intrusive_ptr_add_ref(detail::get_pointer(m_ptr)); } //!Copy constructor. Copies the internal pointer and if "p" is not //!zero calls intrusive_ptr_add_ref(get_pointer(p)). Does not throw intrusive_ptr(intrusive_ptr const & rhs) : m_ptr(rhs.m_ptr) { if(m_ptr != 0) intrusive_ptr_add_ref(detail::get_pointer(m_ptr)); } //!Constructor from related. Copies the internal pointer and if "p" is not //!zero calls intrusive_ptr_add_ref(get_pointer(p)). Does not throw template
intrusive_ptr (intrusive_ptr
const & rhs) : m_ptr(rhs.get()) { if(m_ptr != 0) intrusive_ptr_add_ref(detail::get_pointer(m_ptr)); } //!Destructor. If internal pointer is not 0, calls //!intrusive_ptr_release(get_pointer(m_ptr)). Does not throw ~intrusive_ptr() { if(m_ptr != 0) intrusive_ptr_release(detail::get_pointer(m_ptr)); } //!Assignment operator. Equivalent to intrusive_ptr(r).swap(*this). //!Does not throw intrusive_ptr & operator=(intrusive_ptr const & rhs) { this_type(rhs).swap(*this); return *this; } //!Assignment from related. Equivalent to intrusive_ptr(r).swap(*this). //!Does not throw template
intrusive_ptr & operator= (intrusive_ptr
const & rhs) { this_type(rhs).swap(*this); return *this; } //!Assignment from pointer. Equivalent to intrusive_ptr(r).swap(*this). //!Does not throw intrusive_ptr & operator=(pointer rhs) { this_type(rhs).swap(*this); return *this; } //!Returns a reference to the internal pointer. //!Does not throw pointer &get() { return m_ptr; } //!Returns a reference to the internal pointer. //!Does not throw const pointer &get() const { return m_ptr; } //!Returns *get(). //!Does not throw T & operator*() const { return *m_ptr; } //!Returns *get(). //!Does not throw const pointer &operator->() const { return m_ptr; } //!Returns get(). //!Does not throw pointer &operator->() { return m_ptr; } //!Conversion to boolean. //!Does not throw operator unspecified_bool_type () const { return m_ptr == 0? 0: &this_type::m_ptr; } //!Not operator. //!Does not throw bool operator! () const { return m_ptr == 0; } //!Exchanges the contents of the two smart pointers. //!Does not throw void swap(intrusive_ptr & rhs) { detail::do_swap(m_ptr, rhs.m_ptr); } /// @cond private: pointer m_ptr; /// @endcond }; //!Returns a.get() == b.get(). //!Does not throw template
inline bool operator==(intrusive_ptr
const & a, intrusive_ptr
const & b) { return a.get() == b.get(); } //!Returns a.get() != b.get(). //!Does not throw template
inline bool operator!=(intrusive_ptr
const & a, intrusive_ptr
const & b) { return a.get() != b.get(); } //!Returns a.get() == b. //!Does not throw template
inline bool operator==(intrusive_ptr
const & a, const typename intrusive_ptr
::pointer &b) { return a.get() == b; } //!Returns a.get() != b. //!Does not throw template
inline bool operator!=(intrusive_ptr
const & a, const typename intrusive_ptr
::pointer &b) { return a.get() != b; } //!Returns a == b.get(). //!Does not throw template
inline bool operator==(const typename intrusive_ptr
::pointer &a, intrusive_ptr
const & b) { return a == b.get(); } //!Returns a != b.get(). //!Does not throw template
inline bool operator!=(const typename intrusive_ptr
::pointer &a, intrusive_ptr
const & b) { return a != b.get(); } //!Returns a.get() < b.get(). //!Does not throw template
inline bool operator<(intrusive_ptr
const & a, intrusive_ptr
const & b) { return std::less
::pointer>() (a.get(), b.get()); } //!Exchanges the contents of the two intrusive_ptrs. //!Does not throw template
inline void swap(intrusive_ptr
& lhs, intrusive_ptr
& rhs) { lhs.swap(rhs); } // operator<< template
inline std::basic_ostream
& operator<< (std::basic_ostream
& os, intrusive_ptr
const & p) { os << p.get(); return os; } //!Returns p.get(). //!Does not throw template
inline typename boost::interprocess::intrusive_ptr
::pointer get_pointer(intrusive_ptr
p) { return p.get(); } /*Emulates static cast operator. Does not throw*/ /* template
inline boost::interprocess::intrusive_ptr
static_pointer_cast (boost::interprocess::intrusive_ptr
const & p) { return do_static_cast
(p.get()); } */ /*Emulates const cast operator. Does not throw*/ /* template
inline boost::interprocess::intrusive_ptr
const_pointer_cast (boost::interprocess::intrusive_ptr
const & p) { return do_const_cast
(p.get()); } */ /*Emulates dynamic cast operator. Does not throw*/ /* template
inline boost::interprocess::intrusive_ptr
dynamic_pointer_cast (boost::interprocess::intrusive_ptr
const & p) { return do_dynamic_cast
(p.get()); } */ /*Emulates reinterpret cast operator. Does not throw*/ /* template
inline boost::interprocess::intrusive_ptr
reinterpret_pointer_cast (boost::interprocess::intrusive_ptr
const & p) { return do_reinterpret_cast
(p.get()); } */ } // namespace interprocess /// @cond #if defined(_MSC_VER) && (_MSC_VER < 1400) //!Returns p.get(). //!Does not throw template
inline T *get_pointer(boost::interprocess::intrusive_ptr
p) { return p.get(); } #endif /// @endcond } // namespace boost #include
#endif // #ifndef BOOST_INTERPROCESS_INTRUSIVE_PTR_HPP_INCLUDED
intrusive_ptr.hpp
Page URL
File URL
Prev
3/7
Next
Download
( 8 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.