Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
unity::scopes::SearchQueryBase Class Referenceabstract

Abstract base class to represent a particular query. More...

#include <unity/scopes/SearchQueryBase.h>

Inheritance diagram for unity::scopes::SearchQueryBase:

Public Member Functions

virtual void run (SearchReplyProxy const &reply)=0
 Called by scopes run time to start the query. More...
 
Subquery methods

The subsearch() methods are for use by aggregating scopes. When an aggregator passes a query to its child scopes, it should use subsearch() instead of the normal Scope::search() that would be called by a client. subsearch() takes care of automatically forwarding query cancellation to child scopes. This means that there is no need for an aggregating scope to explicitly forward cancellation to child scopes when its QueryBase::cancelled() method is called by the scopes run time.

QueryCtrlProxy subsearch (ScopeProxy const &scope, std::string const &query_string, SearchListenerBase::SPtr const &reply)
 
QueryCtrlProxy subsearch (ScopeProxy const &scope, std::string const &query_string, FilterState const &filter_state, SearchListenerBase::SPtr const &reply)
 
QueryCtrlProxy subsearch (ScopeProxy const &scope, std::string const &query_string, std::string const &department_id, FilterState const &filter_state, SearchListenerBase::SPtr const &reply)
 
QueryCtrlProxy subsearch (ScopeProxy const &scope, std::string const &query_string, std::string const &department_id, FilterState const &filter_state, SearchMetadata const &hints, SearchListenerBase::SPtr const &reply)
 
- Public Member Functions inherited from unity::scopes::QueryBase
virtual void cancelled ()=0
 Called by the scopes run time when the query originator cancels a query. More...
 

Detailed Description

Abstract base class to represent a particular query.

A scope must return an instance of this class from its implementation of ScopeBase::create_query().

Note
The constructor of the instance must complete in a timely manner. Do not perform anything in the constructor that might block.

Member Function Documentation

virtual void unity::scopes::SearchQueryBase::run ( SearchReplyProxy const &  reply)
pure virtual

Called by scopes run time to start the query.

Your implementation of run() can use the reply proxy to push results for the query. You can push results from within run(), in which case the query 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 query completes either when run() returns, or when the last stored reply proxy goes out of scope (whichever happens last).

Parameters
replyThe proxy on which to push results for the query.

The documentation for this class was generated from the following file: