Ocean
Ocean::Test::TestDataManager Class Reference

The class implements the manager for test data collections as a singleton object. More...

Inheritance diagram for Ocean::Test::TestDataManager:

Public Types

using ScopedSubscription = ScopedSubscriptionT< std::string, TestDataManager >
 Definition of a scoped subscription object for for data collections. More...
 
using ScopedSubscriptions = std::vector< ScopedSubscription >
 Definition of a vector holding scoped subscription objects. More...
 

Public Member Functions

SharedTestDataCollection testDataCollection (const std::string &name) const
 Returns a specific test data collection. More...
 
ScopedSubscription registerTestDataCollection (const std::string &name, std::unique_ptr< TestDataCollection > &&testDataCollection)
 Registers a new test data collection. More...
 

Protected Types

using TestDataCollectionPair = std::pair< unsigned int, std::shared_ptr< TestDataCollection > >
 Definition of a pair combining a counter with a shared pointer. More...
 
using TestDataCollectionMap = std::unordered_map< std::string, TestDataCollectionPair >
 Definition of an unordered map mapping collection names to collection objects. More...
 

Protected Member Functions

 TestDataManager ()
 Protected default constructor. More...
 
void unregisterTestDataCollection (const std::string &name)
 Unregisters a registered data collection. More...
 
- Protected Member Functions inherited from Ocean::Singleton< TestDataManager >
 Singleton ()=default
 Default constructor. More...
 

Protected Attributes

TestDataCollectionMap testDataCollectionMap_
 The map mapping collection names to collection objects. More...
 
Lock lock_
 The manager's lock. More...
 

Friends

class Singleton< TestDataManager >
 
class TestDataCollection
 

Additional Inherited Members

- Static Public Member Functions inherited from Ocean::Singleton< TestDataManager >
static TestDataManager & get ()
 Returns a reference to the unique object. More...
 

Detailed Description

The class implements the manager for test data collections as a singleton object.

Member Typedef Documentation

◆ ScopedSubscription

Definition of a scoped subscription object for for data collections.

◆ ScopedSubscriptions

Definition of a vector holding scoped subscription objects.

◆ TestDataCollectionMap

using Ocean::Test::TestDataManager::TestDataCollectionMap = std::unordered_map<std::string, TestDataCollectionPair>
protected

Definition of an unordered map mapping collection names to collection objects.

◆ TestDataCollectionPair

using Ocean::Test::TestDataManager::TestDataCollectionPair = std::pair<unsigned int, std::shared_ptr<TestDataCollection> >
protected

Definition of a pair combining a counter with a shared pointer.

Constructor & Destructor Documentation

◆ TestDataManager()

Ocean::Test::TestDataManager::TestDataManager ( )
protected

Protected default constructor.

Member Function Documentation

◆ registerTestDataCollection()

ScopedSubscription Ocean::Test::TestDataManager::registerTestDataCollection ( const std::string &  name,
std::unique_ptr< TestDataCollection > &&  testDataCollection 
)

Registers a new test data collection.

Parameters
nameThe name of the new collection, be valid, must not exist already
testDataCollectionThe new test data collection to register, must be valid
Returns
The scoped subscription object associated with the data collection, the collection will be registered as long as the scoped subscription object exists

◆ testDataCollection()

SharedTestDataCollection Ocean::Test::TestDataManager::testDataCollection ( const std::string &  name) const

Returns a specific test data collection.

Parameters
nameThe name of the test data collection to return, must be valid
Returns
The requested test data collection, nullptr if it does not exist

◆ unregisterTestDataCollection()

void Ocean::Test::TestDataManager::unregisterTestDataCollection ( const std::string &  name)
protected

Unregisters a registered data collection.

Parameters
nameThe name of the data collection to unregister, must be valid

Friends And Related Function Documentation

◆ Singleton< TestDataManager >

friend class Singleton< TestDataManager >
friend

◆ TestDataCollection

friend class TestDataCollection
friend

Field Documentation

◆ lock_

Lock Ocean::Test::TestDataManager::lock_
mutableprotected

The manager's lock.

◆ testDataCollectionMap_

TestDataCollectionMap Ocean::Test::TestDataManager::testDataCollectionMap_
protected

The map mapping collection names to collection objects.


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