diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ace/Auto_Functor.cpp | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/ace/Auto_Functor.cpp')
-rw-r--r-- | ACE/ace/Auto_Functor.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ACE/ace/Auto_Functor.cpp b/ACE/ace/Auto_Functor.cpp new file mode 100644 index 00000000000..91dbad1952b --- /dev/null +++ b/ACE/ace/Auto_Functor.cpp @@ -0,0 +1,42 @@ +// $Id$ + +#ifndef ACE_AUTO_FUNCTOR_CPP +#define ACE_AUTO_FUNCTOR_CPP + +#include "ace/Auto_Functor.h" + +#if !defined(__ACE_INLINE__) +# include "ace/Auto_Functor.inl" +#endif /* __ACE_INLINE__ */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +template<typename X, typename Functor> +ACE_Utils::Auto_Functor<X,Functor>::~Auto_Functor() + ACE_THROW_SPEC (()) +{ + reset(0); +} + +template<typename X, typename Functor> void +ACE_Utils::Auto_Functor<X,Functor>::reset(X * p) + ACE_THROW_SPEC (()) +{ + if(p_ != 0) + { + f_(p_); + } + p_ = p; +} + +template<typename X, typename Functor>void +ACE_Utils::Auto_Functor<X,Functor>::reset(X * p, Functor f) + ACE_THROW_SPEC (()) +{ + reset(p); + f_ = f; +} + +ACE_END_VERSIONED_NAMESPACE_DECL + +#endif /*ACE_AUTO_FUNCTOR_CPP*/ |