Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_DLL_Singleton_T Class Template Reference

Same as ACE_Singleton, except that it registers for destruction with the ACE_Framework_Repository instead of with the ACE_Object_Manager directly. More...

`#include <Singleton.h>`

Collaboration diagram for ACE_DLL_Singleton_T:

[legend]
List of all members.

## Public Methods
const ACE_TCHAR * | dll_name (void)
const ACE_TCHAR * | name (void)
## Static Public Methods
TYPE * | instance (void)
| Global access point to the Singleton. More...
void | close (void)
| Explicitly delete the Singleton instance. More...
void | close_singleton (void)
void | dump (void)
| Dump the state of the object. More...
## Protected Methods
| ACE_DLL_Singleton_T (void)
| Default constructor. More...
| ~ACE_DLL_Singleton_T (void)
| Destructor. More...
## Static Protected Methods
ACE_DLL_Singleton_T< TYPE, ACE_LOCK > *& | instance_i (void)
| Get pointer to the singleton instance. More...
## Protected Attributes
TYPE | instance_
| Contained instance. More...
## Static Protected Attributes
ACE_DLL_Singleton_T< TYPE, ACE_LOCK > * | singleton_ = 0
| Pointer to the Singleton instance. More...

## Detailed Description

### template<class TYPE, class ACE_LOCK>
class ACE_DLL_Singleton_T< TYPE, ACE_LOCK >

Same as ACE_Singleton, except that it registers for destruction with the ACE_Framework_Repository instead of with the ACE_Object_Manager directly.

This version of ACE_Singleton should be used for singletons that live in a dll loaded either directly by ACE_DLL or indirectly by the ACE Service Configuration framework. Whenever ACE_DLL is ready to actually unload the dll, ACE_DLL_Singleton based dlls associated with that dll will be destroyed first. In fact, any singleton can safely use ACE_DLL_Singleton, even those that don't live in dlls. In that case, the singleton will be destroyed at normal program shutdown.

The only additional requirement is that the contained class export name() and dll_name() methods. See ACE_DLL_Singleton_Adapter_T below for a convenient example of how to satisfy this requirement for the dll_name().

Usage is the same as for ACE_Singleton, but note that if you you declare a friend, the friend class must still be an *ACE_Singleton*<T, [ACE_LOCK]>, not an ACE_Unmanaged_Singleton.

## Constructor & Destructor Documentation

template<class TYPE, class ACE_LOCK>
ACE_INLINE ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::ACE_DLL_Singleton_T | ( | void |  | ) | `[protected]`

| Default constructor.

template<class TYPE, class ACE_LOCK>
ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::~ACE_DLL_Singleton_T | ( | void |  | ) | `[protected]`

| Destructor.

## Member Function Documentation

template<class TYPE, class ACE_LOCK>
void ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::close | ( | void |  | ) | `[static]`

| Explicitly delete the Singleton instance.

template<class TYPE, class ACE_LOCK>
void ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::close_singleton | ( | void |  | ) | `[static]`

template<class TYPE, class ACE_LOCK>
const ACE_TCHAR * ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::dll_name | ( | void |  | ) |

template<class TYPE, class ACE_LOCK>
void ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::dump | ( | void |  | ) | `[static]`

| Dump the state of the object.

template<class TYPE, class ACE_LOCK>
TYPE * ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::instance | ( | void |  | ) | `[static]`

| Global access point to the Singleton.

template<class TYPE, class ACE_LOCK>
ACE_DLL_Singleton_T< TYPE, ACE_LOCK > *& ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::instance_i | ( | void |  | ) | `[static, protected]`

| Get pointer to the singleton instance.

template<class TYPE, class ACE_LOCK>
const ACE_TCHAR * ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::name | ( | void |  | ) |

## Member Data Documentation

template<class TYPE, class ACE_LOCK>
TYPE ACE_DLL_Singleton_T::instance_`[protected]`

| Contained instance.

template<class TYPE, class ACE_LOCK>
ACE_DLL_Singleton_T< TYPE, ACE_LOCK > * ACE_DLL_Singleton_T< TYPE, ACE_LOCK >::singleton_ = 0`[static, protected]`

| Pointer to the Singleton instance.

The documentation for this class was generated from the following files:

- Singleton.h
- Singleton.cpp
- Singleton.i