00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00033
00034
00035 #ifndef _XST_STATIC_NOARG_ACTION_H_INCLUDED_
00036 #define _XST_STATIC_NOARG_ACTION_H_INCLUDED_
00037
00038 namespace cttl_impl {
00039
00051 template< typename StaticActionT, typename ResultT >
00052 class xst_static_action< StaticActionT, void, ResultT >
00053
00054 #ifdef CTTL_TRACE_DEPOSITS
00055 : public xst_traced_action_base
00056 #endif
00057
00058 {
00060 StaticActionT m_static_action;
00061
00062 public:
00064 typedef xst_static_action< StaticActionT, void, ResultT > action_T;
00065
00067 typedef ResultT result_T;
00068
00070 typedef typename xst_dereference_traits< action_T, result_T >::value_type value_type;
00071
00073 xst_static_action(
00074 #ifdef CTTL_TRACE_DEPOSITS
00075 int line_,
00076 char const* action_name_,
00077 #endif
00078 StaticActionT static_action_
00079 )
00080 :
00081 #ifdef CTTL_TRACE_DEPOSITS
00082 xst_traced_action_base( line_, action_name_ ),
00083 #endif
00084 m_static_action( static_action_ )
00085 {
00086 }
00087
00089 result_T operator() ( bool ) const
00090 {
00091 return operator*();
00092 }
00093
00095 result_T operator* () const
00096 {
00097 #ifdef CTTL_TRACE_DEPOSITS
00098 trace_prolog();
00099 result_T result = m_static_action();
00100 trace_epilog( result );
00101 return result;
00102 #else
00103 return m_static_action();
00104 #endif // CTTL_TRACE_DEPOSITS
00105 }
00106
00107 };
00108
00109 }
00110
00111
00112 #endif //_XST_STATIC_NOARG_ACTION_H_INCLUDED_