00001 // Auto_Functor.cpp,v 1.2 2005/10/28 16:14:51 ossama Exp 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 ACE_THROW_SPEC (()) 00017 { 00018 reset(0); 00019 } 00020 00021 template<typename X, typename Functor> void 00022 ACE_Utils::Auto_Functor<X,Functor>::reset(X * p) 00023 ACE_THROW_SPEC (()) 00024 { 00025 if(p_ != 0) 00026 { 00027 f_(p_); 00028 } 00029 p_ = p; 00030 } 00031 00032 template<typename X, typename Functor>void 00033 ACE_Utils::Auto_Functor<X,Functor>::reset(X * p, Functor f) 00034 ACE_THROW_SPEC (()) 00035 { 00036 reset(p); 00037 f_ = f; 00038 } 00039 00040 ACE_END_VERSIONED_NAMESPACE_DECL 00041 00042 #endif /*ACE_AUTO_FUNCTOR_CPP*/