[/ Copyright 2010 Neil Groves 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) /] [def __mfc_collections__ [@http://msdn.microsoft.com/en-us/library/942860sh.aspx MFC Collection Classes]] [def __atl_collections__ [@http://msdn.microsoft.com/en-us/library/15e672bd.aspx ATL Collection Classes]] [section:mfc_atl MFC/ATL (courtesy of Shunsuke Sogame)] [h4 Introduction] This implementation was kindly donated by Shunsuke Sogame. This header adapts MFC and ATL containers to the appropriate Range concepts. [table [] [[[*Author:]] [Shunsuke Sogame]] [[[*Contact:]] [mb2act@yahoo.co.jp]] [[[*Date:]] [26th of May 2006]] [[[*Copyright:]] [Shunsuke Sogame 2005-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0]] ] [h4 Overview] Boost.Range MFC/ATL Extension provides Boost.Range support for MFC/ATL collection and string types. `` CTypedPtrArray *> myArray; ... BOOST_FOREACH (CList *theList, myArray) { BOOST_FOREACH (CString& str, *theList) { boost::to_upper(str); std::sort(boost::begin(str), boost::end(str)); ... } } `` [section:requirements Requirements] * Boost C++ Libraries Version 1.34.0 or later (no compilation required) * Visual C++ 7.1 or later (for MFC and ATL) [endsect] [section:mfc_ranges MFC Ranges] If the `` is included before or after Boost.Range headers, the MFC collections and strings become models of Range. The table below lists the Traversal Category and `range_reference` of MFC ranges. [table [[Range] [Traversal Category] [`range_reference::type`]] [[`CArray`] [__random_access_range__] [`T&`]] [[`CList`] [__bidirectional_range__] [`T&`]] [[`CMap`] [__forward_range__] [`Range::CPair&`]] [[`CTypedPtrArray`] [__random_access_range__] [`T* const`]] [[`CTypedPtrList`] [__bidirectional_range__] [`T* const`]] [[`CTypedPtrMap`] [__forward_range__] [`std::pair const`]] [[`CByteArray`] [__random_access_range__] [`BYTE&`]] [[`CDWordArray`] [__random_access_range__] [`DWORD&`]] [[`CObArray`] [__random_access_range__] [`CObject*&`]] [[`CPtrArray`] [__random_access_range__] [`void*&`]] [[`CStringArray`] [__random_access_range__] [`CString&`]] [[`CUIntArray`] [__random_access_range__] [`UINT&`]] [[`CWordArray`] [__random_access_range__] [`WORD&`]] [[`CObList`] [__bidirectional_range__] [`CObject*&`]] [[`CPtrList`] [__bidirectional_range__] [`void*&`]] [[`CStringList`] [__bidirectional_range__] [`CString&`]] [[`CMapPtrToWord`] [__forward_range__] [`std::pair const`]] [[`CMapPtrToPtr`] [__forward_range__] [`std::pair const`]] [[`CMapStringToOb`] [__forward_range__] [`std::pair const`]] [[`CMapStringToString`] [__forward_range__] [`Range::CPair&`]] [[`CMapWordToOb`] [__forward_range__] [`std::pair const`]] [[`CMapWordToPtr`] [__forward_range__] [`std::pair const`]] ] Other Boost.Range metafunctions are defined by the following. Let `Range` be any type listed above and `Ref` be the same as `range_reference::type`. `range_value::type` is the same as `remove_reference::type>::type`, `range_difference::type` is the same as `std::ptrdiff_t`, and `range_pointer::type` is the same as `add_pointer::type>::type`. As for `const Range`, see below. Adam Walling has provided the header `` to add support for the map adaptor with MFC map types. [endsect] [section:atl_ranges ATL Ranges] If the `` is included before or after Boost.Range headers, the ATL collections and strings become models of Range. The table below lists the Traversal Category and `range_reference` of ATL ranges. [table [[Range] [Traversal Category] [`range_reference::type`]] [[`CAtlArray`] [__random_access_range__] [`E&`]] [[`CAutoPtrArray`] [__random_access_range__] [`E&`]] [[`CInterfaceArray`] [__random_access_range__] [`CComQIPtr&`]] [[`CAtlList`] [__bidirectional_range__] [`E&`]] [[`CAutoPtrList`] [__bidirectional_range__] [`E&`]] [[`CHeapPtrList`] [__bidirectional_range__] [`E&`]] [[`CInterfaceList`] [__bidirectional_range__] [`CComQIPtr&`]] [[`CAtlMap`] [__forward_range__] [`Range::CPair&`]] [[`CRBTree`] [__bidirectional_range__] [`Range::CPair&`]] [[`CRBMap`] [__bidirectional_range__] [`Range::CPair&`]] [[`CRBMultiMap`] [__bidirectional_range__] [`Range::CPair&`]] [[`CSimpleStringT`] [__random_access_range__] [`B&`]] [[`CStringT`] [__random_access_range__] [`B&`]] [[`CFixedStringT`] [__random_access_range__] [`range_reference::type`]] [[`CComBSTR`] [__random_access_range__] [`OLECHAR&`]] [[`CSimpleArray`] [__random_access_range__] [`T&`]] ] Other __boost_range_home__ metafunctions are defined by the following. Let `Range` be any type listed above and `Ref` be the same as `range_reference::type`. `range_value::type` is the same as `remove_reference::type`, `range_difference::type` is the same as `std::ptrdiff_t`, and `range_pointer::type` is the same as `add_pointer::type>::type`. As for `const Range`, see below. [endsect] [section:const_ranges const Ranges] `range_reference::type` is defined by the following algorithm. Let `Range` be any type listed above and `Ref` be the same as `range_reference::type`. `` if (Range is CObArray || Range is CObList) return CObject const * & else if (Range is CPtrArray || Range is CPtrList) return void const * & else if (there is a type X such that X& is the same as Ref) return X const & else if (there is a type X such that X* const is the same as Ref) return X const * const else return Ref `` Other Boost.Range metafunctions are defined by the following. [table [[Range metafunction] [Result]] [[`range_value::type`] [`range_value::type`]] [[`range_difference::type`] [`std::ptrdiff_t`]] [[`range_pointer::type`] [`add_pointer::type>::type>::type`]] ] [endsect] [section:references References] # __boost_range_home__ # __mfc_collections__ # __atl_collections__ [endsect] [endsect]