Unity Scopes API
|
Abstract base class to represent a particular preview. More...
#include <unity/scopes/PreviewQueryBase.h>
Public Member Functions | |
virtual void | run (PreviewReplyProxy const &reply)=0 |
Called by scopes run time to start the preview. More... | |
Result | result () const |
Get result for this preview request. More... | |
ActionMetadata | action_metadata () const |
Get metadata for this preview request. More... | |
![]() | |
virtual void | cancelled ()=0 |
Called by the scopes run time when the query originator cancels a query. More... | |
bool | valid () const |
Check whether this query is still valid. More... | |
unity::scopes::VariantMap | settings () const |
Returns a dictionary with the scope's current settings. More... | |
Protected Member Functions | |
PreviewQueryBase (Result const &result, ActionMetadata const &metadata) | |
Abstract base class to represent a particular preview.
A scope must return an instance of this class from its implementation of ScopeBase::preview().
ActionMetadata unity::scopes::PreviewQueryBase::action_metadata | ( | ) | const |
Get metadata for this preview request.
unity::LogicException | if preview metadata was not initialized (the default ctor was used). |
Result unity::scopes::PreviewQueryBase::result | ( | ) | const |
Get result for this preview request.
unity::LogicException | if result was not initialized (the default ctor was used). |
|
pure virtual |
Called by scopes run time to start the preview.
Your implementation of run() can use the reply proxy to push results for the preview. You can push results from within run(), in which case the preview implicitly completes when run() returns. Alternatively, run() can store the reply proxy and return immediately. In this case, you can use the stored proxy to push results from another thread. It is safe to call push()
from multiple threads without synchronization.
The preview completes either when run() returns, or when the last stored reply proxy goes out of scope (whichever happens last).
reply | The proxy on which to push results for the preview. |