Go to the documentation of this file.
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)
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);
147 gazebo::msgs::GzString &_rep);
159 gazebo::msgs::Empty &_rep);
169 gazebo::msgs::Empty &_rep);
178 private:
bool Items(
const gazebo::msgs::Empty &_req,
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;
void Update()
Update all the items under observation and publish updates through all the topics.
Forward declarations for the common classes.
Definition: Animation.hh:27
Singleton template class.
Definition: SingletonT.hh:34
gazebo
Definition: IntrospectionManager.hh:35
void NotifyUpdates()
If there are changes in the items list since the last update, a new message is published under the to...
bool Unregister(const std::string &_item)
Unregister an existing item from the introspection manager.
std::string Id() const
Get the unique ID of this manager.
std::vector< common::Param * > Param_V
Definition: CommonTypes.hh:97
util
Definition: IntrospectionManager.hh:35
void Clear()
Unregister all items.
addtogroup gazebo_util
Definition: IntrospectionManager.hh:51
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.
GAZEBO_VISIBLE msgs::Any ConvertAny(const double _v)
Convert a double to a msgs::Any.
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:58