|
MXL : Media eXchange Layer
MXL
|
#include <Instance.hpp>

Classes | |
| class | RefCounted |
Public Member Functions | |
| FlowSynchronizationGroup * | createFlowSynchronizationGroup () |
| std::tuple< mxlFlowConfigInfo, FlowWriter *, bool > | createFlowWriter (std::string const &flowDef, std::optional< std::string > options={}) |
| std::size_t | garbageCollect () const |
| std::string | getDomain () const |
| std::string | getFlowDef (uuids::uuid const &flowId) const |
| FlowReader * | getFlowReader (std::string const &flowId) |
| std::uint64_t | getHistoryDurationNs () const |
| Instance (Instance &&)=delete | |
| Instance (Instance const &)=delete | |
| Instance (std::filesystem::path const &mxlDomain, std::string const &options, std::unique_ptr< FlowIoFactory > &&flowIoFactory, DomainWatcher::ptr watcher) | |
| Instance & | operator= (Instance &&)=delete |
| Instance & | operator= (Instance const &)=delete |
| void | releaseFlowSynchronizationGroup (FlowSynchronizationGroup const *group) |
| void | releaseReader (FlowReader *reader) |
| void | releaseWriter (FlowWriter *writer) |
| ~Instance () | |
| Dtor. Release all readers and writers. | |
Private Member Functions | |
| std::pair< std::unique_ptr< FlowData >, bool > | createOrOpenContinuousFlowData (std::string const &flowDef, FlowParser const &, FlowOptionsParser const &) |
| std::pair< std::unique_ptr< FlowData >, bool > | createOrOpenDiscreteFlowData (std::string const &flowDef, FlowParser const &, FlowOptionsParser const &) |
| void | parseOptions (std::string const &options) |
Private Attributes | |
| std::unique_ptr< FlowIoFactory > | _flowIoFactory |
| The I/O factor used to delegate the creation of readers and writers. | |
| FlowManager | _flowManager |
| Performs flow CRUD operations. | |
| std::uint64_t | _historyDuration |
| Ring buffer history duration in nanoseconds. | |
| std::mutex | _mutex |
| Protects the maps. | |
| std::string | _options |
| For future use. | |
| std::map< uuids::uuid, RefCounted< FlowReader > > | _readers |
| Maps flow uuids to flow readers. | |
| std::atomic_bool | _stopping |
| std::forward_list< FlowSynchronizationGroup > | _syncGroups |
| The set of active flow synchronization groups. | |
| DomainWatcher::ptr | _watcher |
| std::map< uuids::uuid, RefCounted< FlowWriter > > | _writers |
| Maps flow uuids to flow writers. | |
Manages mxl resources allocated by the SDK user. Represents a single mxfInstance.
Definition at line 31 of file Instance.hpp.
| mxl::lib::Instance::Instance | ( | std::filesystem::path const & | mxlDomain, |
| std::string const & | options, | ||
| std::unique_ptr< FlowIoFactory > && | flowIoFactory, | ||
| DomainWatcher::ptr | watcher ) |
Creates an instance
| [in] | mxlDomain | The directory where the shared memory files will be created |
| [in] | options | Additional options. |
| [in] | flowIoFactory | A factory used to create flow readers for flows of different types. |
| [in] | watcher | A DomainWatcher that is shared with the flowIoFactory |
Definition at line 125 of file Instance.cpp.
| mxl::lib::Instance::~Instance | ( | ) |
Dtor. Release all readers and writers.
Definition at line 143 of file Instance.cpp.
|
delete |
|
delete |
| FlowSynchronizationGroup * mxl::lib::Instance::createFlowSynchronizationGroup | ( | ) |
Create a flow synchronization group.
Definition at line 443 of file Instance.cpp.
| std::tuple< mxlFlowConfigInfo, FlowWriter *, bool > mxl::lib::Instance::createFlowWriter | ( | std::string const & | flowDef, |
| std::optional< std::string > | options = {} ) |
| [in] | flowDef | The json flow definition according to the NMOS Flow Resource json schema |
| [in] | options | Additional options for flow creation |
Definition at line 239 of file Instance.cpp.
|
private |
Definition at line 318 of file Instance.cpp.
|
private |
Definition at line 294 of file Instance.cpp.
| std::size_t mxl::lib::Instance::garbageCollect | ( | ) | const |
Garbage collect the inactive flows. This will remove any flows that are not being used by any readers or writers.
Definition at line 364 of file Instance.cpp.
| std::string mxl::lib::Instance::getDomain | ( | ) | const |
Accessor for the domain path
Definition at line 351 of file Instance.cpp.
| std::string mxl::lib::Instance::getFlowDef | ( | uuids::uuid const & | flowId | ) | const |
| FlowReader * mxl::lib::Instance::getFlowReader | ( | std::string const & | flowId | ) |
Create a FlowReader or obtain an additional reference to a previously created FlowReader.
| [in] | flowId | The id of the flow to obtain a reader for |
| std::invalid_argument | if flowId is not a valid UUID. |
Definition at line 169 of file Instance.cpp.
| std::uint64_t mxl::lib::Instance::getHistoryDurationNs | ( | ) | const |
Accessor for the history duration value
Definition at line 438 of file Instance.cpp.
|
private |
Parses the options json string (if non empty) and merges it with the optional domain-wide options (if defined in the domain). Values defined at the instance level will override the domain-wide value.
| options | The options json string |
Definition at line 422 of file Instance.cpp.
| void mxl::lib::Instance::releaseFlowSynchronizationGroup | ( | FlowSynchronizationGroup const * | group | ) |
Release a reference to a flow synchronization group in order to free all resources associated with it.
| [in] | group | a pointer to a flow synchronization group previously obtained by a call to createFlowSynchronizationGroup(). |
Definition at line 448 of file Instance.cpp.
| void mxl::lib::Instance::releaseReader | ( | FlowReader * | reader | ) |
Release a reference to a FlowReader in order to ultimately free all resources associated with it, once the last reference is dropped.
| [in] | reader | a pointer to a reader previously obtained by a call to getFlowReader. |
Definition at line 193 of file Instance.cpp.
| void mxl::lib::Instance::releaseWriter | ( | FlowWriter * | writer | ) |
Release a reference to a FlowWriter in order to ultimately free all resources associated with it, once the last reference is dropped.
| [in] | writer | a pointer to a writer previously obtained by a call to getFlowWriter. |
Definition at line 215 of file Instance.cpp.
|
private |
The I/O factor used to delegate the creation of readers and writers.
Definition at line 170 of file Instance.hpp.
|
private |
Performs flow CRUD operations.
Definition at line 167 of file Instance.hpp.
|
private |
Ring buffer history duration in nanoseconds.
Definition at line 187 of file Instance.hpp.
|
private |
Protects the maps.
Definition at line 178 of file Instance.hpp.
|
private |
For future use.
Definition at line 184 of file Instance.hpp.
|
private |
Maps flow uuids to flow readers.
Definition at line 173 of file Instance.hpp.
|
private |
Definition at line 191 of file Instance.hpp.
|
private |
The set of active flow synchronization groups.
Definition at line 181 of file Instance.hpp.
|
private |
Definition at line 189 of file Instance.hpp.
|
private |
Maps flow uuids to flow writers.
Definition at line 175 of file Instance.hpp.