#include <Strategies_T.h>
Inheritance diagram for ACE_DLL_Strategy< SVC_HANDLER >:
Public Types | |
typedef ACE_Creation_Strategy< SVC_HANDLER > | base_type |
Public Member Functions | |
ACE_DLL_Strategy (void) | |
"Do-nothing" constructor. | |
ACE_DLL_Strategy (const ACE_TCHAR dll_name[], const ACE_TCHAR factory_function[], const ACE_TCHAR svc_name[], ACE_Service_Repository *, ACE_Thread_Manager *=0) | |
int | open (const ACE_TCHAR dll_name[], const ACE_TCHAR factory_function[], const ACE_TCHAR svc_name[], ACE_Service_Repository *, ACE_Thread_Manager *=0) |
virtual int | make_svc_handler (SVC_HANDLER *&) |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Protected Types | |
typedef ACE_Creation_Strategy< SVC_HANDLER > | inherited |
Protected Attributes | |
ACE_TCHAR | dll_name_ [MAXPATHLEN+1] |
Name of the DLL to dynamically link. | |
ACE_TCHAR | factory_function_ [MAXPATHLEN+1] |
ACE_TCHAR | svc_name_ [MAXNAMELEN+1] |
Name of the service. | |
ACE_Service_Repository * | svc_rep_ |
Pointer to the . |
Definition at line 181 of file Strategies_T.h.
|
Definition at line 186 of file Strategies_T.h. |
|
Definition at line 221 of file Strategies_T.h. |
|
"Do-nothing" constructor.
Definition at line 60 of file Strategies_T.inl. References ACE_TRACE.
00061 { 00062 ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::ACE_DLL_Strategy"); 00063 } |
|
Initialize the DLL strategy based upon the service's DLL information contained in the string. Definition at line 42 of file Strategies_T.inl. References ACE_ERROR, ACE_LIB_TEXT, ACE_TCHAR, ACE_TRACE, LM_ERROR, and ACE_DLL_Strategy< SVC_HANDLER >::open().
|
|
Dump the state of an object.
Reimplemented from ACE_Creation_Strategy< SVC_HANDLER >. Definition at line 1234 of file Strategies_T.cpp. References ACE_TRACE.
01235 { 01236 #if defined (ACE_HAS_DUMP) 01237 ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::dump"); 01238 #endif /* ACE_HAS_DUMP */ 01239 } |
|
Create a SVC_HANDLER by dynamically linking it from a DLL. Returns -1 on failure, else 0. Reimplemented from ACE_Creation_Strategy< SVC_HANDLER >. Definition at line 115 of file Strategies_T.cpp. References ACE_ALLOCATOR_RETURN, ACE_NEW_RETURN, ACE_SHLIB_HANDLE, ACE_TRACE, ACE_OS::dlopen(), ACE_OS::dlsym(), and ACE_Service_Repository::insert().
00116 { 00117 ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::make_svc_handler"); 00118 00119 // Open the shared library. 00120 ACE_SHLIB_HANDLE handle = ACE_OS::dlopen (this->dll_name_); 00121 00122 // Extract the factory function. 00123 #if defined (ACE_OPENVMS) 00124 SVC_HANDLER *(*factory)(void) = 00125 (SVC_HANDLER *(*)(void)) ACE::ldsymbol (handle, 00126 this->factory_function_); 00127 #else 00128 SVC_HANDLER *(*factory)(void) = 00129 (SVC_HANDLER *(*)(void)) ACE_OS::dlsym (handle, 00130 this->factory_function_); 00131 #endif 00132 00133 // Call the factory function to obtain the new SVC_Handler (should 00134 // use RTTI here when it becomes available...) 00135 SVC_HANDLER *svc_handler = 0; 00136 00137 ACE_ALLOCATOR_RETURN (svc_handler, (*factory)(), -1); 00138 00139 if (svc_handler != 0) 00140 { 00141 // Create an ACE_Service_Type containing the SVC_Handler and 00142 // insert into this->svc_rep_; 00143 00144 ACE_Service_Type_Impl *stp = 0; 00145 ACE_NEW_RETURN (stp, 00146 ACE_Service_Object_Type (svc_handler, 00147 this->svc_name_), 00148 -1); 00149 00150 ACE_Service_Type *srp = 0; 00151 00152 ACE_NEW_RETURN (srp, 00153 ACE_Service_Type (this->svc_name_, 00154 stp, 00155 handle, 00156 1), 00157 -1); 00158 if (srp == 0) 00159 { 00160 delete stp; 00161 errno = ENOMEM; 00162 return -1; 00163 } 00164 00165 if (this->svc_rep_->insert (srp) == -1) 00166 return -1; 00167 // @@ Somehow, we need to deal with this->thr_mgr_... 00168 } 00169 00170 sh = svc_handler; 00171 return 0; 00172 } |
|
Initialize the DLL strategy based upon the service's DLL information contained in the string. Definition at line 97 of file Strategies_T.cpp. References ACE_TCHAR, ACE_TRACE, and ACE_OS::strcpy(). Referenced by ACE_DLL_Strategy< SVC_HANDLER >::ACE_DLL_Strategy().
00102 { 00103 ACE_TRACE ("ACE_DLL_Strategy<SVC_HANDLER>::open"); 00104 this->inherited::open (thr_mgr); 00105 ACE_OS::strcpy (this->dll_name_, dll_name); 00106 ACE_OS::strcpy (this->factory_function_, factory_function); 00107 ACE_OS::strcpy (this->svc_name_, svc_name); 00108 this->svc_rep_ = svc_rep; 00109 return 0; 00110 } |
|
Declare the dynamic allocation hooks.
Reimplemented from ACE_Creation_Strategy< SVC_HANDLER >. Definition at line 218 of file Strategies_T.h. |
|
Name of the DLL to dynamically link.
Definition at line 224 of file Strategies_T.h. |
|
Name of the factory function in the shared library to use to obtain a pointer to the new SVC_HANDLER. Definition at line 228 of file Strategies_T.h. |
|
Name of the service.
Definition at line 231 of file Strategies_T.h. |
|
Pointer to the .
Definition at line 234 of file Strategies_T.h. |