TSDuck v3.38-3675
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::ObjectRepository Class Reference

A global repository of general-purpose base class for polymophic objects. More...

#include <tsObjectRepository.h>

Public Member Functions

void erase (const UString &name)
 Erase an object from the repository.
 
ObjectPtr retrieve (const UString &name)
 Get the safe pointer to an Object in the repository.
 
ObjectPtr store (const UString &name, const ObjectPtr &value)
 Store a safe pointer to an Object (or typically a subclass thereof) in the repository.
 

Static Public Member Functions

static ObjectRepositoryInstance ()
 Get the instance of the singleton of this class.
 

Detailed Description

A global repository of general-purpose base class for polymophic objects.

The repository is a thread-safe singleton. It can be used as a central repository of user-defined objects which is shared by all modules, all plugins, all threads.

Member Function Documentation

◆ Instance()

static ObjectRepository & ts::ObjectRepository::Instance ( )
inlinestatic

Get the instance of the singleton of this class.

Returns
The instance of the singleton of this class.

◆ store()

ObjectPtr ts::ObjectRepository::store ( const UString name,
const ObjectPtr value 
)

Store a safe pointer to an Object (or typically a subclass thereof) in the repository.

Parameters
[in]nameEach stored pointer is associated to a name.
[in]valueSafe-pointer to the object to store.
Returns
The previous value which was associated to that name or a null pointer when not previously assigned.

◆ retrieve()

ObjectPtr ts::ObjectRepository::retrieve ( const UString name)

Get the safe pointer to an Object in the repository.

Parameters
[in]nameName which is associated to the object.
Returns
A safe-pointer to the stored object or a null pointer when not found.

◆ erase()

void ts::ObjectRepository::erase ( const UString name)

Erase an object from the repository.

Parameters
[in]nameName which is associated to the object to erase.

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