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

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

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