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

#include <tsObjectRepository.h>

Public Member Functions

void erase (const UString &name)
ObjectPtr retrieve (const UString &name) const
ObjectPtr store (const UString &name, const ObjectPtr &value)

Static Public Member Functions

static ObjectRepository & Instance ()
 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()

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) const

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: