Program Listing for File datatypes.h

Return to documentation for file (include/log_view/datatypes.h)

#ifndef LOG_VIEW_DATATYPES_H_
#define LOG_VIEW_DATATYPES_H_

#include <log_view/utils.h>
#include <rclcpp/rclcpp.hpp>
#include <rcl_interfaces/msg/log.hpp>

namespace log_view {

struct LogLine {
  size_t index;
  size_t line;
};

struct LogEntry
{
  LogEntry() = default;
  LogEntry(const LogEntry& entry) = default;
  explicit LogEntry(const rcl_interfaces::msg::Log& log) :
    stamp(log.stamp),
    level(log.level),
    node(log.name),
    file(log.file),
    function(log.function),
    line(log.line),
    text(split(log.msg, '\n'))
  {}

  rclcpp::Time stamp;
  uint8_t level;
  std::string node;
  std::string file;
  std::string function;
  uint32_t line;
  std::vector<std::string> text;
};

struct NodeData {
  bool exclude = true;
  size_t count = 0;
};

}  // namespace log_view

#endif  // LOG_VIEW_DATATYPES_H_