17#ifndef GAZEBO_UTIL_INTROSPECTION_MANAGER_HH_
18#define GAZEBO_UTIL_INTROSPECTION_MANAGER_HH_
26#include "gazebo/msgs/any.pb.h"
27#include "gazebo/msgs/empty.pb.h"
28#include "gazebo/msgs/gz_string.pb.h"
30#include "gazebo/msgs/param.pb.h"
31#include "gazebo/msgs/param_v.pb.h"
42 class IntrospectionManagerPrivate;
54 public: std::string
Id()
const;
61 public:
template<
typename T>
63 const std::function<T()> &_cb)
67 return msgs::ConvertAny(_cb());
70 return this->Register(_item, func);
84 public: std::set<std::string>
Items()
const;
111 private:
bool Register(
const std::string &_item,
112 const std::function <gazebo::msgs::Any()> &_cb);
123 private:
bool NewFilterImpl(
const std::set<std::string> &_newItems,
124 std::string &_filterId);
130 private:
bool UpdateFilterImpl(
const std::string &_filterId,
131 const std::set<std::string> &_newItems);
136 private:
bool RemoveFilterImpl(
const std::string &_filterId);
146 private:
bool NewFilter(
const gazebo::msgs::Param_V &_req,
147 gazebo::msgs::GzString &_rep);
158 private:
bool UpdateFilter(
const gazebo::msgs::Param_V &_req,
159 gazebo::msgs::Empty &_rep);
168 private:
bool RemoveFilter(
const gazebo::msgs::Param_V &_req,
169 gazebo::msgs::Empty &_rep);
178 private:
bool Items(
const gazebo::msgs::Empty &_req,
179 gazebo::msgs::Param_V &_rep);
185 private: std::string CreateRandomId(
const unsigned int &_size)
const;
193 private:
bool ValidateParameter(
const gazebo::msgs::Param &_msg,
194 const std::set<std::string> &_allowedValues)
const;
201 private: std::unique_ptr<IntrospectionManagerPrivate> dataPtr;
util
Definition Diagnostics.hh:33
gazebo
Definition IntrospectionManager.hh:35
util
Definition IntrospectionManager.hh:35
Singleton template class.
Definition SingletonT.hh:34
addtogroup gazebo_util
Definition IntrospectionManager.hh:51
void NotifyUpdates()
If there are changes in the items list since the last update, a new message is published under the to...
bool Register(const std::string &_item, const std::function< T()> &_cb)
Register a new item in the introspection manager.
Definition IntrospectionManager.hh:62
std::set< std::string > Items() const
Get a copy of the items already registered in this manager.
void Clear()
Unregister all items.
bool Unregister(const std::string &_item)
Unregister an existing item from the introspection manager.
void Update()
Update all the items under observation and publish updates through all the topics.
std::string Id() const
Get the unique ID of this manager.
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition SingletonT.hh:58
Forward declarations for the common classes.
Definition Animation.hh:27