23 lines
567 B
C++
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
|