8#ifndef logger_types_telem_flowrpm_hpp
9#define logger_types_telem_flowrpm_hpp
51 static_cast<size_t>( len ) );
60 static_cast<void>( len );
63 std::string msg =
"[flowrpm] ";
66 msg += std::to_string( fbs->flowRate() );
68 msg += std::to_string( fbs->age() );
70 msg += ( fbs->valid() ?
"true" :
"false" );
82 static double age(
void *msgBuffer )
88 static bool valid(
void *msgBuffer )
96 if( member ==
"flowRate" )
102 reinterpret_cast<void *
>( &
flowRate ),
105 else if( member ==
"age" )
111 reinterpret_cast<void *
>( &
age ),
114 else if( member ==
"valid" )
120 reinterpret_cast<void *
>( &
valid ),
125 std::cerr <<
"No member " << member <<
" in telem_flowrpm\n";
The MagAO-X logger flatbuffer log base type.
uint16_t eventCodeT
The type of an event code (16-bit unsigned int).
msgLen2T msgLenT
The type used to refer to the message length, regardless of length.
int8_t logPrioT
The type of the log priority code.
static void * messageBuffer(bufferPtrT &logBuffer)
Get the message buffer address.
std::shared_ptr< char > bufferPtrT
The log entry buffer smart pointer.
static constexpr flatlogs::eventCodeT TELEM_FLOWRPM
const MagAOX::logger::Telem_flowrpm_fb * GetTelem_flowrpm_fb(const void *buf)
inline ::flatbuffers::Offset< Telem_flowrpm_fb > CreateTelem_flowrpm_fb(::flatbuffers::FlatBufferBuilder &_fbb, double flowRate=0.0, double age=0.0, bool valid=false)
bool VerifyTelem_flowrpm_fbBuffer(::flatbuffers::Verifier &verifier)
static constexpr logPrioT LOG_TELEM
A telemetry recording.
Message type for resolving log messages with a f.b. builder.
flatbuffers::FlatBufferBuilder builder
Base class for logs consisting of a flatbuffer message.
The type of the input message.
messageT(const double flowRate, const double age, const bool valid)
Construct from components.
Log entry recording the displayed flow value and source age.
static const flatlogs::logPrioT defaultLevel
The default level.
static double age(void *msgBuffer)
Recover the age from a serialized message.
static bool valid(void *msgBuffer)
Recover the validity flag from a serialized message.
static const flatlogs::eventCodeT eventCode
The event code.
static bool verify(flatlogs::bufferPtrT &logBuff, flatlogs::msgLenT len)
static double flowRate(void *msgBuffer)
Recover the flow rate from a serialized message.
static std::string msgString(void *msgBuffer, flatlogs::msgLenT len)
Get the message formatted for human consumption.
static timespec lastRecord
The time of the last time this log was recorded. Used by the telemetry system.
static logMetaDetail getAccessor(const std::string &member)
Get the logMetaDetail for a member by name.