addtogroup gazebo_util More...
#include <util/util.hh>
Public Member Functions | |
IntrospectionClient () | |
Constructor. More... | |
virtual | ~IntrospectionClient () |
Destructor. More... | |
bool | IsRegistered (const std::string &_managerId, const std::string &_item) const |
Check if the _item is registered on a manager with _managerId. More... | |
bool | IsRegistered (const std::string &_managerId, const std::set< std::string > &_items) const |
Check if the _items are registered on a manager with _managerId. More... | |
bool | Items (const std::string &_managerId, std::set< std::string > &_items) const |
Get a copy of the items already registered. More... | |
bool | Items (const std::string &_managerId, const std::function< void(const std::set< std::string > &_items, const bool _result)> &_cb) const |
Get a copy of the items already registered. More... | |
std::set< std::string > | Managers () const |
Get the list of introspection managers currently available. More... | |
bool | NewFilter (const std::string &_managerId, const std::set< std::string > &_newItems, std::string &_filterId, std::string &_newTopic) const |
Create a new filter for observing item updates. More... | |
bool | NewFilter (const std::string &_managerId, const std::set< std::string > &_newItems, const std::function< void(const std::string &_filterId, const std::string &_newTopic, const bool _result)> &_cb) const |
Create a new filter for observing item updates. More... | |
bool | RemoveAllFilters () const |
Remove all existing filters. More... | |
bool | RemoveFilter (const std::string &_managerId, const std::string &_filterId) const |
Remove an existing filter. More... | |
bool | RemoveFilter (const std::string &_managerId, const std::string &_filterId, const std::function< void(const bool _result)> &_cb) const |
Remove an existing filter. More... | |
bool | UpdateFilter (const std::string &_managerId, const std::string &_filterId, const std::set< std::string > &_newItems) const |
Update an existing filter with a different set of items. More... | |
bool | UpdateFilter (const std::string &_managerId, const std::string &_filterId, const std::set< std::string > &_newItems, const std::function< void(const bool _result)> &_cb) const |
Update an existing filter with a different set of items. More... | |
std::set< std::string > | WaitForManagers (const std::chrono::milliseconds _timeOut=std::chrono::milliseconds::zero()) const |
Wait for introspection managers to appear on the network. More... | |
addtogroup gazebo_util
Constructor.
|
virtual |
Destructor.
bool IsRegistered | ( | const std::string & | _managerId, |
const std::string & | _item | ||
) | const |
Check if the _item is registered on a manager with _managerId.
[in] | _managerId | Id of the manager to query. |
[in] | _item | Item name for the query. |
bool IsRegistered | ( | const std::string & | _managerId, |
const std::set< std::string > & | _items | ||
) | const |
Check if the _items are registered on a manager with _managerId.
[in] | _managerId | Id of the manager to query. |
[in] | _items | Set of item names for the query. |
bool Items | ( | const std::string & | _managerId, |
std::set< std::string > & | _items | ||
) | const |
Get a copy of the items already registered.
This function will block until the result is received.
[in] | _managerID | ID of the manager to request the operation. |
[out] | _items | The list of items. |
bool Items | ( | const std::string & | _managerId, |
const std::function< void(const std::set< std::string > &_items, const bool _result)> & | _cb | ||
) | const |
Get a copy of the items already registered.
This function will not block, the result will be received in a callback function.
[in] | _managerID | ID of the manager to request the operation. |
[in] | _cb | Callback function executed when the response arrives. The callback has the following parameter: |
[in] | _items | The list of items. |
[in] | _result | Result of the request. If false, there was a problem executing your request. |
std::set<std::string> Managers | ( | ) | const |
Get the list of introspection managers currently available.
bool NewFilter | ( | const std::string & | _managerId, |
const std::set< std::string > & | _newItems, | ||
std::string & | _filterId, | ||
std::string & | _newTopic | ||
) | const |
Create a new filter for observing item updates.
This function will create a new topic for sending periodic updates of the items specified in the filter. This function will block until the result is received.
[in] | _managerID | ID of the manager to request the operation. |
[in] | _newItems | Non-empty set of items to observe. |
[out] | _filterId | Unique ID of the filter. You'll need this ID for future filter updates or for removing it. |
[out] | _newTopic | After the filter creation, a client should subscribe to this topic for receiving updates. |
bool NewFilter | ( | const std::string & | _managerId, |
const std::set< std::string > & | _newItems, | ||
const std::function< void(const std::string &_filterId, const std::string &_newTopic, const bool _result)> & | _cb | ||
) | const |
Create a new filter for observing item updates.
This function will create a new topic for sending periodic updates of the items specified in the filter. This function will not block, the result will be received in a callback function.
[in] | _managerID | ID of the manager to request the operation. |
[in] | _newItems | Non-empty set of items to observe. |
[in] | _cb | Callback function executed when the response arrives. The callback has the following parameters: |
[in] | _filterId | Unique ID of the filter. You'll need this ID for future filter updates or for removing it. |
[in] | _newTopic | After the filter creation, a client should subscribe to this topic for receiving updates. |
[in] | _result | Result of the request. If false, there was a problem executing your request. |
bool RemoveAllFilters | ( | ) | const |
Remove all existing filters.
This function will block until the result is received.
bool RemoveFilter | ( | const std::string & | _managerId, |
const std::string & | _filterId | ||
) | const |
Remove an existing filter.
This function will block until the result is received.
[in] | _managerID | ID of the manager to request the operation. |
[in] | _filterId | ID of the filter to remove. |
bool RemoveFilter | ( | const std::string & | _managerId, |
const std::string & | _filterId, | ||
const std::function< void(const bool _result)> & | _cb | ||
) | const |
Remove an existing filter.
This function will not block, the result will be received in a callback function.
[in] | _managerID | ID of the manager to request the operation. |
[in] | _filterId | ID of the filter to remove. |
[in] | _cb | Callback function executed when the response arrives. The callback has the following parameter: |
[in] | _result | Result of the request. If false, there was a problem executing your request. |
bool UpdateFilter | ( | const std::string & | _managerId, |
const std::string & | _filterId, | ||
const std::set< std::string > & | _newItems | ||
) | const |
Update an existing filter with a different set of items.
This function will block until the result is received.
[in] | _managerID | ID of the manager to request the operation. |
[in] | _filterId | ID of the filter to update. |
[in] | _newItems | Non-empty set of items to be observed. |
bool UpdateFilter | ( | const std::string & | _managerId, |
const std::string & | _filterId, | ||
const std::set< std::string > & | _newItems, | ||
const std::function< void(const bool _result)> & | _cb | ||
) | const |
Update an existing filter with a different set of items.
This function will not block, the result will be received in a callback function.
[in] | _managerID | ID of the manager to request the operation. |
[in] | _filterId | ID of the filter to update. |
[in] | _newItems | Non-empty set of items to be observed. |
[in] | _cb | Callback function executed when the response arrives. The callback has the following parameter: |
[in] | _result | Result of the request. If false, there was a problem executing your request. |
std::set<std::string> WaitForManagers | ( | const std::chrono::milliseconds | _timeOut = std::chrono::milliseconds::zero() | ) | const |
Wait for introspection managers to appear on the network.
This function is useful for clients that want to pause until one or more IntrospectionManagers becomes available (such as when gzserver is run).
[in] | _timeOut | Maximum duration to wait. A value of std::chrono::duration::zero indicates that the function should wait indefinitely. An indefinite wait is the default behavior. |