00001 // $Id: Auto_Functor.cpp 79140 2007-08-01 07:01:11Z johnnyw $ 00002 00003 #ifndef ACE_AUTO_FUNCTOR_CPP 00004 #define ACE_AUTO_FUNCTOR_CPP 00005 00006 #include "ace/Auto_Functor.h" 00007 00008 #if !defined(__ACE_INLINE__) 00009 # include "ace/Auto_Functor.inl" 00010 #endif /* __ACE_INLINE__ */ 00011 00012 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00013 00014 template<typename X, typename Functor> 00015 ACE_Utils::Auto_Functor<X,Functor>::~Auto_Functor() 00016 { 00017 reset(0); 00018 } 00019 00020 template<typename X, typename Functor> void 00021 ACE_Utils::Auto_Functor<X,Functor>::reset(X * p) 00022 { 00023 if(p_ != 0) 00024 { 00025 f_(p_); 00026 } 00027 p_ = p; 00028 } 00029 00030 template<typename X, typename Functor>void 00031 ACE_Utils::Auto_Functor<X,Functor>::reset(X * p, Functor f) 00032 { 00033 reset(p); 00034 f_ = f; 00035 } 00036 00037 ACE_END_VERSIONED_NAMESPACE_DECL 00038 00039 #endif /*ACE_AUTO_FUNCTOR_CPP*/