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
// //======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek // // 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_MUTABLE_QUEUE_HPP #define BOOST_MUTABLE_QUEUE_HPP #include
#include
#include
#include
#include
#include
#include
#include
namespace boost { // The mutable queue whose elements are indexed // // This adaptor provides a special kind of priority queue that has // and update operation. This allows the ordering of the items to // change. After the ordering criteria for item x changes, one must // call the Q.update(x) // // In order to efficiently find x in the queue, a functor must be // provided to map value_type to a unique ID, which the // mutable_queue will then use to map to the location of the // item. The ID's generated must be between 0 and N, where N is the // value passed to the constructor of mutable_queue template
, class Comp = std::less
, class ID = identity_property_map > class mutable_queue { public: typedef IndexedType value_type; typedef typename RandomAccessContainer::size_type size_type; protected: typedef typename RandomAccessContainer::iterator iterator; #if !defined BOOST_NO_STD_ITERATOR_TRAITS typedef adstl::array_binary_tree_node
Node; #else typedef adstl::array_binary_tree_node
Node; #endif typedef adstl::compare_array_node
Compare; typedef std::vector
IndexArray; public: typedef Compare value_compare; typedef ID id_generator; mutable_queue(size_type n, const Comp& x, const ID& _id) : index_array(n), comp(x), id(_id) { c.reserve(n); } template
mutable_queue(ForwardIterator first, ForwardIterator last, const Comp& x, const ID& _id) : index_array(std::distance(first, last)), comp(x), id(_id) { while( first != last ) { push(*first); ++first; } } bool empty() const { return c.empty(); } void pop() { value_type tmp = c.back(); c.back() = c.front(); c.front() = tmp; size_type id_f = get(id, c.back()); size_type id_b = get(id, tmp); size_type i = index_array[ id_b ]; index_array[ id_b ] = index_array[ id_f ]; index_array[ id_f ] = i; c.pop_back(); Node node(c.begin(), c.end(), c.begin(), id); down_heap(node, comp, index_array); } void push(const IndexedType& x) { c.push_back(x); /*set index-array*/ index_array[ get(id, x) ] = c.size()-1; Node node(c.begin(), c.end(), c.end() - 1, id); up_heap(node, comp, index_array); } void update(const IndexedType& x) { size_type current_pos = index_array[ get(id, x) ]; c[current_pos] = x; Node node(c.begin(), c.end(), c.begin()+current_pos, id); update_heap(node, comp, index_array); } value_type& front() { return c.front(); } value_type& top() { return c.front(); } const value_type& front() const { return c.front(); } const value_type& top() const { return c.front(); } size_type size() const { return c.size(); } void clear() { c.clear(); } #if 0 // dwa 2003/7/11 - I don't know what compiler is supposed to // be able to compile this, but is_heap is not standard!! bool test() { return std::is_heap(c.begin(), c.end(), Comp()); } #endif protected: IndexArray index_array; Compare comp; RandomAccessContainer c; ID id; }; } #endif // BOOST_MUTABLE_QUEUE_HPP
mutable_queue.hpp
Page URL
File URL
Prev
16/21
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.