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/scoped_ptr.hpp // // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // (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_SCOPED_PTR_HPP_INCLUDED #define BOOST_INTERPROCESS_SCOPED_PTR_HPP_INCLUDED #include
#include
#include
#include
//!\file //!Describes the smart pointer scoped_ptr namespace boost { namespace interprocess { //!scoped_ptr stores a pointer to a dynamically allocated object. //!The object pointed to is guaranteed to be deleted, either on destruction //!of the scoped_ptr, or via an explicit reset. The user can avoid this //!deletion using release(). //!scoped_ptr is parameterized on T (the type of the object pointed to) and //!Deleter (the functor to be executed to delete the internal pointer). //!The internal pointer will be of the same pointer type as typename //!Deleter::pointer type (that is, if typename Deleter::pointer is //!offset_ptr
, the internal pointer will be offset_ptr
). template
class scoped_ptr : private Deleter { /// @cond scoped_ptr(scoped_ptr const &); scoped_ptr & operator=(scoped_ptr const &); typedef scoped_ptr
this_type; typedef typename detail::add_reference
::type reference; /// @endcond public: typedef T element_type; typedef Deleter deleter_type; typedef typename detail::pointer_type
::type pointer; //!Provides the type of the internal stored pointer // typedef typename detail::pointer_to_other //
::type pointer; //!Constructs a scoped_ptr, storing a copy of p(which can be 0) and d. //!Does not throw. explicit scoped_ptr(const pointer &p = 0, const Deleter &d = Deleter()) : Deleter(d), m_ptr(p) // throws if pointer/Deleter copy ctor throws {} //!If the stored pointer is not 0, destroys the object pointed to by the stored pointer. //!calling the operator() of the stored deleter. Never throws ~scoped_ptr() { if(m_ptr){ Deleter &del = static_cast
(*this); del(m_ptr); } } //!Deletes the object pointed to by the stored pointer and then //!stores a copy of p. Never throws void reset(const pointer &p = 0) // never throws { BOOST_ASSERT(p == 0 || p != m_ptr); this_type(p).swap(*this); } //!Deletes the object pointed to by the stored pointer and then //!stores a copy of p and a copy of d. void reset(const pointer &p, const Deleter &d) // never throws { BOOST_ASSERT(p == 0 || p != m_ptr); this_type(p).swap(*this); } //!Assigns internal pointer as 0 and returns previous pointer. This will //!avoid deletion on destructor pointer release() { pointer tmp(m_ptr); m_ptr = 0; return tmp; } //!Returns a reference to the object pointed to by the stored pointer. //!Never throws. reference operator*() const { BOOST_ASSERT(m_ptr != 0); return *m_ptr; } //!Returns the internal stored pointer. //!Never throws. pointer &operator->() { BOOST_ASSERT(m_ptr != 0); return m_ptr; } //!Returns the internal stored pointer. //!Never throws. const pointer &operator->() const { BOOST_ASSERT(m_ptr != 0); return m_ptr; } //!Returns the stored pointer. //!Never throws. pointer & get() { return m_ptr; } //!Returns the stored pointer. //!Never throws. const pointer & get() const { return m_ptr; } typedef pointer this_type::*unspecified_bool_type; //!Conversion to bool //!Never throws operator unspecified_bool_type() const { return m_ptr == 0? 0: &this_type::m_ptr; } //!Returns true if the stored pointer is 0. //!Never throws. bool operator! () const // never throws { return m_ptr == 0; } //!Exchanges the internal pointer and deleter with other scoped_ptr //!Never throws. void swap(scoped_ptr & b) // never throws { detail::do_swap
(*this, b); detail::do_swap(m_ptr, b.m_ptr); } /// @cond private: pointer m_ptr; /// @endcond }; //!Exchanges the internal pointer and deleter with other scoped_ptr //!Never throws. template
inline void swap(scoped_ptr
& a, scoped_ptr
& b) { a.swap(b); } //!Returns a copy of the stored pointer //!Never throws template
inline typename scoped_ptr
::pointer get_pointer(scoped_ptr
const & p) { return p.get(); } } // namespace interprocess /// @cond #if defined(_MSC_VER) && (_MSC_VER < 1400) template
inline T *get_pointer(boost::interprocess::scoped_ptr
const & p) { return p.get(); } #endif /// @endcond } // namespace boost #include
#endif // #ifndef BOOST_INTERPROCESS_SCOPED_PTR_HPP_INCLUDED
scoped_ptr.hpp
Page URL
File URL
Prev
4/7
Next
Download
( 5 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.