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_DETAIL_NODE_STATE_HPP_INCLUDED #define BOOST_STATECHART_DETAIL_NODE_STATE_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
// BOOST_ASSERT #include
// std::find_if namespace boost { namespace statechart { namespace detail { template< class Allocator, class RttiPolicy > class node_state_base : public state_base< Allocator, RttiPolicy > { typedef state_base< Allocator, RttiPolicy > base_type; protected: ////////////////////////////////////////////////////////////////////////// node_state_base( typename RttiPolicy::id_provider_type idProvider ) : base_type( idProvider ) { } ~node_state_base() {} public: ////////////////////////////////////////////////////////////////////////// // The following declarations should be private. // They are only public because many compilers lack template friends. ////////////////////////////////////////////////////////////////////////// typedef base_type state_base_type; typedef intrusive_ptr< node_state_base > direct_state_base_ptr_type; virtual void exit_impl( direct_state_base_ptr_type & pSelf, typename base_type::node_state_base_ptr_type & pOutermostUnstableState, bool performFullExit ) = 0; }; ////////////////////////////////////////////////////////////////////////////// template< class OrthogonalRegionCount, class Allocator, class RttiPolicy > class node_state : public node_state_base< Allocator, RttiPolicy > { typedef node_state_base< Allocator, RttiPolicy > base_type; protected: ////////////////////////////////////////////////////////////////////////// node_state( typename RttiPolicy::id_provider_type idProvider ) : base_type( idProvider ) { for ( orthogonal_position_type pos = 0; pos < OrthogonalRegionCount::value; ++pos ) { pInnerStates[ pos ] = 0; } } ~node_state() {} public: ////////////////////////////////////////////////////////////////////////// // The following declarations should be private. // They are only public because many compilers lack template friends. ////////////////////////////////////////////////////////////////////////// typedef typename base_type::state_base_type state_base_type; void add_inner_state( orthogonal_position_type position, state_base_type * pInnerState ) { BOOST_ASSERT( ( position < OrthogonalRegionCount::value ) && ( pInnerStates[ position ] == 0 ) ); pInnerStates[ position ] = pInnerState; } void remove_inner_state( orthogonal_position_type position ) { BOOST_ASSERT( position < OrthogonalRegionCount::value ); pInnerStates[ position ] = 0; } virtual void remove_from_state_list( typename state_base_type::state_list_type::iterator & statesEnd, typename state_base_type::node_state_base_ptr_type & pOutermostUnstableState, bool performFullExit ) { state_base_type ** const pPastEnd = &pInnerStates[ OrthogonalRegionCount::value ]; // We must not iterate past the last inner state because *this* state // will no longer exist when the last inner state has been removed state_base_type ** const pFirstNonNull = std::find_if( &pInnerStates[ 0 ], pPastEnd, &node_state::is_not_null ); if ( pFirstNonNull == pPastEnd ) { // The state does not have inner states but is still alive, this must // be the outermost unstable state then. BOOST_ASSERT( get_pointer( pOutermostUnstableState ) == this ); typename state_base_type::node_state_base_ptr_type pSelf = pOutermostUnstableState; pSelf->exit_impl( pSelf, pOutermostUnstableState, performFullExit ); } else { // Destroy inner states in the reverse order of construction for ( state_base_type ** pState = pPastEnd; pState != pFirstNonNull; ) { --pState; // An inner orthogonal state might have been terminated long before, // that's why we have to check for 0 pointers if ( *pState != 0 ) { ( *pState )->remove_from_state_list( statesEnd, pOutermostUnstableState, performFullExit ); } } } } typedef typename base_type::direct_state_base_ptr_type direct_state_base_ptr_type; private: ////////////////////////////////////////////////////////////////////////// static bool is_not_null( const state_base_type * pInner ) { return pInner != 0; } state_base_type * pInnerStates[ OrthogonalRegionCount::value ]; }; } // namespace detail } // namespace statechart } // namespace boost #endif
node_state.hpp
Page URL
File URL
Prev
6/8
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.