00001 00002 // 00003 // This file is part of Common Text Transformation Library. 00004 // Copyright (C) 1997-2009 by Igor Kholodov. 00005 // 00006 // Common Text Transformation Library is free software: you can 00007 // redistribute it and/or modify it under the terms of the 00008 // GNU Lesser General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // Common Text Transformation Library is distributed in the hope 00013 // that it will be useful, but WITHOUT ANY WARRANTY; without even 00014 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00015 // PURPOSE. See the GNU Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with Common Text Transformation Library. 00019 // If not, see <http://www.gnu.org/licenses/>. 00020 // 00021 // mailto:cttl@users.sourceforge.net 00022 // http://cttl.sourceforge.net/ 00023 // http://sourceforge.net/projects/cttl/ 00024 // 00026 00037 // xst_iterator_writer.h 00038 00039 #ifndef _XST_ITERATOR_WRITER_H_INCLUDED_ 00040 #define _XST_ITERATOR_WRITER_H_INCLUDED_ 00041 00042 namespace cttl_impl { 00043 00052 template< typename OutputIteratorT > 00053 class xst_iterator_writer 00054 { 00055 private: 00057 OutputIteratorT& m_iterator; 00058 00059 public: 00061 xst_iterator_writer( OutputIteratorT& iterator_ ) 00062 : 00063 m_iterator( iterator_ ) 00064 { 00065 } 00066 00067 private: 00069 xst_iterator_writer< OutputIteratorT >& operator=( xst_iterator_writer< OutputIteratorT > const& ); 00070 00071 public: 00078 template< typename TerminalT > 00079 void operator() ( TerminalT const& terminal_ ) 00080 { 00081 *m_iterator = terminal_.top( const_scalar( 0 ) ); 00082 ++m_iterator; 00083 } 00084 00085 }; // struct xst_iterator_writer 00086 00087 } // namespace cttl_impl 00088 00089 #endif // _XST_ITERATOR_WRITER_H_INCLUDED_