Strategies_T.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Strategies_T.inl,v 4.4 2005/10/28 16:14:56 ossama Exp
00004 
00005 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 template <class SVC_HANDLER> ACE_INLINE
00008 ACE_Singleton_Strategy<SVC_HANDLER>::ACE_Singleton_Strategy (SVC_HANDLER *sh,
00009                                                              ACE_Thread_Manager *tm)
00010   : svc_handler_ (0),
00011     delete_svc_handler_ (1)
00012 {
00013   ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::ACE_Singleton_Strategy");
00014   if (this->open (sh, tm) == -1)
00015     ACE_ERROR ((LM_ERROR,
00016                 ACE_LIB_TEXT ("%p\n"),
00017                 ACE_LIB_TEXT ("ACE_Singleton_Strategy")));
00018 }
00019 
00020 template <class SVC_HANDLER> ACE_INLINE int
00021 ACE_Creation_Strategy<SVC_HANDLER>::open (ACE_Thread_Manager *thr_mgr,
00022                                           ACE_Reactor *reactor)
00023 {
00024   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::open");
00025   this->thr_mgr_ = thr_mgr;
00026   this->reactor_ = reactor;
00027   return 0;
00028 }
00029 
00030 template <class SVC_HANDLER> ACE_INLINE
00031 ACE_Creation_Strategy<SVC_HANDLER>::ACE_Creation_Strategy (ACE_Thread_Manager *thr_mgr,
00032                                                            ACE_Reactor *reactor)
00033 {
00034   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::ACE_Creation_Strategy");
00035   if (this->open (thr_mgr, reactor) == -1)
00036     ACE_ERROR ((LM_ERROR,
00037                 ACE_LIB_TEXT ("%p\n"),
00038                 ACE_LIB_TEXT ("ACE_Creation_Strategy")));
00039 }
00040 
00041 template <class SVC_HANDLER> ACE_INLINE
00042 ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy (const ACE_TCHAR dll_name[],
00043                                                  const ACE_TCHAR factory_function[],
00044                                                  const ACE_TCHAR svc_name[],
00045                                                  ACE_Service_Repository *svc_rep,
00046                                                  ACE_Thread_Manager *thr_mgr)
00047 {
00048   ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy");
00049   if (this->open (dll_name,
00050                   factory_function,
00051                   svc_name,
00052                   svc_rep,
00053                   thr_mgr) == -1)
00054     ACE_ERROR ((LM_ERROR,
00055                 ACE_LIB_TEXT ("%p\n"),
00056                 ACE_LIB_TEXT ("open")));
00057 }
00058 
00059 template <class SVC_HANDLER> ACE_INLINE
00060 ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy (void)
00061 {
00062   ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy");
00063 }
00064 
00065 template <class SVC_HANDLER> ACE_INLINE
00066 ACE_Concurrency_Strategy<SVC_HANDLER>::ACE_Concurrency_Strategy (int flags)
00067   : flags_ (flags)
00068 {
00069   ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::ACE_Concurrency_Strategy");
00070 }
00071 
00072 template <class SVC_HANDLER> ACE_INLINE
00073 ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy (ACE_Reactor *reactor,
00074                                                            ACE_Reactor_Mask mask,
00075                                                            int flags)
00076 {
00077   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy");
00078 
00079   if (this->open (reactor,
00080                   mask,
00081                   flags) == -1)
00082     ACE_ERROR ((LM_ERROR,
00083                 ACE_LIB_TEXT ("%p\n"),
00084                 ACE_LIB_TEXT ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy")));
00085 }
00086 
00087 template <class SVC_HANDLER> ACE_INLINE
00088 ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy (int flags)
00089   : ACE_Concurrency_Strategy<SVC_HANDLER> (flags),
00090     reactor_ (0),
00091     mask_ (ACE_Event_Handler::NULL_MASK)
00092 {
00093   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy");
00094 }
00095 
00096 template <class SVC_HANDLER> ACE_INLINE
00097 ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy (ACE_Thread_Manager *thr_mgr,
00098                                                        long thr_flags,
00099                                                        int n_threads,
00100                                                        int flags)
00101 {
00102   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy");
00103 
00104   if (this->open (thr_mgr,
00105                   thr_flags,
00106                   n_threads,
00107                   flags) == -1)
00108     ACE_ERROR ((LM_ERROR,
00109                 ACE_LIB_TEXT ("%p\n"),
00110                 ACE_LIB_TEXT ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy")));
00111 }
00112 
00113 template <class SVC_HANDLER> ACE_INLINE
00114 ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy (int flags)
00115   : ACE_Concurrency_Strategy<SVC_HANDLER> (flags),
00116     thr_mgr_ (0),
00117     thr_flags_ (0),
00118     n_threads_ (1)
00119 {
00120   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy");
00121 }
00122 
00123 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_INLINE
00124 ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy (ACE_Reactor *reactor)
00125   : reactor_ (reactor)
00126 {
00127   ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy");
00128 }
00129 
00130 template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1> ACE_INLINE
00131 ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::ACE_Connect_Strategy (void)
00132 {
00133   ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::ACE_Connect_Strategy");
00134 }
00135 
00136 template <class SVC_HANDLER> ACE_INLINE
00137 ACE_Process_Strategy<SVC_HANDLER>::ACE_Process_Strategy (size_t n_processes,
00138                                                          ACE_Event_Handler *acceptor,
00139                                                          ACE_Reactor *reactor,
00140                                                          int avoid_zombies)
00141 {
00142   ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::ACE_Process_Strategy");
00143   if (this->open (n_processes,
00144                   acceptor,
00145                   reactor,
00146                   avoid_zombies) == -1)
00147     ACE_ERROR ((LM_ERROR,
00148                 ACE_LIB_TEXT ("%p\n"),
00149                 ACE_LIB_TEXT ("ACE_Process_Strategy")));
00150 }
00151 
00152 template <class SVC_HANDLER> ACE_INLINE
00153 ACE_Scheduling_Strategy<SVC_HANDLER>::ACE_Scheduling_Strategy (SVC_HANDLER *)
00154 {
00155   ACE_TRACE ("ACE_Scheduling_Strategy<SVC_HANDLER>::ACE_Scheduling_Strategy");
00156 }
00157 
00158 template <class SVC_HANDLER> ACE_INLINE
00159 ACE_Schedule_All_Reactive_Strategy<SVC_HANDLER>::ACE_Schedule_All_Reactive_Strategy
00160   (SVC_HANDLER *scheduler)
00161   : ACE_Scheduling_Strategy<SVC_HANDLER> (scheduler)
00162 {
00163   ACE_TRACE ("ACE_Schedule_All_Reactive_Strategy<SVC_HANDLER>::ACE_Schedule_All_Reactive_Strategy");
00164 
00165   if (scheduler == 0 || scheduler->reactor () == 0)
00166     this->reactor_ = ACE_Reactor::instance ();
00167   else
00168     this->reactor_ = scheduler->reactor ();
00169 }
00170 
00171 template <class SVC_HANDLER> ACE_INLINE
00172 ACE_Schedule_All_Threaded_Strategy<SVC_HANDLER>::ACE_Schedule_All_Threaded_Strategy
00173   (SVC_HANDLER *scheduler)
00174   : ACE_Scheduling_Strategy<SVC_HANDLER> (scheduler)
00175 {
00176   ACE_TRACE ("ACE_Schedule_All_Threaded_Strategy<SVC_HANDLER>::ACE_Schedule_All_Threaded_Strategy");
00177 
00178   if (scheduler == 0 || scheduler->thr_mgr () == 0)
00179     this->thr_mgr_ = ACE_Thread_Manager::instance ();
00180   else
00181     this->thr_mgr_ = scheduler->thr_mgr ();
00182 }
00183 
00184 template <class T> ACE_INLINE
00185 ACE_Refcounted_Hash_Recyclable<T>::ACE_Refcounted_Hash_Recyclable (void)
00186   : ACE_Refcountable (0),
00187     ACE_Hashable (),
00188     ACE_Recyclable (ACE_RECYCLABLE_UNKNOWN),
00189     t_ ()
00190 {
00191 }
00192 
00193 template <class T> ACE_INLINE
00194 ACE_Refcounted_Hash_Recyclable<T>::ACE_Refcounted_Hash_Recyclable (const T &t,
00195                                                                    int refcount,
00196                                                                    ACE_Recyclable_State state)
00197   : ACE_Refcountable (refcount),
00198     ACE_Hashable (),
00199     ACE_Recyclable (state),
00200     t_ (t)
00201 {
00202 }
00203 
00204 template <class T> ACE_INLINE u_long
00205 ACE_Refcounted_Hash_Recyclable<T>::hash_i (void) const
00206 {
00207   return this->t_.hash ();
00208 }
00209 
00210 template <class T> ACE_INLINE T &
00211 ACE_Refcounted_Hash_Recyclable<T>::subject (void)
00212 {
00213   return this->t_;
00214 }
00215 
00216 template <class T> ACE_INLINE bool
00217 ACE_Refcounted_Hash_Recyclable<T>::operator== (const ACE_Refcounted_Hash_Recyclable<T> &rhs) const
00218 {
00219   return
00220     this->recycle_state () == rhs.recycle_state ()
00221     && this->t_ == rhs.t_;
00222 }
00223 
00224 template <class T> ACE_INLINE bool
00225 ACE_Refcounted_Hash_Recyclable<T>::operator!= (const ACE_Refcounted_Hash_Recyclable<T> &rhs) const
00226 {
00227   return !this->operator== (rhs);
00228 }
00229 
00230 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 09:42:05 2006 for ACE by doxygen 1.3.6