##

IntrospectionClient.hh
Go to the documentation of this file.
/*
* Copyright (C) 2016 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_UTIL_INTROSPECTION_CLIENT_HH_
#define GAZEBO_UTIL_INTROSPECTION_CLIENT_HH_
#include <chrono>
#include <functional>
#include <memory>
#include <set>
#include <string>
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace util
{
// Forward declare private data classes.
class IntrospectionClientPrivate;
class GZ_UTIL_VISIBLE IntrospectionClient
{
public: IntrospectionClient();
public: virtual ~IntrospectionClient();
public: std::set<std::string> WaitForManagers(
const std::chrono::milliseconds _timeOut =
std::chrono::milliseconds::zero()) const;
public: std::set<std::string> Managers() const;
public: bool NewFilter(const std::string &_managerId,
const std::set<std::string> &_newItems,
std::string &_filterId,
std::string &_newTopic) const;
public: 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;
public: bool UpdateFilter(const std::string &_managerId,
const std::string &_filterId,
const std::set<std::string> &_newItems) const;
public: 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;
public: bool RemoveAllFilters() const;
public: bool RemoveFilter(const std::string &_managerId,
const std::string &_filterId) const;
public: bool RemoveFilter(const std::string &_managerId,
const std::string &_filterId,
const std::function <void(
const bool _result)> &_cb) const;
public: bool Items(const std::string &_managerId,
std::set<std::string> &_items) const;
public: bool Items(const std::string &_managerId,
const std::function <void(
const std::set<std::string> &_items,
const bool _result)> &_cb) const;
public: bool IsRegistered(const std::string &_managerId,
const std::string &_item) const;
public: bool IsRegistered(const std::string &_managerId,
const std::set<std::string> &_items) const;
private: bool IsManagerUsed(const std::string &_managerId) const;
private: std::unique_ptr<IntrospectionClientPrivate> dataPtr;
};
}
}
#endif
gazebo::util::IntrospectionClient
addtogroup gazebo_util
Definition: IntrospectionClient.hh:39
gazebo::util::IntrospectionClient::RemoveAllFilters
bool RemoveAllFilters() const
Remove all existing filters.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
system.hh
util
util
Definition: Diagnostics.hh:33
gazebo::util::IntrospectionClient::~IntrospectionClient
virtual ~IntrospectionClient()
Destructor.
gazebo::util::IntrospectionClient::RemoveFilter
bool RemoveFilter(const std::string &_managerId, const std::string &_filterId) const
Remove an existing filter.
gazebo::util::IntrospectionClient::NewFilter
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.
gazebo::util::IntrospectionClient::Managers
std::set< std::string > Managers() const
Get the list of introspection managers currently available.
gazebo::util::IntrospectionClient::IsRegistered
bool IsRegistered(const std::string &_managerId, const std::string &_item) const
Check if the _item is registered on a manager with _managerId.
gazebo::util::IntrospectionClient::WaitForManagers
std::set< std::string > WaitForManagers(const std::chrono::milliseconds _timeOut=std::chrono::milliseconds::zero()) const
Wait for introspection managers to appear on the network.
gazebo::util::IntrospectionClient::IntrospectionClient
IntrospectionClient()
Constructor.
gazebo::util::IntrospectionClient::UpdateFilter
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.
gazebo::util::IntrospectionClient::Items
bool Items(const std::string &_managerId, std::set< std::string > &_items) const
Get a copy of the items already registered.