#include <Strategies_T.h>
Inheritance diagram for ACE_Singleton_Strategy:


Public Types | |
| typedef ACE_Creation_Strategy< SVC_HANDLER > | base_type |
Public Methods | |
| ACE_Singleton_Strategy (SVC_HANDLER *=0, ACE_Thread_Manager *=0) | |
| int | open (SVC_HANDLER *, ACE_Thread_Manager *=0) |
| virtual | ~ACE_Singleton_Strategy (void) |
| virtual int | make_svc_handler (SVC_HANDLER *&) |
| Create a Singleton SVC_HANDLER by always returning the same SVC_HANDLER. Returns -1 on failure, else 0. More... | |
| void | dump (void) const |
| Dump the state of an object. More... | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. More... | |
Protected Attributes | |
| SVC_HANDLER * | svc_handler_ |
| Pointer to the Singleton svc_handler. More... | |
| int | delete_svc_handler_ |
| Keep track of whether we need to delete the <SVC_HANDLER>. More... | |
Note that this class takes over the ownership of the SVC_HANDLER passed into it as a parameter and it becomes responsible for deleting this object.
Definition at line 138 of file Strategies_T.h.
|
|||||
|
Definition at line 143 of file Strategies_T.h. |
|
||||||||||||||||
|
Definition at line 25 of file Strategies_T.i. References ACE_ERROR, ACE_LIB_TEXT, ACE_TRACE, LM_ERROR, and open.
00027 : svc_handler_ (0), 00028 delete_svc_handler_ (1) 00029 { 00030 ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::ACE_Singleton_Strategy"); 00031 if (this->open (sh, tm) == -1) 00032 ACE_ERROR ((LM_ERROR, 00033 ACE_LIB_TEXT ("%p\n"), 00034 ACE_LIB_TEXT ("ACE_Singleton_Strategy"))); 00035 } |
|
||||||||||
|
Definition at line 38 of file Strategies_T.i. References ACE_TRACE, delete_svc_handler_, and svc_handler_.
00039 {
00040 ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::~ACE_Singleton_Strategy");
00041 if (this->delete_svc_handler_ != 0)
00042 delete this->svc_handler_;
00043 }
|
|
||||||||||
|
Dump the state of an object.
Reimplemented from ACE_Creation_Strategy. Definition at line 1210 of file Strategies_T.cpp. References ACE_TRACE.
01211 {
01212 ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::dump");
01213 }
|
|
||||||||||
|
Create a Singleton SVC_HANDLER by always returning the same SVC_HANDLER. Returns -1 on failure, else 0.
Reimplemented from ACE_Creation_Strategy. Definition at line 49 of file Strategies_T.i. References ACE_TRACE, and svc_handler_.
00050 {
00051 ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::make_svc_handler");
00052 sh = this->svc_handler_;
00053 return 0;
00054 }
|
|
||||||||||||||||
|
Definition at line 25 of file Strategies_T.cpp. References ACE_NEW_RETURN, ACE_TRACE, delete_svc_handler_, and svc_handler_. Referenced by ACE_Singleton_Strategy.
00027 {
00028 ACE_TRACE ("ACE_Singleton_Strategy<SVC_HANDLER>::open");
00029
00030 if (this->delete_svc_handler_
00031 && this->svc_handler_ != 0)
00032 delete this->svc_handler_;
00033
00034 // If <sh> is NULL then create a new <SVC_HANDLER>.
00035 if (sh == 0)
00036 {
00037 ACE_NEW_RETURN (this->svc_handler_,
00038 SVC_HANDLER,
00039 -1);
00040 this->delete_svc_handler_ = 1;
00041 }
00042 else
00043 {
00044 this->svc_handler_ = sh;
00045 this->delete_svc_handler_ = 0;
00046 }
00047
00048 return 0;
00049 }
|
|
|||||
|
Declare the dynamic allocation hooks.
Reimplemented from ACE_Creation_Strategy. Definition at line 161 of file Strategies_T.h. |
|
|||||
|
Keep track of whether we need to delete the <SVC_HANDLER>.
Definition at line 168 of file Strategies_T.h. Referenced by open, and ~ACE_Singleton_Strategy. |
|
|||||
|
Pointer to the Singleton svc_handler.
Definition at line 165 of file Strategies_T.h. Referenced by make_svc_handler, open, and ~ACE_Singleton_Strategy. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002