Goby3  3.1.5a
2024.05.23
goby::middleware::log::LogEntry Class Reference

#include <goby/middleware/log/log_entry.h>

Public Member Functions

 LogEntry (std::vector< unsigned char > data, int scheme, std::string type, const Group &group, goby::time::SystemClock::time_point timestamp=goby::time::SystemClock::now())
 
 LogEntry ()
 
void parse_version (std::istream *s)
 
void parse (std::istream *s)
 
void serialize (std::ostream *s) const
 
const std::vector< unsigned char > & data () const
 
int scheme () const
 
const std::string & type () const
 
const Groupgroup () const
 
const goby::time::SystemClock::time_pointtimestamp () const
 

Static Public Member Functions

static void set_current_version (decltype(version_) version)
 
static void reset ()
 

Static Public Attributes

static constexpr int magic_bytes_ {4}
 
static constexpr int size_bytes_ {4}
 
static constexpr int scheme_bytes_ {2}
 
static constexpr int group_bytes_ {2}
 
static constexpr int type_bytes_ {2}
 
static constexpr int timestamp_bytes_ {8}
 
static constexpr int crc_bytes_ {4}
 
static constexpr uint< scheme_bytes_ >::type scheme_group_index_ {0xFFFF}
 
static constexpr uint< scheme_bytes_ >::type scheme_type_index_ {0xFFFE}
 
static constexpr int version_bytes_ {4}
 
static constexpr int compiled_current_version {3}
 
static int current_version_
 
static uint< version_bytes_ >::type version_
 
static constexpr decltype(version_invalid_version {0}
 
static std::map< int, std::function< void(const std::string &type)> > new_type_hook
 
static std::map< int, std::function< void(const Group &group)> > new_group_hook
 
static std::map< LogFilter, std::function< void(const std::vector< unsigned char > &data)> > filter_hook
 

Detailed Description

Definition at line 99 of file log_entry.h.

Constructor & Destructor Documentation

◆ LogEntry() [1/2]

goby::middleware::log::LogEntry::LogEntry ( std::vector< unsigned char data,
int  scheme,
std::string  type,
const Group group,
goby::time::SystemClock::time_point  timestamp = goby::time::SystemClock::now() 
)
inline

Definition at line 126 of file log_entry.h.

◆ LogEntry() [2/2]

goby::middleware::log::LogEntry::LogEntry ( )
inline

Definition at line 136 of file log_entry.h.

Member Function Documentation

◆ data()

const std::vector<unsigned char>& goby::middleware::log::LogEntry::data ( ) const
inline

Definition at line 148 of file log_entry.h.

◆ group()

const Group& goby::middleware::log::LogEntry::group ( ) const
inline

Definition at line 151 of file log_entry.h.

◆ parse()

void goby::middleware::log::LogEntry::parse ( std::istream *  s)

◆ parse_version()

void goby::middleware::log::LogEntry::parse_version ( std::istream *  s)

◆ reset()

static void goby::middleware::log::LogEntry::reset ( )
inlinestatic

Definition at line 154 of file log_entry.h.

◆ scheme()

int goby::middleware::log::LogEntry::scheme ( ) const
inline

Definition at line 149 of file log_entry.h.

◆ serialize()

void goby::middleware::log::LogEntry::serialize ( std::ostream *  s) const

◆ set_current_version()

static void goby::middleware::log::LogEntry::set_current_version ( decltype(version_ version)
inlinestatic

Definition at line 141 of file log_entry.h.

◆ timestamp()

const goby::time::SystemClock::time_point& goby::middleware::log::LogEntry::timestamp ( ) const
inline

Definition at line 152 of file log_entry.h.

◆ type()

const std::string& goby::middleware::log::LogEntry::type ( ) const
inline

Definition at line 150 of file log_entry.h.

Member Data Documentation

◆ compiled_current_version

constexpr int goby::middleware::log::LogEntry::compiled_current_version {3}
staticconstexpr

Definition at line 113 of file log_entry.h.

◆ crc_bytes_

constexpr int goby::middleware::log::LogEntry::crc_bytes_ {4}
staticconstexpr

Definition at line 108 of file log_entry.h.

◆ current_version_

int goby::middleware::log::LogEntry::current_version_
static

Definition at line 114 of file log_entry.h.

◆ filter_hook

std::map<LogFilter, std::function<void(const std::vector<unsigned char>& data)> > goby::middleware::log::LogEntry::filter_hook
static

Definition at line 123 of file log_entry.h.

◆ group_bytes_

constexpr int goby::middleware::log::LogEntry::group_bytes_ {2}
staticconstexpr

Definition at line 105 of file log_entry.h.

◆ invalid_version

constexpr decltype(version_) goby::middleware::log::LogEntry::invalid_version {0}
staticconstexpr

Definition at line 117 of file log_entry.h.

◆ magic_bytes_

constexpr int goby::middleware::log::LogEntry::magic_bytes_ {4}
staticconstexpr

Definition at line 102 of file log_entry.h.

◆ new_group_hook

std::map<int, std::function<void(const Group& group)> > goby::middleware::log::LogEntry::new_group_hook
static

Definition at line 120 of file log_entry.h.

◆ new_type_hook

std::map<int, std::function<void(const std::string& type)> > goby::middleware::log::LogEntry::new_type_hook
static

Definition at line 119 of file log_entry.h.

◆ scheme_bytes_

constexpr int goby::middleware::log::LogEntry::scheme_bytes_ {2}
staticconstexpr

Definition at line 104 of file log_entry.h.

◆ scheme_group_index_

constexpr uint<scheme_bytes_>::type goby::middleware::log::LogEntry::scheme_group_index_ {0xFFFF}
staticconstexpr

Definition at line 109 of file log_entry.h.

◆ scheme_type_index_

constexpr uint<scheme_bytes_>::type goby::middleware::log::LogEntry::scheme_type_index_ {0xFFFE}
staticconstexpr

Definition at line 110 of file log_entry.h.

◆ size_bytes_

constexpr int goby::middleware::log::LogEntry::size_bytes_ {4}
staticconstexpr

Definition at line 103 of file log_entry.h.

◆ timestamp_bytes_

constexpr int goby::middleware::log::LogEntry::timestamp_bytes_ {8}
staticconstexpr

Definition at line 107 of file log_entry.h.

◆ type_bytes_

constexpr int goby::middleware::log::LogEntry::type_bytes_ {2}
staticconstexpr

Definition at line 106 of file log_entry.h.

◆ version_

uint<version_bytes_>::type goby::middleware::log::LogEntry::version_
static

Definition at line 116 of file log_entry.h.

◆ version_bytes_

constexpr int goby::middleware::log::LogEntry::version_bytes_ {4}
staticconstexpr

Definition at line 112 of file log_entry.h.


The documentation for this class was generated from the following file: