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 Jeremy Siek 2002. // 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_ITERATOR_ARCHETYPES_HPP #define BOOST_ITERATOR_ARCHETYPES_HPP #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { template
struct access_archetype; template
struct traversal_archetype; namespace iterator_archetypes { enum { readable_iterator_bit = 1 , writable_iterator_bit = 2 , swappable_iterator_bit = 4 , lvalue_iterator_bit = 8 }; // Not quite tags, since dispatching wouldn't work. typedef mpl::int_
::type readable_iterator_t; typedef mpl::int_
::type writable_iterator_t; typedef mpl::int_< (readable_iterator_bit|writable_iterator_bit) >::type readable_writable_iterator_t; typedef mpl::int_< (readable_iterator_bit|lvalue_iterator_bit) >::type readable_lvalue_iterator_t; typedef mpl::int_< (lvalue_iterator_bit|writable_iterator_bit) >::type writable_lvalue_iterator_t; typedef mpl::int_
::type swappable_iterator_t; typedef mpl::int_
::type lvalue_iterator_t; template
struct has_access : mpl::equal_to< mpl::bitand_
, Base > {}; } namespace detail { template
struct assign_proxy { assign_proxy& operator=(T) { return *this; } }; template
struct read_proxy { operator T() { return static_object
::get(); } }; template
struct read_write_proxy : read_proxy
// Use to inherit from assign_proxy, but that doesn't work. -JGS { read_write_proxy& operator=(T) { return *this; } }; template
struct arrow_proxy { T const* operator->() const { return 0; } }; struct no_operator_brackets {}; template
struct readable_operator_brackets { read_proxy
operator[](std::ptrdiff_t n) const { return read_proxy
(); } }; template
struct writable_operator_brackets { read_write_proxy
operator[](std::ptrdiff_t n) const { return read_write_proxy
(); } }; template
struct operator_brackets : mpl::aux::msvc_eti_base< typename mpl::eval_if< is_convertible
, mpl::eval_if< iterator_archetypes::has_access< AccessCategory , iterator_archetypes::writable_iterator_t > , mpl::identity
> , mpl::if_< iterator_archetypes::has_access< AccessCategory , iterator_archetypes::readable_iterator_t > , readable_operator_brackets
, no_operator_brackets > > , mpl::identity
>::type >::type {}; template
struct traversal_archetype_impl { template
struct archetype; }; // Constructor argument for those iterators that // are not default constructible struct ctor_arg {}; template
struct traversal_archetype_ : mpl::aux::msvc_eti_base< typename traversal_archetype_impl
::template archetype
>::type { typedef typename traversal_archetype_impl
::template archetype
base; traversal_archetype_() {} traversal_archetype_(ctor_arg arg) : base(arg) {} }; template <> struct traversal_archetype_impl
{ template
struct archetype { explicit archetype(ctor_arg) {} struct bogus { }; // This use to be void, but that causes trouble for iterator_facade. Need more research. -JGS typedef bogus difference_type; Derived& operator++() { return (Derived&)static_object
::get(); } Derived operator++(int) const { return (Derived&)static_object
::get(); } }; }; template <> struct traversal_archetype_impl
{ template
struct archetype : public equality_comparable< traversal_archetype_
>, public traversal_archetype_
{ explicit archetype(ctor_arg arg) : traversal_archetype_
(arg) {} typedef std::ptrdiff_t difference_type; }; }; template
bool operator==(traversal_archetype_
const&, traversal_archetype_
const&) { return true; } #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) // doesn't seem to pick up != from equality_comparable template
bool operator!=(traversal_archetype_
const&, traversal_archetype_
const&) { return true; } #endif template <> struct traversal_archetype_impl
{ template
struct archetype : public traversal_archetype_
{ archetype() : traversal_archetype_
(ctor_arg()) {} }; }; template <> struct traversal_archetype_impl
{ template
struct archetype : public traversal_archetype_
{ Derived& operator--() { return static_object
::get(); } Derived operator--(int) const { return static_object
::get(); } }; }; template <> struct traversal_archetype_impl
{ template
struct archetype : public traversal_archetype_
{ Derived& operator+=(std::ptrdiff_t) { return static_object
::get(); } Derived& operator-=(std::ptrdiff_t) { return static_object
::get(); } }; }; template
Derived& operator+(traversal_archetype_
const&, std::ptrdiff_t) { return static_object
::get(); } template
Derived& operator+(std::ptrdiff_t, traversal_archetype_
const&) { return static_object
::get(); } template
Derived& operator-(traversal_archetype_
const&, std::ptrdiff_t) { return static_object
::get(); } template
std::ptrdiff_t operator-(traversal_archetype_
const&, traversal_archetype_
const&) { return 0; } template
bool operator<(traversal_archetype_
const&, traversal_archetype_
const&) { return true; } template
bool operator>(traversal_archetype_
const&, traversal_archetype_
const&) { return true; } template
bool operator<=(traversal_archetype_
const&, traversal_archetype_
const&) { return true; } template
bool operator>=(traversal_archetype_
const&, traversal_archetype_
const&) { return true; } struct bogus_type; template
struct convertible_type : mpl::if_< is_const
, typename remove_const
::type, bogus_type > {}; } // namespace detail template
struct undefined; template
struct iterator_access_archetype_impl { template
struct archetype; }; template
struct iterator_access_archetype : mpl::aux::msvc_eti_base< typename iterator_access_archetype_impl< AccessCategory >::template archetype
>::type { }; template <> struct iterator_access_archetype_impl< iterator_archetypes::readable_iterator_t > { template
struct archetype { typedef typename remove_cv
::type value_type; typedef Value reference; typedef Value* pointer; value_type operator*() const { return static_object
::get(); } detail::arrow_proxy
operator->() const { return detail::arrow_proxy
(); } }; }; template <> struct iterator_access_archetype_impl< iterator_archetypes::writable_iterator_t > { template
struct archetype { # if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) BOOST_STATIC_ASSERT(!is_const
::value); # endif typedef void value_type; typedef void reference; typedef void pointer; detail::assign_proxy
operator*() const { return detail::assign_proxy
(); } }; }; template <> struct iterator_access_archetype_impl< iterator_archetypes::readable_writable_iterator_t > { template
struct archetype : public virtual iterator_access_archetype< Value, iterator_archetypes::readable_iterator_t > { typedef detail::read_write_proxy
reference; detail::read_write_proxy
operator*() const { return detail::read_write_proxy
(); } }; }; template <> struct iterator_access_archetype_impl
{ template
struct archetype : public virtual iterator_access_archetype< Value, iterator_archetypes::readable_iterator_t > { typedef Value& reference; Value& operator*() const { return static_object
::get(); } Value* operator->() const { return 0; } }; }; template <> struct iterator_access_archetype_impl
{ template
struct archetype : public virtual iterator_access_archetype< Value, iterator_archetypes::readable_lvalue_iterator_t > { # if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) BOOST_STATIC_ASSERT((!is_const
::value)); # endif }; }; template
struct iterator_archetype; template
struct traversal_archetype_base : detail::operator_brackets< typename remove_cv
::type , AccessCategory , TraversalCategory > , detail::traversal_archetype_< iterator_archetype
, Value , TraversalCategory > { }; namespace detail { template
struct iterator_archetype_base : iterator_access_archetype
, traversal_archetype_base
{ typedef iterator_access_archetype
access; typedef typename detail::facade_iterator_category< TraversalCategory , typename mpl::eval_if< iterator_archetypes::has_access< AccessCategory, iterator_archetypes::writable_iterator_t > , remove_const
, add_const
>::type , typename access::reference >::type iterator_category; // Needed for some broken libraries (see below) typedef boost::iterator< iterator_category , Value , typename traversal_archetype_base< Value, AccessCategory, TraversalCategory >::difference_type , typename access::pointer , typename access::reference > workaround_iterator_base; }; } template
struct iterator_archetype : public detail::iterator_archetype_base
// These broken libraries require derivation from std::iterator // (or related magic) in order to handle iter_swap and other // iterator operations # if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, < 310) \ || BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(0x20101)) , public detail::iterator_archetype_base< Value, AccessCategory, TraversalCategory >::workaround_iterator_base # endif { // Derivation from std::iterator above caused references to nested // types to be ambiguous, so now we have to redeclare them all // here. # if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, < 310) \ || BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(0x20101)) typedef detail::iterator_archetype_base< Value,AccessCategory,TraversalCategory > base; typedef typename base::value_type value_type; typedef typename base::reference reference; typedef typename base::pointer pointer; typedef typename base::difference_type difference_type; typedef typename base::iterator_category iterator_category; # endif iterator_archetype() { } iterator_archetype(iterator_archetype const& x) : detail::iterator_archetype_base< Value , AccessCategory , TraversalCategory >(x) {} iterator_archetype& operator=(iterator_archetype const&) { return *this; } # if 0 // Optional conversion from mutable iterator_archetype( iterator_archetype< typename detail::convertible_type
::type , AccessCategory , TraversalCategory> const& ); # endif }; } // namespace boost #endif // BOOST_ITERATOR_ARCHETYPES_HPP
iterator_archetypes.hpp
Page URL
File URL
Prev
8/17
Next
Download
( 16 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.