NamedRegistries |
The class NamedRegistries (see Figure C-7) manages all instances of TestFactoryRegistry and is responsible for their creation and destruction. It also keeps track of which instances of TestFactory have been destroyed , thus preventing multiple deletions.
NamedRegistries is a singleton: there is one and only one static instance of it. Thus, it has no constructor. A reference to the single NamedRegistries object is obtained using its static getInstance( ) method.
NamedRegistries belongs to the namespace CppUnit . It is declared and implemented in TestFactoryRegistry.cpp .
class NamedRegistries
A destructor. Deletes all instances of TestFactoryRegistry .
Gets a reference to the single NamedRegistries object.
Returns the named TestFactoryRegistry if it exists; otherwise , creates a new one with the given name and returns it.
Returns TRUE if factory has not yet been destroyed.
Signals that factory was destroyed.
None.
Defines the type Registries as a map of TestFactoryRegistry by name ( private ).
Defines the type Factories as a set of TestFactory ( private ).
Contains managed instances of TestFactoryRegistry ( private ).
Contains instances of TestFactory that have been destroyed ( private ).
Contains instances of TestFactory that need to be destroyed ( private ).