Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
OutputProducerRegistry Class Reference

Singleton registry for discovering output producers by format. More...

#include <outputproducerregistry.h>

Collaboration diagram for OutputProducerRegistry:

Public Member Functions

void registerProducer (IOutputProducer *producer)
 Registers producer with this registry.
void unregisterProducer (IOutputProducer *producer)
 Unregisters producer from this registry.
IOutputProducerproducerForFormat (const QString &format) const
 Returns the producer registered for format, or nullptr if none.
QList< IOutputProducer * > allProducers () const
 Returns all registered producers in unspecified order.

Static Public Member Functions

static OutputProducerRegistryinstance ()
 Returns the singleton registry instance.

Detailed Description

Singleton registry for discovering output producers by format.

See also
IOutputProducer, Generator

Definition at line 15 of file outputproducerregistry.h.

Member Function Documentation

◆ allProducers()

QList< IOutputProducer * > OutputProducerRegistry::allProducers ( ) const
nodiscard

Returns all registered producers in unspecified order.

Definition at line 79 of file outputproducerregistry.cpp.

◆ instance()

OutputProducerRegistry & OutputProducerRegistry::instance ( )
static

Returns the singleton registry instance.

Definition at line 21 of file outputproducerregistry.cpp.

◆ producerForFormat()

IOutputProducer * OutputProducerRegistry::producerForFormat ( const QString & format) const
nodiscard

Returns the producer registered for format, or nullptr if none.

The format comparison is case-sensitive.

Definition at line 71 of file outputproducerregistry.cpp.

◆ registerProducer()

void OutputProducerRegistry::registerProducer ( IOutputProducer * producer)

Registers producer with this registry.

The producer is indexed by its format() identifier, which is case-sensitive (see IOutputProducer::format()). If a producer with the same format is already registered, it will be replaced.

The format identifier must remain constant for the lifetime of the producer; changing it after registration may prevent successful unregistration.

See also
unregisterProducer()

Definition at line 40 of file outputproducerregistry.cpp.

◆ unregisterProducer()

void OutputProducerRegistry::unregisterProducer ( IOutputProducer * producer)

Unregisters producer from this registry.

The producer is only removed if it is currently the registered producer for its format. This prevents a replaced producer from accidentally unregistering its replacement during destruction.

See also
registerProducer()

Definition at line 57 of file outputproducerregistry.cpp.


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