29 #ifndef CPP_INTROSPECTION_MESSAGE_H 30 #define CPP_INTROSPECTION_MESSAGE_H 35 #include <std_msgs/Header.h> 48 virtual const char*
getName()
const = 0;
50 virtual const char*
getMD5Sum()
const = 0;
52 virtual const std::type_info&
getTypeId()
const = 0;
72 V_string getFields(
bool expand =
false,
const std::string& separator =
".",
const std::string& prefix = std::string())
const;
77 std::vector<boost::any>&
getValues(std::vector<boost::any>& values,
bool expand =
false)
const;
97 template <
typename T>
typename T::Ptr
narrow(
const VoidPtr& instance)
const {
return boost::shared_static_cast<T>(instance); }
98 template <
typename T>
typename T::ConstPtr
narrow(
const VoidConstPtr& instance)
const {
return boost::shared_static_cast<T
const>(instance); }
118 namespace serialization {
123 template<
typename Stream>
125 if (!message.
hasInstance())
throw std::runtime_error(
"Tried to serialize a message without an instance");
130 if (!message.
hasInstance())
throw std::runtime_error(
"Tried to serialize a message without an instance");
139 namespace message_traits {
157 #endif // CPP_INTROSPECTION_MESSAGE_H std::vector< std::string > V_string
std::vector< FieldPtr > V_Field
virtual const char * getName() const =0
virtual std::string * getFrameId(const VoidPtr &instance) const =0
boost::weak_ptr< Field const > FieldWPtr
MessagePtr messageByMD5Sum(const std::string &md5sum)
T::Ptr narrow(const VoidPtr &instance) const
V_string getFields(bool expand=false, const std::string &separator=".", const std::string &prefix=std::string()) const
std::vector< boost::any > getValues(bool expand=false) const
virtual VoidPtr createInstance() const =0
static void write(Stream &stream, const cpp_introspection::Message &message)
virtual std::size_t serializationLength(const VoidConstPtr &instance=VoidConstPtr()) const =0
virtual PackagePtr package() const =0
virtual MessagePtr introspect() const
static const char * value(const cpp_introspection::Message &message)
virtual VoidPtr getInstance() const
MessagePtr expand(const MessagePtr &message, const std::string &separator=".", const std::string &prefix="")
V_Field::iterator iterator
static const char * value(const cpp_introspection::Message &message)
const_iterator end() const
virtual const char * getDefinition() const =0
virtual FieldWPtr field(const std::string &name) const =0
virtual bool hasHeader() const =0
virtual bool isMessage() const
boost::shared_ptr< void > VoidPtr
T::ConstPtr narrow(const VoidConstPtr &instance) const
MessagePtr messageByTypeId(const std::type_info &type_info)
virtual const V_Field & fields() const =0
V_Field::const_iterator const_iterator
boost::shared_ptr< T const > getConstInstanceAs() const
virtual void serialize(ros::serialization::OStream &stream, const VoidConstPtr &instance=VoidConstPtr()) const =0
virtual const char * getDataType() const =0
boost::shared_ptr< void const > VoidConstPtr
const_iterator begin() const
virtual bool isSimple() const =0
virtual const char * getMD5Sum() const =0
virtual const V_FieldName & getFieldNames() const =0
boost::shared_ptr< T > getInstanceAs() const
virtual std_msgs::Header * getHeader(const VoidPtr &instance) const =0
virtual VoidConstPtr getConstInstance() const
virtual ros::Time * getTimeStamp(const VoidPtr &instance) const =0
virtual const char * getPackageName() const =0
virtual VoidPtr deserialize(ros::serialization::IStream &stream, const VoidPtr &instance=VoidPtr()) const =0
static uint32_t serializedLength(const cpp_introspection::Message &message)
static const char * value(const cpp_introspection::Message &message)
virtual const std::type_info & getTypeId() const =0
V_string getTypes(bool expand=false) const
virtual bool hasInstance() const
virtual bool isFixedSize() const =0
MessagePtr messageByDataType(const std::string &data_type, const std::string &package=std::string())
std::vector< const char * > V_FieldName