diff options
author | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-04-02 15:08:31 +0000 |
---|---|---|
committer | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-04-02 15:08:31 +0000 |
commit | c858ac7393eeaacd03396c44d81a8ab0f92904fc (patch) | |
tree | f0b1ce615494e3bb7f3284d9f5dd965b03010086 /ACE/ace/Service_Gestalt.h | |
parent | 08e3a4e1a5d576e0c71b8fced1d471f2f4ad9795 (diff) | |
download | ATCD-c858ac7393eeaacd03396c44d81a8ab0f92904fc.tar.gz |
ChangeLogTag: Mon Apr 2 15:02:26 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'ACE/ace/Service_Gestalt.h')
-rw-r--r-- | ACE/ace/Service_Gestalt.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ACE/ace/Service_Gestalt.h b/ACE/ace/Service_Gestalt.h index 319ce7a0864..8a9949bd190 100644 --- a/ACE/ace/Service_Gestalt.h +++ b/ACE/ace/Service_Gestalt.h @@ -312,6 +312,9 @@ public: const ACE_Static_Svc_Descriptor *assd_; }; + /// Get the current ACE_Service_Repository held by this object. + ACE_Service_Repository* current_service_repository (void); + protected: /** @@ -447,6 +450,45 @@ protected: }; /* class ACE_Service_Gestalt */ +/** + * @class ACE_Service_Type_Dynamic_Guard + * + * @brief A forward service declaration guard. + * + * Helps to resolve an issue with hybrid services, i.e. dynamic + * services, accompanied by static services in the same DLL. Only + * automatic instances of SDG are supposed to exist. Those are + * created during (dynamic) service initialization and serve to: + * + * (a) Ensure the service we are loading is ordered last in the + * repository, following any other services it may cause to register, + * as part of its own registration. This is a common case when + * loading dynamic services from DLLs - there are often static + * initializers, which register static services. + * + * (b) The SDG instance destructor detects if the dynamic service + * initialized successfully and "fixes-up" all the newly registered + * static services to hold a reference to the DLL, from which they + * have originated. + */ +class ACE_Service_Type_Dynamic_Guard +{ +public: + ACE_Service_Type_Dynamic_Guard (ACE_Service_Repository &r, + ACE_TCHAR const *name); + + ~ACE_Service_Type_Dynamic_Guard (void); + +private: + ACE_Service_Repository & repo_; + size_t repo_begin_; + ACE_TCHAR const * const name_; + ACE_Service_Type const * dummy_; +# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) + ACE_Guard< ACE_Recursive_Thread_Mutex > repo_monitor_; +#endif +}; + ACE_END_VERSIONED_NAMESPACE_DECL |