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
// // handler_queue.hpp // ~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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 BOOST_ASIO_DETAIL_HANDLER_QUEUE_HPP #define BOOST_ASIO_DETAIL_HANDLER_QUEUE_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include
#include
#include
#include
namespace boost { namespace asio { namespace detail { class handler_queue : private noncopyable { public: // Base class for handlers in the queue. class handler : private noncopyable { public: void invoke() { invoke_func_(this); } void destroy() { destroy_func_(this); } protected: typedef void (*invoke_func_type)(handler*); typedef void (*destroy_func_type)(handler*); handler(invoke_func_type invoke_func, destroy_func_type destroy_func) : next_(0), invoke_func_(invoke_func), destroy_func_(destroy_func) { } ~handler() { } private: friend class handler_queue; handler* next_; invoke_func_type invoke_func_; destroy_func_type destroy_func_; }; // Smart point to manager handler lifetimes. class scoped_ptr : private noncopyable { public: explicit scoped_ptr(handler* h) : handler_(h) { } ~scoped_ptr() { if (handler_) handler_->destroy(); } handler* get() const { return handler_; } handler* release() { handler* tmp = handler_; handler_ = 0; return tmp; } private: handler* handler_; }; // Constructor. handler_queue() : front_(0), back_(0) { } // Wrap a handler to be pushed into the queue. template
static handler* wrap(Handler h) { // Allocate and construct an object to wrap the handler. typedef handler_wrapper
value_type; typedef handler_alloc_traits
alloc_traits; raw_handler_ptr
raw_ptr(h); handler_ptr
ptr(raw_ptr, h); return ptr.release(); } // Get the handler at the front of the queue. handler* front() { return front_; } // Pop a handler from the front of the queue. void pop() { if (front_) { handler* tmp = front_; front_ = front_->next_; if (front_ == 0) back_ = 0; tmp->next_= 0; } } // Push a handler on to the back of the queue. void push(handler* h) { h->next_ = 0; if (back_) { back_->next_ = h; back_ = h; } else { front_ = back_ = h; } } // Whether the queue is empty. bool empty() const { return front_ == 0; } private: // Template wrapper for handlers. template
class handler_wrapper : public handler { public: handler_wrapper(Handler h) : handler( &handler_wrapper
::do_call, &handler_wrapper
::do_destroy), handler_(h) { } static void do_call(handler* base) { // Take ownership of the handler object. typedef handler_wrapper
this_type; this_type* h(static_cast
(base)); typedef handler_alloc_traits
alloc_traits; handler_ptr
ptr(h->handler_, h); // Make a copy of the handler so that the memory can be deallocated before // the upcall is made. Handler handler(h->handler_); // Free the memory associated with the handler. ptr.reset(); // Make the upcall. boost_asio_handler_invoke_helpers::invoke(handler, &handler); } static void do_destroy(handler* base) { // Take ownership of the handler object. typedef handler_wrapper
this_type; this_type* h(static_cast
(base)); typedef handler_alloc_traits
alloc_traits; handler_ptr
ptr(h->handler_, h); } private: Handler handler_; }; // The front of the queue. handler* front_; // The back of the queue. handler* back_; }; } // namespace detail } // namespace asio } // namespace boost #include
#endif // BOOST_ASIO_DETAIL_HANDLER_QUEUE_HPP
handler_queue.hpp
Page URL
File URL
Prev
16/76
Next
Download
( 4 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.