Skip to content

Commit

Permalink
add hasField method
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin committed Jan 10, 2024
1 parent 93a9d3c commit 5a69c77
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ulog_cpp/subscription.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ class TypedDataView {
*/
const MessageFormat& format() const { return _message_format_ref; }

/**
* Checks if a field is present in the underlying MessageFormat
*/
bool hasField(const std::string& field_name) const
{
return _message_format_ref.field(field_name)->definitionResolved();
}

/**
* @return The underlying raw data vector
*/
Expand Down

0 comments on commit 5a69c77

Please sign in to comment.