Trivial borrowed codec handle; never owns or deletes the codec.
More...
#include <StormByte/multimedia/typedefs.hxx>
|
| constexpr | CodecRef () noexcept=default |
| | Constructs an empty handle.
|
| constexpr | CodecRef (const Codec &codec) noexcept |
| | Borrows a codec.
|
| constexpr | CodecRef (const CodecRef &other) noexcept=default |
| | Copies the borrowed pointer.
|
| constexpr | CodecRef (CodecRef &&other) noexcept=default |
| | Copies the borrowed pointer without clearing the source.
|
| | ~CodecRef () noexcept=default |
| | Destroys the handle, not its codec.
|
| constexpr CodecRef & | operator= (const CodecRef &other) noexcept=default |
| | Copies the borrowed pointer.
|
| constexpr CodecRef & | operator= (CodecRef &&other) noexcept=default |
| | Copies the borrowed pointer without clearing the source.
|
| constexpr | operator bool () const noexcept |
| | Tests whether a codec is borrowed.
|
| constexpr const Codec & | get () const noexcept |
| | Gets the borrowed codec, preserving reference_wrapper syntax.
|
| constexpr | operator const Codec & () const noexcept |
| | Converts to the borrowed codec reference.
|
Trivial borrowed codec handle; never owns or deletes the codec.
- Note
- The codec must outlive every handle. Registry handles are valid until registry teardown, with the provider loaded and a compatible compiler, standard-library ABI and provider layout. Empty handles cannot be dereferenced.
◆ CodecRef() [1/4]
| StormByte::Multimedia::CodecRef::CodecRef |
( |
| ) |
|
|
constexprdefaultnoexcept |
Constructs an empty handle.
◆ CodecRef() [2/4]
| StormByte::Multimedia::CodecRef::CodecRef |
( |
const Codec & | codec | ) |
|
|
inlineconstexprnoexcept |
Borrows a codec.
- Parameters
-
| codec | Codec that must outlive the handle. |
◆ CodecRef() [3/4]
| StormByte::Multimedia::CodecRef::CodecRef |
( |
const CodecRef & | other | ) |
|
|
constexprdefaultnoexcept |
Copies the borrowed pointer.
- Parameters
-
◆ CodecRef() [4/4]
| StormByte::Multimedia::CodecRef::CodecRef |
( |
CodecRef && | other | ) |
|
|
constexprdefaultnoexcept |
Copies the borrowed pointer without clearing the source.
- Parameters
-
◆ ~CodecRef()
| StormByte::Multimedia::CodecRef::~CodecRef |
( |
| ) |
|
|
defaultnoexcept |
Destroys the handle, not its codec.
◆ get()
| const Codec & StormByte::Multimedia::CodecRef::get |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Gets the borrowed codec, preserving reference_wrapper syntax.
- Precondition
- The handle is nonempty and its codec is alive.
- Returns
- Borrowed codec.
◆ operator bool()
| StormByte::Multimedia::CodecRef::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexprnoexcept |
Tests whether a codec is borrowed.
- Returns
- True for a nonempty handle.
◆ operator const Codec &()
| StormByte::Multimedia::CodecRef::operator const Codec & |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Converts to the borrowed codec reference.
- Precondition
- The handle is nonempty and its codec is alive.
- Returns
- Borrowed codec.
◆ operator=() [1/2]
Copies the borrowed pointer without clearing the source.
- Parameters
-
- Returns
- This handle.
◆ operator=() [2/2]
Copies the borrowed pointer.
- Parameters
-
- Returns
- This handle.
The documentation for this class was generated from the following file: