00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00035
00036
00037 #ifndef _CTTL_EDGE_FUNCTORS_H_INCLUDED_
00038 #define _CTTL_EDGE_FUNCTORS_H_INCLUDED_
00039
00040 #include "edge.h"
00041
00042 namespace cttl {
00043
00060 template< typename PolicyT = policy_default, typename StringT = CTTL_STD_STRING >
00061 struct edge_replace : public std::unary_function< edge< PolicyT, StringT >, void >
00062 {
00064 edge_replace( StringT const& str_ )
00065 :
00066 m_str( str_ )
00067 {}
00068
00074 void operator()( edge< PolicyT, StringT >& edge_ )
00075 {
00076 edge_.text( m_str );
00077 }
00078
00080 StringT m_str;
00081 };
00082
00100 template< typename PolicyT = policy_default, typename StringT = CTTL_STD_STRING >
00101 struct edge_first_insert_go : public std::unary_function< edge< PolicyT, StringT >, void >
00102 {
00104 edge_first_insert_go( StringT const& str_ )
00105 :
00106 m_str( str_ )
00107 {}
00108
00120 void operator() ( edge< PolicyT, StringT >& edge_ )
00121 {
00122 edge_.first.insert_go( m_str );
00123 }
00124
00126 StringT m_str;
00127 };
00128
00146 template< typename PolicyT = policy_default, typename StringT = CTTL_STD_STRING >
00147 struct edge_first_insert_stay : public std::unary_function< edge< PolicyT, StringT >, void >
00148 {
00150 edge_first_insert_stay( StringT const& str_ )
00151 :
00152 m_str( str_ )
00153 {}
00154
00165 void operator() ( edge< PolicyT, StringT >& edge_ )
00166 {
00167 edge_.first.insert_stay( m_str );
00168 }
00169
00171 StringT m_str;
00172 };
00173
00191 template< typename PolicyT = policy_default, typename StringT = CTTL_STD_STRING >
00192 struct edge_second_insert_go : public std::unary_function< edge< PolicyT, StringT >, void >
00193 {
00195 edge_second_insert_go( StringT const& str_ )
00196 :
00197 m_str( str_ )
00198 {}
00199
00211 void operator() ( edge< PolicyT, StringT >& edge_ )
00212 {
00213 edge_.second.insert_go( m_str );
00214 }
00215
00217 StringT m_str;
00218 };
00219
00237 template< typename PolicyT = policy_default, typename StringT = CTTL_STD_STRING >
00238 struct edge_second_insert_stay : public std::unary_function< edge< PolicyT, StringT >, void >
00239 {
00241 edge_second_insert_stay( StringT const& str_ )
00242 :
00243 m_str( str_ )
00244 {}
00245
00256 void operator() ( edge< PolicyT, StringT >& edge_ )
00257 {
00258 edge_.second.insert_stay( m_str );
00259 }
00260
00262 StringT m_str;
00263 };
00264
00265 }
00266
00267 #endif // _CTTL_EDGE_FUNCTORS_H_INCLUDED_