| Report problems to ATLAS LXR Team (with time and IP address indicated) |
|
[ source navigation ] [ diff markup ] [ identifier search ] [ general search ] |
||||
|
||||||
| Links to LXR source navigation pages for stable releases | [ 12.*.* ] [ 13.*.* ] [ 14.*.* ] | |||||
001 // (C) Copyright Gennadiy Rozental 2004-2005. 002 // Distributed under the Boost Software License, Version 1.0. 003 // (See accompanying file LICENSE_1_0.txt or copy at 004 // http://www.boost.org/LICENSE_1_0.txt) 005 006 // See http://www.boost.org/libs/test for the library home page. 007 // 008 // File : $RCSfile: input_iterator_facade.hpp,v $ 009 // 010 // Version : $Revision: 1.5 $ 011 // 012 // Description : Input iterator facade 013 // *************************************************************************** 014 015 #ifndef BOOST_INPUT_ITERATOR_FACADE_HPP_071894GER 016 #define BOOST_INPUT_ITERATOR_FACADE_HPP_071894GER 017 018 // Boost 019 #include <boost/iterator/iterator_facade.hpp> 020 021 #include <boost/test/detail/suppress_warnings.hpp> 022 023 //____________________________________________________________________________// 024 025 namespace boost { 026 027 namespace unit_test { 028 029 // ************************************************************************** // 030 // ************** input_iterator_core_access ************** // 031 // ************************************************************************** // 032 033 class input_iterator_core_access 034 { 035 #if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) 036 public: 037 #else 038 template <class I, class V, class R, class TC> friend class input_iterator_facade; 039 #endif 040 041 template <class Facade> 042 static bool get( Facade& f ) 043 { 044 return f.get(); 045 } 046 047 private: 048 // objects of this class are useless 049 input_iterator_core_access(); //undefined 050 }; 051 052 // ************************************************************************** // 053 // ************** input_iterator_facade ************** // 054 // ************************************************************************** // 055 056 template<typename Derived, 057 typename ValueType, 058 typename Reference = ValueType const&, 059 typename Traversal = single_pass_traversal_tag> 060 class input_iterator_facade : public iterator_facade<Derived,ValueType,Traversal,Reference> 061 { 062 public: 063 // Constructor 064 input_iterator_facade() : m_valid( false ), m_value() {} 065 066 protected: // provide access to the Derived 067 void init() 068 { 069 m_valid = true; 070 increment(); 071 } 072 073 // Data members 074 mutable bool m_valid; 075 ValueType m_value; 076 077 private: 078 friend class boost::iterator_core_access; 079 080 // iterator facade interface implementation 081 void increment() 082 { 083 // we make post-end incrementation indefinetly safe 084 if( m_valid ) 085 m_valid = input_iterator_core_access::get( *static_cast<Derived*>(this) ); 086 } 087 Reference dereference() const 088 { 089 return m_value; 090 } 091 092 // iterator facade interface implementation 093 bool equal( input_iterator_facade const& rhs ) const 094 { 095 // two invalid iterator equals, inequal otherwise 096 return !m_valid && !rhs.m_valid; 097 } 098 }; 099 100 } // namespace unit_test 101 102 } // namespace boost 103 104 //____________________________________________________________________________// 105 106 #include <boost/test/detail/enable_warnings.hpp> 107 108 // *************************************************************************** 109 // Revision History : 110 // 111 // $Log: input_iterator_facade.hpp,v $ 112 // Revision 1.5 2005/05/08 08:55:09 rogeeff 113 // typos and missing descriptions fixed 114 // 115 // Revision 1.4 2005/04/12 06:47:46 rogeeff 116 // help iterator copying 117 // 118 // Revision 1.3 2005/02/20 08:27:09 rogeeff 119 // This a major update for Boost.Test framework. See release docs for complete list of fixes/updates 120 // 121 // Revision 1.2 2005/02/01 06:40:08 rogeeff 122 // copyright update 123 // old log entries removed 124 // minor stilistic changes 125 // depricated tools removed 126 // 127 // Revision 1.1 2005/01/22 18:21:40 rogeeff 128 // moved sharable staff into utils 129 // 130 // *************************************************************************** 131 132 #endif // BOOST_INPUT_ITERATOR_FACADE_HPP_071894GER 133
| [ source navigation ] | [ diff markup ] | [ identifier search ] | [ general search ] |
| Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems | |
| This page was automatically generated by the LXR engine. |
|