CppUnit project page FAQ CppUnit home page

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

CppUnit::TestFactoryRegistry Class Reference

This class implements a registry for test factory. More...

#include <TestFactoryRegistry.h>

Inheritance diagram for CppUnit::TestFactoryRegistry:

Inheritance graph
[legend]
Collaboration diagram for CppUnit::TestFactoryRegistry:

Collaboration graph
[legend]
List of all members.

Public Methods

 TestFactoryRegistry (std::string name="All Tests")
 Constructs the registry with the specified name. More...

virtual ~TestFactoryRegistry ()
 Destructor. More...

virtual TestmakeTest ()
 Makes a suite containing all the registered test. More...

void addTestToSuite (TestSuite *suite)
 Adds the registered test to the specified suite. More...

void registerFactory (const std::string &name, TestFactory *factory)
 Registers a test factory with the specified name. More...

void registerFactory (TestFactory *factory)
 Registers a test factory using its class name. More...


Static Public Methods

TestFactoryRegistry & getRegistry ()
 Returns the registry. More...

TestFactoryRegistry & getRegistry (const std::string &name)
 Returns a named registry. More...


Private Types

typedef std::map< std::string,
TestFactory *> 
Factories
typedef std::map< std::string,
TestFactoryRegistry *> 
NamedRegistries

Private Methods

 TestFactoryRegistry (const TestFactoryRegistry &copy)
void operator= (const TestFactoryRegistry &copy)

Private Attributes

Factories m_factories
std::string m_name

Detailed Description

This class implements a registry for test factory.

Note that the registry assume lifetime control for any registered test.


Member Typedef Documentation

typedef std::map<std::string, TestFactory *> CppUnit::TestFactoryRegistry::Factories [private]
 

typedef std::map<std::string, TestFactoryRegistry *> CppUnit::TestFactoryRegistry::NamedRegistries [private]
 


Constructor & Destructor Documentation

CppUnit::TestFactoryRegistry::TestFactoryRegistry std::string   name = "All Tests"
 

Constructs the registry with the specified name.

Parameters:
name   Name of the registry.

CppUnit::TestFactoryRegistry::~TestFactoryRegistry   [virtual]
 

Destructor.

CppUnit::TestFactoryRegistry::TestFactoryRegistry const TestFactoryRegistry &   copy [private]
 


Member Function Documentation

void CppUnit::TestFactoryRegistry::addTestToSuite TestSuite *   suite
 

Adds the registered test to the specified suite.

Parameters:
suite   Suite the test are added to.

TestFactoryRegistry & CppUnit::TestFactoryRegistry::getRegistry const std::string &   name [static]
 

Returns a named registry.

Parameters:
name   Name of the registry to return.
Returns:
Registry. If the registry does not exist, it is created.

TestFactoryRegistry & CppUnit::TestFactoryRegistry::getRegistry   [static]
 

Returns the registry.

Returns:
Registry.

Test * CppUnit::TestFactoryRegistry::makeTest   [virtual]
 

Makes a suite containing all the registered test.

Returns:
A new suite containing all the registered test.

Reimplemented from CppUnit::TestFactory.

void CppUnit::TestFactoryRegistry::operator= const TestFactoryRegistry &   copy [private]
 

void CppUnit::TestFactoryRegistry::registerFactory TestFactory *   factory
 

Registers a test factory using its class name.

Parameters:
factory   Factory to register.

void CppUnit::TestFactoryRegistry::registerFactory const std::string &   name,
TestFactory *   factory
 

Registers a test factory with the specified name.

Parameters:
name   Name associated to the factory.
factory   Factory to register.


Member Data Documentation

Factories CppUnit::TestFactoryRegistry::m_factories [private]
 

std::string CppUnit::TestFactoryRegistry::m_name [private]
 


The documentation for this class was generated from the following files:
SourceForge Logo hosts this site. Send comments to:
CppUnit Developers