00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Implicit_Deactivator.h 00006 * 00007 * $Id: Implicit_Deactivator.h 77151 2007-02-15 13:24:41Z johnnyw $ 00008 * 00009 * @author Carlos O'Ryan <coryan@atdesk.com> 00010 */ 00011 //============================================================================= 00012 #ifndef TAO_UTILS_IMPLICIT_DEACTIVATOR_H 00013 #define TAO_UTILS_IMPLICIT_DEACTIVATOR_H 00014 #include /**/ "ace/pre.h" 00015 #include "tao/Utils/utils_export.h" 00016 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 #include "tao/PortableServer/PortableServer.h" 00023 #include "ace/Auto_Functor.h" 00024 00025 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00026 00027 namespace TAO 00028 { 00029 namespace Utils 00030 { 00031 00032 /** 00033 * @struct Implicit_Deactivation_Functor 00034 * 00035 * @brief Implements a functor for the Implicit_Deactivator class. 00036 */ 00037 struct TAO_UTILS_Export Implicit_Deactivation_Functor 00038 { 00039 typedef PortableServer::ServantBase * argument; 00040 00041 // Deactivate an implicitly activated servant 00042 void operator() (PortableServer::ServantBase * servant) throw (); 00043 }; 00044 00045 /** 00046 * @class Implicit_Deactivator 00047 * 00048 * @brief Helper class to deactivate implicitly activated servants. 00049 * 00050 */ 00051 typedef ACE_Utils::Auto_Functor< 00052 PortableServer::ServantBase, 00053 Implicit_Deactivation_Functor> 00054 Implicit_Deactivator; 00055 00056 } // namespace Utils 00057 } // namespace TAO 00058 00059 TAO_END_VERSIONED_NAMESPACE_DECL 00060 00061 #include /**/ "ace/post.h" 00062 #endif /*TAO_UTILS_IMPLICIT_DEACTIVATOR_H*/