1
0
Fork 0
mirror of https://gitlab.com/niansa/llama_nds.git synced 2025-03-06 20:53:28 +01:00
llama_nds/Sender.hpp
2023-04-03 22:06:29 +02:00

25 lines
513 B
C++

#ifndef _SENDER_HPP
#define _SENDER_HPP
#include <string_view>
#include <vector>
#include <cstddef>
namespace Sender {
class Simple {
protected:
int fd;
public:
Simple(int fd) : fd(fd) {}
void write(std::string_view, bool moreData = false);
void write(const std::byte *data, size_t, bool moreData = false);
template<typename T>
auto writeObject(const T& o, bool moreData = false) {
return write(reinterpret_cast<const std::byte *>(&o), sizeof(o), moreData);
}
};
}
#endif