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 2003-2005 Joaqu�n M L�pez Mu�oz. * 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/multi_index for library home page. */ #ifndef BOOST_MULTI_INDEX_DETAIL_INDEX_SAVER_HPP #define BOOST_MULTI_INDEX_DETAIL_INDEX_SAVER_HPP #if defined(_MSC_VER)&&(_MSC_VER>=1200) #pragma once #endif #include
/* keep it first to prevent nasty warns in MSVC */ #include
#include
#include
#include
namespace boost{ namespace multi_index{ namespace detail{ /* index_saver accepts a base sequence of previously saved elements * and saves a possibly reordered subsequence in an efficient manner, * serializing only the information needed to rearrange the subsequence * based on the original order of the base. * multi_index_container is in charge of supplying the info about the * base sequence, and each index can subsequently save itself using the * const interface of index_saver. */ template
class index_saver:private noncopyable { public: index_saver(const Allocator& al,std::size_t size):alg(al,size){} template
void add(Node* node,Archive& ar,const unsigned int) { ar<
void add_track(Node* node,Archive& ar,const unsigned int) { ar<
void save( IndexIterator first,IndexIterator last,Archive& ar, const unsigned int)const { /* calculate ordered positions */ alg.execute(first,last); /* Given a consecutive subsequence of displaced elements * x1,...,xn, the following information is serialized: * * p0,p1,...,pn,0 * * where pi is a pointer to xi and p0 is a pointer to the element * preceding x1. Crealy, from this information is possible to * restore the original order on loading time. If x1 is the first * element in the sequence, the following is serialized instead: * * p1,p1,...,pn,0 * * For each subsequence of n elements, n+2 pointers are serialized. * An optimization policy is applied: consider for instance the * sequence * * a,B,c,D * * where B and D are displaced, but c is in its correct position. * Applying the schema described above we would serialize 6 pointers: * * p(a),p(B),0 * p(c),p(D),0 * * but this can be reduced to 5 pointers by treating c as a displaced * element: * * p(a),p(B),p(c),p(D),0 */ std::size_t last_saved=3; /* distance to last pointer saved */ for(IndexIterator it=first,prev=first;it!=last;prev=it++,++last_saved){ if(!alg.is_ordered(get_node(it))){ if(last_saved>1)save_node(get_node(prev),ar); save_node(get_node(it),ar); last_saved=0; } else if(last_saved==2)save_node(null_node(),ar); } if(last_saved<=2)save_node(null_node(),ar); /* marks the end of the serialization info for [first,last) */ save_node(null_node(),ar); } private: template
static Node* get_node(IndexIterator it) { return it.get_node(); } static Node* null_node(){return 0;} template
static void save_node(Node* node,Archive& ar) { ar<
alg; }; } /* namespace multi_index::detail */ } /* namespace multi_index */ } /* namespace boost */ #endif
index_saver.hpp
Page URL
File URL
Prev
20/44
Next
Download
( 3 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.