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
// (C) Copyright Gennadiy Rozental 2001-2007. // 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/test for the library home page. // // File : $RCSfile$ // // Version : $Revision: 41369 $ // // Description : fixed sized mapping with specified invalid value // *************************************************************************** #ifndef BOOST_TEST_FIXED_MAPPING_HPP_071894GER #define BOOST_TEST_FIXED_MAPPING_HPP_071894GER // Boost #include
#include
#include
#include
// STL #include
#include
#include
#include
#include
//____________________________________________________________________________// namespace boost { namespace unit_test { // configurable maximum fixed sized mapping size supported by this header. // You could redefine it before inclusion of this file. #ifndef MAX_MAP_SIZE #define MAX_MAP_SIZE 20 #endif #define CONSTR_DECL_MID( z, i, dummy1 ) key_param_type key##i, value_param_type v##i, #define CONSTR_BODY_MID( z, i, dummy1 ) add_pair( key##i, v##i ); #define CONSTR_DECL( z, n, dummy1 ) \ fixed_mapping( BOOST_PP_REPEAT_ ## z( n, CONSTR_DECL_MID, "" ) \ value_param_type invalid_value ) \ : m_invalid_value( invalid_value ) \ { \ BOOST_PP_REPEAT_ ## z( n, CONSTR_BODY_MID, "" ) \ init(); \ } \ /**/ #define CONTRUCTORS( n ) BOOST_PP_REPEAT( n, CONSTR_DECL, "" ) template
> class fixed_mapping { typedef std::pair
elem_type; typedef std::vector
map_type; typedef typename std::vector
::const_iterator iterator; typedef typename call_traits
::param_type key_param_type; typedef typename call_traits
::param_type value_param_type; typedef typename call_traits
::const_reference value_ref_type; #if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) struct p1; friend struct p1; struct p2; friend struct p2; #endif // bind( Compare(), bind(select1st
(), _1), bind(identity
(), _2) ) struct p1 : public std::binary_function
{ bool operator()( elem_type const& x, Key const& y ) const { return Compare()( x.first, y ); } }; // bind( Compare(), bind(select1st
(), _1), bind(select1st
(), _2) ) struct p2 : public std::binary_function
{ bool operator()( elem_type const& x, elem_type const& y ) const { return Compare()( x.first, y.first ); } }; public: // Constructors CONTRUCTORS( BOOST_PP_ADD( MAX_MAP_SIZE, 1 ) ) // key -> value access value_ref_type operator[]( key_param_type key ) const { iterator it = boost::detail::lower_bound( m_map.begin(), m_map.end(), key, p1() ); return (it == m_map.end() || Compare()( key, it->first ) ) ? m_invalid_value : it->second; } private: // Implementation void init() { std::sort( m_map.begin(), m_map.end(), p2() ); } void add_pair( key_param_type key, value_param_type value ) { m_map.push_back( elem_type( key, value ) ); } // Data members Value m_invalid_value; map_type m_map; }; } // namespace unit_test } // namespace boost //____________________________________________________________________________// #include
#undef MAX_MAP_SIZE #undef CONSTR_DECL_MID #undef CONSTR_BODY_MID #undef CONSTR_DECL #undef CONTRUCTORS #endif // BOOST_TEST_FIXED_MAPPING_HPP_071894GER
fixed_mapping.hpp
Page URL
File URL
Prev
6/13
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.