Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

node_functors.h

Go to the documentation of this file.
00001 
00002 // Common Text Transformation Library
00003 // Copyright (C) 1997-2006 by Igor Kholodov. 
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the
00017 // Free Software Foundation, Inc.,
00018 // 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019 //
00020 // mailto:cttl@users.sourceforge.net
00021 // http://sourceforge.net/projects/cttl/
00023 
00032 // node_functors.h
00033 
00034 #ifndef _CTTL_NODE_FUNCTORS_H_INCLUDED_
00035 #define _CTTL_NODE_FUNCTORS_H_INCLUDED_
00036 
00037 #include "node.h"
00038 
00039 namespace cttl {
00040 
00041 
00053 template< typename StringT = CTTL_STD_STRING >
00054 struct node_insert_go : public std::unary_function< node< StringT >, void >
00055 {
00057     node_insert_go( StringT const& str_ )
00058         :
00059         m_str( str_ )
00060     {}
00061     
00072     void operator() ( node< StringT >& node_ )
00073     {
00074         node_.insert_go( m_str );
00075     }
00076     
00078     StringT m_str;
00079 };
00080 
00092 template< typename StringT = CTTL_STD_STRING >
00093 struct node_insert_stay : public std::unary_function< node< StringT >, void >
00094 {
00096     node_insert_stay( StringT const& str_ )
00097         :
00098         m_str( str_ )
00099     {}
00100     
00110     void operator() ( node< StringT >& node_ )
00111     {
00112         node_.insert_stay( m_str );
00113     }
00114     
00116     StringT m_str;
00117 };
00118 
00119 
00120 }   // namespace cttl
00121 
00122 #endif // _CTTL_NODE_FUNCTORS_H_INCLUDED_

Generated on Thu Nov 2 17:44:06 2006 for Common Text Transformation Library by  doxygen 1.3.9.1