Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Strategies_T.inl
blob8e249962d61b58d64b2437c9f1e23a5062cd0e3f
1 // -*- C++ -*-
2 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
4 template <class SVC_HANDLER> ACE_INLINE
5 ACE_Singleton_Strategy<SVC_HANDLER>::ACE_Singleton_Strategy (SVC_HANDLER *sh,
6                                                              ACE_Thread_Manager *tm)
7   : svc_handler_ (0),
8     delete_svc_handler_ (1)
10   ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::ACE_Singleton_Strategy");
11   if (this->open (sh, tm) == -1)
12     ACELIB_ERROR ((LM_ERROR,
13                 ACE_TEXT ("%p\n"),
14                 ACE_TEXT ("ACE_Singleton_Strategy")));
17 template <class SVC_HANDLER> ACE_INLINE int
18 ACE_Creation_Strategy<SVC_HANDLER>::open (ACE_Thread_Manager *thr_mgr,
19                                           ACE_Reactor *reactor)
21   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::open");
22   this->thr_mgr_ = thr_mgr;
23   this->reactor_ = reactor;
24   return 0;
27 template <class SVC_HANDLER> ACE_INLINE
28 ACE_Creation_Strategy<SVC_HANDLER>::ACE_Creation_Strategy (ACE_Thread_Manager *thr_mgr,
29                                                            ACE_Reactor *reactor)
31   ACE_TRACE ("ACE_Creation_Strategy<SVC_HANDLER>::ACE_Creation_Strategy");
32   if (this->open (thr_mgr, reactor) == -1)
33     ACELIB_ERROR ((LM_ERROR,
34                 ACE_TEXT ("%p\n"),
35                 ACE_TEXT ("ACE_Creation_Strategy")));
38 template <class SVC_HANDLER> ACE_INLINE
39 ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy (const ACE_TCHAR dll_name[],
40                                                  const ACE_TCHAR factory_function[],
41                                                  const ACE_TCHAR svc_name[],
42                                                  ACE_Service_Repository *svc_rep,
43                                                  ACE_Thread_Manager *thr_mgr)
45   ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy");
46   if (this->open (dll_name,
47                   factory_function,
48                   svc_name,
49                   svc_rep,
50                   thr_mgr) == -1)
51     ACELIB_ERROR ((LM_ERROR,
52                 ACE_TEXT ("%p\n"),
53                 ACE_TEXT ("open")));
56 template <class SVC_HANDLER> ACE_INLINE
57 ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy ()
59   ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy");
62 template <class SVC_HANDLER> ACE_INLINE
63 ACE_Concurrency_Strategy<SVC_HANDLER>::ACE_Concurrency_Strategy (int flags)
64   : flags_ (flags)
66   ACE_TRACE ("ACE_Concurrency_Strategy<SVC_HANDLER>::ACE_Concurrency_Strategy");
69 template <class SVC_HANDLER> ACE_INLINE
70 ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy (ACE_Reactor *reactor,
71                                                            ACE_Reactor_Mask mask,
72                                                            int flags)
74   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy");
76   if (this->open (reactor,
77                   mask,
78                   flags) == -1)
79     ACELIB_ERROR ((LM_ERROR,
80                 ACE_TEXT ("%p\n"),
81                 ACE_TEXT ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy")));
84 template <class SVC_HANDLER> ACE_INLINE
85 ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy (int flags)
86   : ACE_Concurrency_Strategy<SVC_HANDLER> (flags),
87     reactor_ (0),
88     mask_ (ACE_Event_Handler::NULL_MASK)
90   ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy");
93 template <class SVC_HANDLER> ACE_INLINE
94 ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy (ACE_Thread_Manager *thr_mgr,
95                                                        long thr_flags,
96                                                        int n_threads,
97                                                        int flags)
99   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy");
101   if (this->open (thr_mgr,
102                   thr_flags,
103                   n_threads,
104                   flags) == -1)
105     ACELIB_ERROR ((LM_ERROR,
106                 ACE_TEXT ("%p\n"),
107                 ACE_TEXT ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy")));
110 template <class SVC_HANDLER> ACE_INLINE
111 ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy (int flags)
112   : ACE_Concurrency_Strategy<SVC_HANDLER> (flags),
113     thr_mgr_ (0),
114     thr_flags_ (0),
115     n_threads_ (1)
117   ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy");
120 template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> ACE_INLINE
121 ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy (ACE_Reactor *reactor)
122   : reactor_ (reactor)
124   ACE_TRACE ("ACE_Accept_Strategy<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::ACE_Accept_Strategy");
127 template <class SVC_HANDLER, ACE_PEER_CONNECTOR_1> ACE_INLINE
128 ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::ACE_Connect_Strategy ()
130   ACE_TRACE ("ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>::ACE_Connect_Strategy");
133 template <class SVC_HANDLER> ACE_INLINE
134 ACE_Process_Strategy<SVC_HANDLER>::ACE_Process_Strategy (size_t n_processes,
135                                                          ACE_Event_Handler *acceptor,
136                                                          ACE_Reactor *reactor,
137                                                          int avoid_zombies)
139   ACE_TRACE ("ACE_Process_Strategy<SVC_HANDLER>::ACE_Process_Strategy");
140   if (this->open (n_processes,
141                   acceptor,
142                   reactor,
143                   avoid_zombies) == -1)
144     ACELIB_ERROR ((LM_ERROR,
145                 ACE_TEXT ("%p\n"),
146                 ACE_TEXT ("ACE_Process_Strategy")));
149 template <class SVC_HANDLER> ACE_INLINE
150 ACE_Scheduling_Strategy<SVC_HANDLER>::ACE_Scheduling_Strategy (SVC_HANDLER *)
152   ACE_TRACE ("ACE_Scheduling_Strategy<SVC_HANDLER>::ACE_Scheduling_Strategy");
155 template <class SVC_HANDLER> ACE_INLINE
156 ACE_Schedule_All_Reactive_Strategy<SVC_HANDLER>::ACE_Schedule_All_Reactive_Strategy
157   (SVC_HANDLER *scheduler)
158   : ACE_Scheduling_Strategy<SVC_HANDLER> (scheduler)
160   ACE_TRACE ("ACE_Schedule_All_Reactive_Strategy<SVC_HANDLER>::ACE_Schedule_All_Reactive_Strategy");
162   if (scheduler == 0 || scheduler->reactor () == 0)
163     this->reactor_ = ACE_Reactor::instance ();
164   else
165     this->reactor_ = scheduler->reactor ();
168 template <class SVC_HANDLER> ACE_INLINE
169 ACE_Schedule_All_Threaded_Strategy<SVC_HANDLER>::ACE_Schedule_All_Threaded_Strategy
170   (SVC_HANDLER *scheduler)
171   : ACE_Scheduling_Strategy<SVC_HANDLER> (scheduler)
173   ACE_TRACE ("ACE_Schedule_All_Threaded_Strategy<SVC_HANDLER>::ACE_Schedule_All_Threaded_Strategy");
175   if (scheduler == 0 || scheduler->thr_mgr () == 0)
176     this->thr_mgr_ = ACE_Thread_Manager::instance ();
177   else
178     this->thr_mgr_ = scheduler->thr_mgr ();
181 template <class T> ACE_INLINE
182 ACE_Refcounted_Hash_Recyclable<T>::ACE_Refcounted_Hash_Recyclable ()
183   : ACE_Refcountable_T<ACE_Null_Mutex> (0),
184     ACE_Hashable (),
185     ACE_Recyclable (ACE_RECYCLABLE_UNKNOWN),
186     t_ ()
190 template <class T> ACE_INLINE
191 ACE_Refcounted_Hash_Recyclable<T>::ACE_Refcounted_Hash_Recyclable (const T &t,
192                                                                    long refcount,
193                                                                    ACE_Recyclable_State state)
194   : ACE_Refcountable_T<ACE_Null_Mutex> (refcount),
195     ACE_Hashable (),
196     ACE_Recyclable (state),
197     t_ (t)
201 template <class T> ACE_INLINE u_long
202 ACE_Refcounted_Hash_Recyclable<T>::hash_i () const
204   return this->t_.hash ();
207 template <class T> ACE_INLINE T &
208 ACE_Refcounted_Hash_Recyclable<T>::subject ()
210   return this->t_;
213 template <class T> ACE_INLINE bool
214 ACE_Refcounted_Hash_Recyclable<T>::operator== (const ACE_Refcounted_Hash_Recyclable<T> &rhs) const
216   return
217     this->recycle_state () == rhs.recycle_state ()
218     && this->t_ == rhs.t_;
221 template <class T> ACE_INLINE bool
222 ACE_Refcounted_Hash_Recyclable<T>::operator!= (const ACE_Refcounted_Hash_Recyclable<T> &rhs) const
224   return !this->operator== (rhs);
227 ACE_END_VERSIONED_NAMESPACE_DECL