unity.scopes.Reply

Allows query termination to be sent to the source of a query. More...

#include <unity/scopes/Reply.h>

Inheritance diagram for unity::scopes::Reply: src="https://assets.ubuntu.com/v1/c7c219a6-classunity_1_1scopes_1_1_reply__inherit__graph.png" border="0" alt="Inheritance graph"/>

Public Member Functions

virtual void finished ()=0
 Informs the source of a query that the query results are complete. More...
 
virtual void error (std::exception_ptr ex)=0
 Informs the source of a query that the query was terminated due to an error. More...
 
virtual void info (OperationInfo const &op_info)=0
 Informs the source of a query that additional information regarding the reply is available. More...
 
virtual ~Reply ()
 Destroys a Reply. More...
 
src="https://assets.ubuntu.com/v1/c6607712-closed.png" alt="-"/> Public Member Functions inherited from unity::scopes::Object
virtual std::string endpoint ()=0
 Returns the endpoint this proxy connects to. More...
 
virtual std::string identity ()=0
 Returns the identity of the target object of this proxy. More...
 
virtual std::string target_category ()=0
 Returns the category of the target object of this proxy. More...
 
virtual int64_t timeout ()=0
 Returns the timeout in milliseconds if this proxy is a twoway proxy. More...
 
virtual std::string to_string ()=0
 Converts a proxy into its string representation. More...
 

Detailed Description

Allows query termination to be sent to the source of a query.

Constructor & Destructor Documentation

virtual unity::scopes::Reply::~Reply ( )
virtual

Destroys a Reply.

If a Reply goes out of scope without a prior call to finished(), the destructor implicitly calls finished(), provided QueryBase::run() has returned.

Member Function Documentation

virtual void unity::scopes::Reply::error ( std::exception_ptr  ex)
pure virtual

Informs the source of a query that the query was terminated due to an error.

Multiple calls to error() and calls to finished() after error() was called are ignored.

Parameters
exAn exception_ptr indicating the cause of the error. If ex is a std::exception, the return value of what() is made available to the query source. Otherwise, the query source receives "unknown exception".
virtual void unity::scopes::Reply::finished ( )
pure virtual

Informs the source of a query that the query results are complete.

Calling finished() informs the source of a query that the final result for the query was sent, that is, that the query is complete. Multiple calls to finished() and calls to error() after finished() was called are ignored. The destructor implicitly calls finished() if a Reply goes out of scope without a prior call to finished(). Similarly, QueryBase::run() implicitly calls finished() when it returns, provided there are no more reply proxies in scope. In other words, calling finished() is optional. The scopes runtime ensures that the call happens automatically, either when the last reply proxy goes out of scope, or when QueryBase::run() returns (whichever happens last).

virtual void unity::scopes::Reply::info ( OperationInfo const &  op_info)
pure virtual

Informs the source of a query that additional information regarding the reply is available.

Calling info() does not terminate the query, it simply informs the source that something interesting occured during execution of the query (usually affecting the results returned in some way).

Multiple calls to info() for each condition are legal.

Parameters
op_infoContains all details of the information being reported.