#ifndef _RECEIVER_HPP #define _RECEIVER_HPP #include "Runtime.hpp" #include #include namespace Receiver { class Simple { protected: int fd; public: Simple(int fd) : fd(fd) {} // Reads the exact amount of bytes given std::string read(size_t amount); void read(std::byte *buffer, size_t size); // Reads at max. the amount of bytes given std::string readSome(size_t max); // Reads an object of type T template auto readObject(T& o) { return read(reinterpret_cast(&o), sizeof(o)); } }; } #endif