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_STATECHART_FIFO_SCHEDULER_HPP_INCLUDED #define BOOST_STATECHART_FIFO_SCHEDULER_HPP_INCLUDED ////////////////////////////////////////////////////////////////////////////// // Copyright 2002-2006 Andreas Huber Doenni // Distributed under the Boost Software License, Version 1.0. (See accompany- // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ////////////////////////////////////////////////////////////////////////////// #include
#include
#include
#include
#include
#include
// BOOST_HAS_THREADS namespace boost { namespace statechart { ////////////////////////////////////////////////////////////////////////////// template< class FifoWorker = fifo_worker<>, class Allocator = std::allocator< void > > class fifo_scheduler : noncopyable { typedef processor_container< fifo_scheduler, typename FifoWorker::work_item, Allocator > container; public: ////////////////////////////////////////////////////////////////////////// #ifdef BOOST_HAS_THREADS fifo_scheduler( bool waitOnEmptyQueue = false ) : worker_( waitOnEmptyQueue ) { } #endif typedef typename container::processor_handle processor_handle; typedef typename container::processor_context processor_context; template< class Processor > processor_handle create_processor() { processor_handle result; work_item item = container_.template create_processor< Processor >( result, *this ); worker_.queue_work_item( item ); return result; } template< class Processor, typename Arg1 > processor_handle create_processor( Arg1 arg1 ) { processor_handle result; work_item item = container_.template create_processor< Processor >( result, *this, arg1 ); worker_.queue_work_item( item ); return result; } template< class Processor, typename Arg1, typename Arg2 > processor_handle create_processor( Arg1 arg1, Arg2 arg2 ) { processor_handle result; work_item item = container_.template create_processor< Processor >( result, *this, arg1, arg2 ); worker_.queue_work_item( item ); return result; } template< class Processor, typename Arg1, typename Arg2, typename Arg3 > processor_handle create_processor( Arg1 arg1, Arg2 arg2, Arg3 arg3 ) { processor_handle result; work_item item = container_.template create_processor< Processor >( result, *this, arg1, arg2, arg3 ); worker_.queue_work_item( item ); return result; } template< class Processor, typename Arg1, typename Arg2, typename Arg3, typename Arg4 > processor_handle create_processor( Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4 ) { processor_handle result; work_item item = container_.template create_processor< Processor >( result, *this, arg1, arg2, arg3, arg4 ); worker_.queue_work_item( item ); return result; } template< class Processor, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5 > processor_handle create_processor( Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5 ) { processor_handle result; work_item item = container_.template create_processor< Processor >( result, *this, arg1, arg2, arg3, arg4, arg5 ); worker_.queue_work_item( item ); return result; } template< class Processor, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6 > processor_handle create_processor( Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6 ) { processor_handle result; work_item item = container_.template create_processor< Processor >( result, *this, arg1, arg2, arg3, arg4, arg5, arg6 ); worker_.queue_work_item( item ); return result; } void destroy_processor( const processor_handle & processor ) { work_item item = container_.destroy_processor( processor ); worker_.queue_work_item( item ); } void initiate_processor( const processor_handle & processor ) { work_item item = container_.initiate_processor( processor ); worker_.queue_work_item( item ); } void terminate_processor( const processor_handle & processor ) { work_item item = container_.terminate_processor( processor ); worker_.queue_work_item( item ); } typedef intrusive_ptr< const event_base > event_ptr_type; void queue_event( const processor_handle & processor, const event_ptr_type & pEvent ) { work_item item = container_.queue_event( processor, pEvent ); worker_.queue_work_item( item ); } typedef typename FifoWorker::work_item work_item; // We take a non-const reference so that we can move (i.e. swap) the item // into the queue, what avoids copying the (possibly heap-allocated) // implementation object inside work_item. void queue_work_item( work_item & item ) { worker_.queue_work_item( item ); } // Convenience overload so that temporary objects can be passed directly // instead of having to create a work_item object first. Under most // circumstances, this will lead to one unnecessary copy of the // function implementation object. void queue_work_item( const work_item & item ) { worker_.queue_work_item( item ); } void terminate() { worker_.terminate(); } // Is not mutex-protected! Must only be called from the thread that also // calls operator(). bool terminated() const { return worker_.terminated(); } unsigned long operator()( unsigned long maxEventCount = 0 ) { return worker_( maxEventCount ); } private: ////////////////////////////////////////////////////////////////////////// container container_; FifoWorker worker_; }; } // namespace statechart } // namespace boost #endif
fifo_scheduler.hpp
Page URL
File URL
Prev
9/21
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.