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
// Boost.Bimap // // Copyright (c) 2006-2007 Matias Capeletto // // 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) /// \file container_adaptor/container_adaptor.hpp /// \brief Container adaptor to build a type that is compliant to the concept of a container. #ifndef BOOST_BIMAP_CONTAINER_ADAPTOR_CONTAINER_ADAPTOR_HPP #define BOOST_BIMAP_CONTAINER_ADAPTOR_CONTAINER_ADAPTOR_HPP #if defined(_MSC_VER) && (_MSC_VER>=1200) #pragma once #endif #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace bimaps { /// \brief Container Adaptor toolbox, easy way to build new containers from existing ones. namespace container_adaptor { /// \brief Container adaptor to build a type that is compliant to the concept of a container. template < class Base, class Iterator, class ConstIterator, class IteratorToBaseConverter = ::boost::mpl::na, class IteratorFromBaseConverter = ::boost::mpl::na, class ValueToBaseConverter = ::boost::mpl::na, class ValueFromBaseConverter = ::boost::mpl::na, class FunctorsFromDerivedClasses = mpl::vector<> > class container_adaptor { // MetaData ------------------------------------------------------------- public: typedef Iterator iterator; typedef ConstIterator const_iterator; typedef BOOST_DEDUCED_TYPENAME iterator_value < iterator >::type value_type; typedef BOOST_DEDUCED_TYPENAME iterator_pointer < iterator >::type pointer; typedef BOOST_DEDUCED_TYPENAME iterator_reference< iterator >::type reference; typedef BOOST_DEDUCED_TYPENAME iterator_reference< const_iterator >::type const_reference; typedef BOOST_DEDUCED_TYPENAME Base::size_type size_type; typedef BOOST_DEDUCED_TYPENAME Base::difference_type difference_type; typedef BOOST_DEDUCED_TYPENAME mpl::if_< ::boost::mpl::is_na
, // { ::boost::bimaps::container_adaptor::detail:: iterator_to_base_identity < BOOST_DEDUCED_TYPENAME Base::iterator , iterator, BOOST_DEDUCED_TYPENAME Base::const_iterator , const_iterator >, // } // else // { IteratorToBaseConverter // } >::type iterator_to_base; typedef BOOST_DEDUCED_TYPENAME mpl::if_< ::boost::mpl::is_na
, // { ::boost::bimaps::container_adaptor::detail:: iterator_from_base_identity < BOOST_DEDUCED_TYPENAME Base::iterator , iterator, BOOST_DEDUCED_TYPENAME Base::const_iterator , const_iterator >, // } // else // { IteratorFromBaseConverter // } >::type iterator_from_base; typedef BOOST_DEDUCED_TYPENAME mpl::if_< ::boost::mpl::is_na
, // { ::boost::bimaps::container_adaptor::detail:: value_to_base_identity < BOOST_DEDUCED_TYPENAME Base::value_type, value_type >, // } // else // { ValueToBaseConverter // } >::type value_to_base; typedef BOOST_DEDUCED_TYPENAME mpl::if_< ::boost::mpl::is_na
, // { ::boost::bimaps::container_adaptor::detail:: value_from_base_identity < BOOST_DEDUCED_TYPENAME Base::value_type, value_type >, // } // else // { ValueFromBaseConverter // } >::type value_from_base; // ACCESS ----------------------------------------------------------------- public: explicit container_adaptor(Base & c) : dwfb(c) {} protected: typedef Base base_type; typedef container_adaptor container_adaptor_; const Base & base() const { return dwfb.data; } Base & base() { return dwfb.data; } // Interface -------------------------------------------------------------- public: size_type size() const { return base().size(); } size_type max_size() const { return base().max_size(); } bool empty() const { return base().empty(); } iterator begin() { return this->template functor
()( base().begin() ); } iterator end() { return this->template functor
()( base().end() ); } const_iterator begin() const { return this->template functor
()( base().begin() ); } const_iterator end() const { return this->template functor
()( base().end() ); } iterator erase(iterator pos) { return this->template functor
()( base().erase(this->template functor
()(pos)) ); } iterator erase(iterator first, iterator last) { return this->template functor
()( base().erase( this->template functor
()(first), this->template functor
()(last) ) ); } void clear() { base().clear(); } template< class InputIterator > void insert(InputIterator iterBegin, InputIterator iterEnd) { for( ; iterBegin != iterEnd ; ++iterBegin ) { base().insert( this->template functor
()( *iterBegin ) ); } } std::pair
insert( BOOST_DEDUCED_TYPENAME ::boost::call_traits< value_type >::param_type x) { std::pair< BOOST_DEDUCED_TYPENAME Base::iterator, bool > r( base().insert( this->template functor
()(x) ) ); return std::pair
( this->template functor
()(r.first),r.second ); } iterator insert(iterator pos, BOOST_DEDUCED_TYPENAME ::boost::call_traits< value_type >::param_type x) { return this->template functor
()( base().insert( this->template functor
()(pos), this->template functor
()(x)) ); } void swap( container_adaptor & c ) { base().swap( c.base() ); } // Access to functors ---------------------------------------------------- protected: template< class Functor > Functor & functor() { return dwfb.template functor
(); } template< class Functor > Functor const & functor() const { return dwfb.template functor
(); } // Data ------------------------------------------------------------------ private: ::boost::bimaps::container_adaptor::detail::data_with_functor_bag < Base &, BOOST_DEDUCED_TYPENAME mpl::copy < mpl::vector < iterator_to_base, iterator_from_base, value_to_base, value_from_base >, mpl::front_inserter< FunctorsFromDerivedClasses > >::type > dwfb; }; } // namespace container_adaptor } // namespace bimaps } // namespace boost #endif // BOOST_BIMAP_CONTAINER_ADAPTOR_CONTAINER_ADAPTOR_HPP
container_adaptor.hpp
Page URL
File URL
Prev
2/17
Next
Download
( 8 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.