TSDuck Version 3.32-2769 (TSDuck - The MPEG Transport Stream Toolkit)
ts::ObjectRepository Class Reference

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

Public Member Functions

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

Static Public Member Functions

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

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 ( )
static

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: