Ocean
|
The class implements the manager for test data collections as a singleton object. More...
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... | |
The class implements the manager for test data collections as a singleton object.
using Ocean::Test::TestDataManager::ScopedSubscription = ScopedSubscriptionT<std::string, TestDataManager> |
Definition of a scoped subscription object for for data collections.
using Ocean::Test::TestDataManager::ScopedSubscriptions = std::vector<ScopedSubscription> |
Definition of a vector holding scoped subscription objects.
|
protected |
Definition of an unordered map mapping collection names to collection objects.
|
protected |
Definition of a pair combining a counter with a shared pointer.
|
protected |
Protected default constructor.
ScopedSubscription Ocean::Test::TestDataManager::registerTestDataCollection | ( | const std::string & | name, |
std::unique_ptr< TestDataCollection > && | testDataCollection | ||
) |
Registers a new test data collection.
name | The name of the new collection, be valid, must not exist already |
testDataCollection | The new test data collection to register, must be valid |
SharedTestDataCollection Ocean::Test::TestDataManager::testDataCollection | ( | const std::string & | name | ) | const |
Returns a specific test data collection.
name | The name of the test data collection to return, must be valid |
|
protected |
Unregisters a registered data collection.
name | The name of the data collection to unregister, must be valid |
|
friend |
|
friend |
|
mutableprotected |
The manager's lock.
|
protected |
The map mapping collection names to collection objects.