35 #include "loggermessage.pb.h" 37 class EMANE::Messages::LoggerRecordMessage::Implementation
40 Implementation(std::string sLogRecord,
LogLevel logLevel, uint32_t u32LogSequenceNumber) :
41 sLogRecord_{sLogRecord},
43 u32LogSequenceNumber_{u32LogSequenceNumber}{}
52 return u32LogSequenceNumber_;
61 const std::string sLogRecord_;
63 const std::uint32_t u32LogSequenceNumber_;
69 std::uint32_t u32LogSequenceNumber):
70 pImpl_{
new Implementation{std::string{p, len}, logLevel, u32LogSequenceNumber}}
76 EMANEMessage::LoggerMessage loggerMessage;
78 if(!loggerMessage.ParseFromArray(p, len))
84 if(loggerMessage.type() == EMANEMessage::LoggerMessage_Type_RECORD)
87 if(loggerMessage.has_record ())
89 pImpl_.reset(
new Implementation(loggerMessage.record().record(),
91 loggerMessage.record().sequencenumber()));
111 return pImpl_->getLogLevel();
117 return pImpl_->getLogRecord();
123 return pImpl_->getLogSequenceNumber();
132 EMANEMessage::LoggerMessage loggerMessage;
135 loggerMessage.set_type(EMANEMessage::LoggerMessage_Type_RECORD);
138 EMANEMessage::LoggerMessage_RecordMessage * pRecordMessage = loggerMessage.mutable_record();
143 pRecordMessage->set_record(pImpl_->getLogRecord());
145 pRecordMessage->set_sequencenumber(pImpl_->getLogSequenceNumber());
147 if(!loggerMessage.SerializeToString(&serialization))
152 return serialization;
std::string Serialization
SerializationException is thrown when an exception occurs during serialization or deserialization of ...
LogLevel getLogLevel() const
EMANEMessage::LoggerMessage_LogLevel convertLogLevel(EMANE::LogLevel level)
const std::string & getLogRecord() const
std::uint32_t getLogSequenceNumber() const
Serialization serialize() const override
LoggerRecordMessage(const char *p, size_t len, LogLevel level, std::uint32_t u32SequenceNumber)