00001 // -*- C++ -*- 00002 00003 /** 00004 * @file ESF_Delayed_Command.h 00005 * 00006 * $Id: ESF_Delayed_Command.h 90386 2010-06-02 13:52:08Z vzykov $ 00007 * 00008 * @author Carlos O'Ryan (coryan@cs.wustl.edu) 00009 * 00010 * http://doc.ece.uci.edu/~coryan/EC/index.html 00011 */ 00012 00013 #ifndef TAO_ESF_DELAYED_COMMAND_H 00014 #define TAO_ESF_DELAYED_COMMAND_H 00015 00016 #include "ace/Functor.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 #include /**/ "tao/Versioned_Namespace.h" 00023 00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00025 00026 /** 00027 * @class TAO_ESF_Connected_Command 00028 * 00029 * @brief Implements a Command object that invokes the connected_i() 00030 * method on the target, passing an argument of type Object. 00031 * 00032 * <H2>Memory Managment</H2> 00033 * It does not assume ownership of Object nor the Target 00034 * arguments. 00035 * Usually allocated from the heap or an allocator; but it is not 00036 * self-managed. 00037 * 00038 * <H2>Locking</H2> 00039 * No provisions for locking, access must be serialized 00040 * externally. 00041 */ 00042 template<class Target, class Object> 00043 class TAO_ESF_Connected_Command : public ACE_Command_Base 00044 { 00045 public: 00046 /// constructor... 00047 TAO_ESF_Connected_Command (Target *target, 00048 Object *object); 00049 00050 /// The callback method, if the argument is not nil it is interpreted 00051 /// as a CORBA::Environment. 00052 virtual int execute (void *arg); 00053 00054 private: 00055 /// The target 00056 Target *target_; 00057 00058 /// The argument 00059 Object *object_; 00060 }; 00061 00062 // **************************************************************** 00063 00064 /** 00065 * @class TAO_ESF_Reconnected_Command 00066 * 00067 * @brief Implements a Command object that invokes the reconnected_i() 00068 * method on the target, passing an argument of type Object. 00069 * 00070 * <H2>Memory Managment</H2> 00071 * It does not assume ownership of Object nor the Target 00072 * arguments. 00073 * Usually allocated from the heap or an allocator; but it is not 00074 * self-managed. 00075 * 00076 * <H2>Locking</H2> 00077 * No provisions for locking, access must be serialized 00078 * externally. 00079 */ 00080 template<class Target, class Object> 00081 class TAO_ESF_Reconnected_Command : public ACE_Command_Base 00082 { 00083 public: 00084 /// constructor... 00085 TAO_ESF_Reconnected_Command (Target *target, 00086 Object *object); 00087 00088 /// The callback method, if the argument is not nil it is interpreted 00089 /// as a CORBA::Environment. 00090 virtual int execute (void *arg); 00091 00092 private: 00093 /// The target 00094 Target *target_; 00095 00096 /// The argument 00097 Object *object_; 00098 }; 00099 00100 // **************************************************************** 00101 00102 /** 00103 * @class TAO_ESF_Disconnected_Command 00104 * 00105 * @brief Implements a Command object that invokes the 00106 * disconnected_i() method on the target, passing an argument of type 00107 * Object. 00108 * 00109 * <H2>Memory Managment</H2> 00110 * It does not assume ownership of Object nor the Target 00111 * arguments. 00112 * Usually allocated from the heap or an allocator; but it is not 00113 * self-managed. 00114 * 00115 * <H2>Locking</H2> 00116 * No provisions for locking, access must be serialized 00117 * externally. 00118 */ 00119 template<class Target, class Object> 00120 class TAO_ESF_Disconnected_Command : public ACE_Command_Base 00121 { 00122 public: 00123 /// constructor... 00124 TAO_ESF_Disconnected_Command (Target *target, 00125 Object *object); 00126 00127 /// The callback method, if the argument is not nil it is interpreted 00128 /// as a CORBA::Environment. 00129 virtual int execute (void *arg); 00130 00131 private: 00132 /// The target 00133 Target *target_; 00134 00135 /// The argument 00136 Object *object_; 00137 }; 00138 00139 // **************************************************************** 00140 00141 /** 00142 * @class TAO_ESF_Shutdown_Command 00143 * 00144 * @brief Implements a Command object that invokes the shutdown_i() 00145 * method on the target, passing an argument of type Object. 00146 * 00147 * <H2>Memory Management</H2> 00148 * It does not assume ownership of Object nor the Target 00149 * arguments. 00150 * Usually allocated from the heap or an allocator; but it is not 00151 * self-managed. 00152 * 00153 * <H2>Locking</H2> 00154 * No provisions for locking, access must be serialized 00155 * externally. 00156 */ 00157 template<class Target> 00158 class TAO_ESF_Shutdown_Command : public ACE_Command_Base 00159 { 00160 public: 00161 /// constructor... 00162 TAO_ESF_Shutdown_Command (Target *target); 00163 00164 /// The callback method, if the argument is not nil it is interpreted 00165 /// as a CORBA::Environment. 00166 virtual int execute (void *arg); 00167 00168 private: 00169 /// The target 00170 Target *target_; 00171 }; 00172 00173 // **************************************************************** 00174 00175 TAO_END_VERSIONED_NAMESPACE_DECL 00176 00177 #if defined (__ACE_INLINE__) 00178 #include "orbsvcs/ESF/ESF_Delayed_Command.inl" 00179 #endif /* __ACE_INLINE__ */ 00180 00181 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00182 #include "orbsvcs/ESF/ESF_Delayed_Command.cpp" 00183 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00184 00185 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00186 #pragma implementation ("ESF_Delayed_Command.cpp") 00187 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00188 00189 #endif /* TAO_ESF_DELAYED_COMMAND_H */