#include <ros_parser.hpp>
|
void | applyVisitorToBuffer (const ROSType &msg_type, Span< uint8_t > &buffer, VisitingCallback callback) const |
| applyVisitorToBuffer is used to pass a callback that is invoked every time a chunk of memory storing an instance of ROSType = monitored_type is reached. Note that the VisitingCallback can modify the original message, but can NOT change its size. This means that strings and vectors can not be change their length. More...
|
|
BlobPolicy | blobPolicy () const |
|
bool | deserialize (Span< const uint8_t > buffer, FlatMessage *flat_output, Deserializer *deserializer) const |
| deserializeIntoFlatContainer takes a raw buffer of memory and extract information from it. This data is stored in two key/value vectors, FlatMessage::value and FlatMessage::name. It must be noted that the key type is FieldsVector. This type is not particularly user-friendly, but allows a much faster post-processing. More...
|
|
ROSMessage::Ptr | getMessageByType (const ROSType &type) const |
|
const std::shared_ptr< MessageSchema > & | getSchema () const |
| getSchema provides some metadata amout a registered ROSMessage. More...
|
|
MaxArrayPolicy | maxArrayPolicy () const |
|
size_t | maxArraySize () const |
|
| Parser (const std::string &topic_name, const ROSType &msg_type, const std::string &definition) |
|
void | setBlobPolicy (BlobPolicy policy) |
|
void | setMaxArrayPolicy (MaxArrayPolicy discard_entire_array, size_t max_array_size) |
|
void | setWarningsStream (std::ostream *output) |
| Change where the warning messages are displayed. More...
|
|
Definition at line 51 of file ros_parser.hpp.
◆ VisitingCallback
◆ BlobPolicy
Enumerator |
---|
STORE_BLOB_AS_COPY | |
STORE_BLOB_AS_REFERENCE | |
Definition at line 94 of file ros_parser.hpp.
◆ MaxArrayPolicy
Enumerator |
---|
DISCARD_LARGE_ARRAYS | |
KEEP_LARGE_ARRAYS | |
Definition at line 66 of file ros_parser.hpp.
◆ Parser()
RosMsgParser::Parser::Parser |
( |
const std::string & |
topic_name, |
|
|
const ROSType & |
msg_type, |
|
|
const std::string & |
definition |
|
) |
| |
- Parameters
-
topic_name | name of the topic to be used as node of the StringTree |
msg_type | message type of the topic. |
msg_definition | text obtained by either:
|
Definition at line 36 of file rosx_introspection/src/ros_parser.cpp.
◆ applyVisitorToBuffer()
void RosMsgParser::Parser::applyVisitorToBuffer |
( |
const ROSType & |
msg_type, |
|
|
Span< uint8_t > & |
buffer, |
|
|
VisitingCallback |
callback |
|
) |
| const |
applyVisitorToBuffer is used to pass a callback that is invoked every time a chunk of memory storing an instance of ROSType = monitored_type is reached. Note that the VisitingCallback can modify the original message, but can NOT change its size. This means that strings and vectors can not be change their length.
- Parameters
-
msg_identifier | String ID to identify the registered message (use registerMessageDefinition first). |
monitored_type | ROSType that triggers the invokation to the callback |
buffer | Original buffer, passed as mutable since it might be modified. |
callback | The callback. |
◆ blobPolicy()
BlobPolicy RosMsgParser::Parser::blobPolicy |
( |
| ) |
const |
|
inline |
◆ deserialize()
deserializeIntoFlatContainer takes a raw buffer of memory and extract information from it. This data is stored in two key/value vectors, FlatMessage::value and FlatMessage::name. It must be noted that the key type is FieldsVector. This type is not particularly user-friendly, but allows a much faster post-processing.
IMPORTANT: this approach is not meant to be used with use arrays such as maps, point clouds and images.For this reason the argument max_array_size is used.
This funtion is almost always followed by CreateRenamedValues, which provide a more human-readable key-value representation.
- Parameters
-
buffer | raw memory to be parsed. |
flat_output | output to store the result. It is recommended to reuse the same object multiple times to avoid memory allocations and speed up the parsing. |
- Returns
- true if the entire message was parsed or false if parts of the message were skipped because an array has (size > max_array_size)
Definition at line 76 of file rosx_introspection/src/ros_parser.cpp.
◆ getMessageByType()
◆ getSchema()
const std::shared_ptr< MessageSchema > & RosMsgParser::Parser::getSchema |
( |
| ) |
const |
◆ maxArrayPolicy()
◆ maxArraySize()
size_t RosMsgParser::Parser::maxArraySize |
( |
| ) |
const |
|
inline |
◆ setBlobPolicy()
void RosMsgParser::Parser::setBlobPolicy |
( |
BlobPolicy |
policy | ) |
|
|
inline |
◆ setMaxArrayPolicy()
void RosMsgParser::Parser::setMaxArrayPolicy |
( |
MaxArrayPolicy |
discard_entire_array, |
|
|
size_t |
max_array_size |
|
) |
| |
|
inline |
Default values are DISCARD_LARGE_ARRAYS and 100. The maximum permissible value of max_array_size is 10.000 (but don't)
Definition at line 74 of file ros_parser.hpp.
◆ setWarningsStream()
void RosMsgParser::Parser::setWarningsStream |
( |
std::ostream * |
output | ) |
|
|
inline |
Change where the warning messages are displayed.
Definition at line 166 of file ros_parser.hpp.
◆ _alias_array_pos
std::vector<int> RosMsgParser::Parser::_alias_array_pos |
|
private |
◆ _blob_policy
◆ _deserializer
std::unique_ptr<Deserializer> RosMsgParser::Parser::_deserializer |
|
private |
◆ _discard_large_array
◆ _dummy_root_field
std::shared_ptr<ROSField> RosMsgParser::Parser::_dummy_root_field |
|
private |
◆ _formatted_string
std::vector<std::string> RosMsgParser::Parser::_formatted_string |
|
private |
◆ _global_warnings
std::ostream* RosMsgParser::Parser::_global_warnings |
|
private |
◆ _max_array_size
size_t RosMsgParser::Parser::_max_array_size |
|
private |
◆ _schema
◆ _substituted
std::vector<int8_t> RosMsgParser::Parser::_substituted |
|
private |
◆ _topic_name
std::string RosMsgParser::Parser::_topic_name |
|
private |
The documentation for this class was generated from the following files: