Usd Notice Framework
0.7.0
|
Intermediate object between the Usd Stage and any clients that needs asynchronous handling and upstream filtering of notices. More...
#include <broker.h>
Public Member Functions | |
UNF_API | Broker (const Broker &)=delete |
Remove default copy constructor. | |
UNF_API Broker & | operator= (const Broker &)=delete |
Remove default assignment operator. | |
UNF_API const PXR_NS::UsdStageWeakPtr | GetStage () const |
Return Usd Stage associated with the broker. | |
UNF_API bool | IsInTransaction () |
Indicate whether a notice transaction has been started. More... | |
UNF_API void | BeginTransaction (CapturePredicate predicate=CapturePredicate::Default()) |
Start a notice transaction. More... | |
UNF_API void | BeginTransaction (const CapturePredicateFunc &) |
Start a notice transaction with a capture predicate function. More... | |
UNF_API void | EndTransaction () |
Stop a notice transaction. More... | |
template<class UnfNotice , class... Args> | |
void | Send (Args &&... args) |
Create and send a UnfNotice::StageNotice notice via the broker. More... | |
UNF_API void | Send (const UnfNotice::StageNoticeRefPtr &) |
Send a UnfNotice::StageNotice notice via the broker. More... | |
UNF_API DispatcherPtr & | GetDispatcher (std::string identifier) |
Return dispatcher reference associated with identifier . | |
template<class T > | |
void | AddDispatcher () |
Create and register a new dispatcher. More... | |
UNF_API void | Reset () |
Un-register broker. More... | |
Static Public Member Functions | |
static UNF_API BrokerPtr | Create (const PXR_NS::UsdStageWeakPtr &stage) |
Create a broker from a Usd Stage. More... | |
static UNF_API void | ResetAll () |
Un-register all brokers. | |
Intermediate object between the Usd Stage and any clients that needs asynchronous handling and upstream filtering of notices.
|
static |
Create a broker from a Usd Stage.
If a broker has already been created from this stage
, it will be returned. Otherwise, a new one will be created and returned.
UNF_API bool unf::Broker::IsInTransaction | ( | ) |
Indicate whether a notice transaction has been started.
UNF_API void unf::Broker::BeginTransaction | ( | CapturePredicate | predicate = CapturePredicate::Default() | ) |
Start a notice transaction.
Notices derived from UnfNotice::StageNotice will be held during the transaction and emitted at the end.
By default, all UnfNotice::StageNotice notices will be captured during the entire scope of the transaction. A CapturePredicate can be passed to influence which notices are captured. Notices that are not captured will not be emitted.
UNF_API void unf::Broker::BeginTransaction | ( | const CapturePredicateFunc & | ) |
Start a notice transaction with a capture predicate function.
The following example will filter out all 'Foo' notices emitted during the transaction.
UNF_API void unf::Broker::EndTransaction | ( | ) |
Stop a notice transaction.
This will trigger the emission of all captured UnfNotice::StageNotice notices. Each notice type will be consolidated before emission if applicable.
void unf::Broker::Send | ( | Args &&... | args | ) |
Create and send a UnfNotice::StageNotice notice via the broker.
UNF_API void unf::Broker::Send | ( | const UnfNotice::StageNoticeRefPtr & | ) |
Send a UnfNotice::StageNotice notice via the broker.
void unf::Broker::AddDispatcher |
Create and register a new dispatcher.
This will call the Dispatcher::Register method.
UNF_API void unf::Broker::Reset | ( | ) |
Un-register broker.