Provides a way to declare dependency on specific service, thus helping to avoid order of initialization issues with instances of an objects whose implementation code resides in dynamically loaded services.
More...
Provides a way to declare dependency on specific service, thus helping to avoid order of initialization issues with instances of an objects whose implementation code resides in dynamically loaded services.
It is disastrous to have dynamically loadable services create and give away ownership of objects and then ending up being unloaded before all those instances have been deleted. Normally the code for such objects classes resides within the TEXT segment of the DLL, which implements the service. If a service gets removed, its DLL may be unmapped from memory and then any attempt to invoke a method on the said objects will cause SEGV.
Such instances must contain a member of ACE_Dynamic_Service_Dependency initialized with the service they depend on. ACE_Dynamic_Service_Dependency's constructor and destructor are "magical" - they work by maintaining the underlying dynamic service's DLL reference count.