unity.scopes.Registry
White pages service for available scopes.
More...
#include <unity/scopes/Registry.h>
Inheritance diagram for unity::scopes::Registry:
src="https://assets.ubuntu.com/v1/7748ae41-classunity_1_1scopes_1_1_registry__inherit__graph.png" border="0" alt="Inheritance graph"/>
|
virtual ScopeMetadata | get_metadata (std::string const &scope_id)=0 |
| Returns the metadata for the scope with the given ID. More...
|
|
virtual MetadataMap | list ()=0 |
| Returns a map containing the metadata for all scopes. More...
|
|
virtual MetadataMap | list_if (std::function< bool(ScopeMetadata const &item)> predicate)=0 |
| Returns a map containing only those scopes for which predicate returns true. More...
|
|
virtual bool | is_scope_running (std::string const &scope_id)=0 |
| Returns whether a scope is currently running or not. More...
|
|
virtual core::ScopedConnection | set_scope_state_callback (std::string const &scope_id, std::function< void(bool is_running)> callback)=0 |
| Assigns a callback method to be executed when a scope's running state (started / stopped) changes. More...
|
|
virtual core::ScopedConnection | set_list_update_callback (std::function< void()> callback)=0 |
| Assigns a callback method to be executed when the registry's scope list changes. More...
|
|
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...
|
|
White pages service for available scopes.
You can obtain a proxy to the registry by calling Runtime::registry().
virtual ScopeMetadata unity::scopes::Registry::get_metadata |
( |
std::string const & |
scope_id | ) |
|
|
pure virtual |
Returns the metadata for the scope with the given ID.
- Parameters
-
scope_id | The ID of the scope from which we wish to retrieve metadata. |
- Returns
- The metadata for the scope.
- Exceptions
-
virtual bool unity::scopes::Registry::is_scope_running |
( |
std::string const & |
scope_id | ) |
|
|
pure virtual |
Returns whether a scope is currently running or not.
- Parameters
-
scope_id | The ID of the scope from which we wish to retrieve state. |
- Returns
- True if the scope is running, and False if it is not running.
- Exceptions
-
Returns a map containing the metadata for all scopes.
- Returns
- The metadata for all scopes.
Returns a map containing only those scopes for which predicate
returns true.
- Parameters
-
predicate | a function object that must return true for each metadata item to be included in the map. |
- Returns
- The metadata items for which the predicate returned true.
virtual core::ScopedConnection unity::scopes::Registry::set_list_update_callback |
( |
std::function< void()> |
callback | ) |
|
|
pure virtual |
Assigns a callback method to be executed when the registry's scope list changes.
Note: Upon receiving this callback, you should retrieve the updated scopes list via the list() method if you wish to retain synchronisation between client and server.
- Parameters
-
callback | The function object that is invoked when an update occurs. |
- Exceptions
-
virtual core::ScopedConnection unity::scopes::Registry::set_scope_state_callback |
( |
std::string const & |
scope_id, |
|
|
std::function< void(bool is_running)> |
callback |
|
) |
| |
|
pure virtual |
Assigns a callback method to be executed when a scope's running state (started / stopped) changes.
- Parameters
-
scope_id | The ID of the scope from which we wish to retrieve state changes. |
callback | The function object that is invoked when a scope changes running state. |
- Exceptions
-