Files
Simple-Protocol-Lib/include/sp/protocol/MessagePrinter.h
Persson-dev 81c9dbadd6
All checks were successful
Linux arm64 / Build (push) Successful in 15s
fix printing
2025-03-04 12:23:59 +01:00

23 lines
567 B
C++

#pragma once
#include <ostream>
#include <sp/common/Reflection.h>
#include <sp/protocol/message/MessagePrinterImpl.h>
namespace sp {
/**
* \brief Prints a message in a human readable string
*/
template <typename TBase, typename... TOptions>
std::ostream& operator<<(std::ostream& a_Stream, const sp::MessageBase<TBase, TOptions...>& a_Message) {
a_Stream
<< sp::GetClassName(a_Message)
<< sp::details::IdPrinter<TOptions...>::PrintMessageId()
<< "["
<< sp::details::PrintFields(a_Message.GetFields())
<< "]";
return a_Stream;
}
} // namespace sp