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

xst_member_void.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 
00033 // xst_member_void.h
00034 
00035 #ifndef _XST_MEMBER_VOID_H_INCLUDED_
00036 #define _XST_MEMBER_VOID_H_INCLUDED_
00037 
00038 namespace cttl_impl {
00039 
00055 template< typename ObjectT, typename MemberActionT, typename ArgumentT >
00056 class xst_member_action< ObjectT, MemberActionT, ArgumentT, /*ResultT*/void >
00057 
00058 #ifdef CTTL_TRACE_DEPOSITS
00059     : public xst_traced_action_base
00060 #endif // CTTL_TRACE_DEPOSITS
00061 
00062 {
00063 
00065     xst_storage_adaptor< ObjectT > m_object;
00066 
00068     MemberActionT m_member_action;
00069 
00071     xst_storage_adaptor< ArgumentT > m_argument;
00072 
00073 public:
00075     typedef xst_member_action< ObjectT, MemberActionT, ArgumentT, /*ResultT*/void > action_T;
00076 
00078     typedef int result_T;
00079 
00081     typedef int value_type;
00082 
00084     xst_member_action(
00085 #ifdef CTTL_TRACE_DEPOSITS
00086         int line_,
00087         char const* action_name_,
00088 #endif // CTTL_TRACE_DEPOSITS
00089         ObjectT object_ref_,
00090         MemberActionT member_action_,
00091         ArgumentT argument_
00092         )
00093         :
00094 #ifdef CTTL_TRACE_DEPOSITS
00095         xst_traced_action_base( line_, action_name_ ),
00096 #endif // CTTL_TRACE_DEPOSITS
00097         m_object( object_ref_ ),
00098         m_member_action( member_action_ ),
00099         m_argument( argument_ )
00100     {
00101     }
00102 
00104     result_T operator() ( bool ) const
00105     {
00106         return operator*();
00107     }
00108 
00110     result_T operator* () const
00111     {
00112 #ifdef CTTL_TRACE_DEPOSITS
00113         trace_prolog( m_argument.value() );
00114         m_member_action( &m_object.value(), m_argument.value() );
00115         result_T result = result_T( 1 );
00116         trace_epilog( result );
00117         return result;
00118 #else
00119         m_member_action( &m_object.value(), m_argument.value() );
00120         return result_T( 1 );
00121 #endif // CTTL_TRACE_DEPOSITS
00122     }
00123 
00124 };  // xst_member_action
00125 
00126 }   // namespace cttl_impl
00127 
00128 
00129 #endif //_XST_MEMBER_VOID_H_INCLUDED_

Generated on Thu Nov 2 17:48:24 2006 for CTTL Lambda Expression by  doxygen 1.3.9.1