1#ifndef LINTEL_MESSAGE_H
2#define LINTEL_MESSAGE_H
4#include <lintel/config.h>
58 template<
typename T>
void assign(
T content)
60 static_assert(
sizeof(
T) <=
sizeof(m_content),
"content is bigger than reserved size for content");
61 char *
temp =
static_cast<char *
>(
static_cast<void *
>(&content));
67 for (
int i = 0;
i <
sizeof(
T);
i++) { m_content[
i] =
temp[
i]; }
76 template<
typename T>
T as()
78 static_assert(
sizeof(
T) <=
sizeof(m_content),
"content is bigger than reserved size for content");
79 return *
static_cast<T *
>(
static_cast<void *
>(m_content));
T as()
Definition Message.h:76
void assign(T content)
Definition Message.h:58
const char * senderOf() const
std::chrono::time_point< std::chrono::system_clock > sendTimeOf() const
const char * receiverOf() const
Message(const std::string &receiver, const std::string &sender)
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9