1 #ifndef __forb_stream_hpp__ 2 #define __forb_stream_hpp__ 8 #include <forb/declarations.hpp> 23 "Cannot marshal the type T");
48 void marshal(T v[],
size_t N) {
49 for (
size_t idx = 0; idx < N; ++idx) {
50 v[idx] = marshal(v[idx]);
56 void unmarshal(T v[],
size_t N) {
72 using size_t = std::size_t;
80 SHMEM = 1 << (std::numeric_limits<call_id_t>::digits - 1)
85 virtual ~stream() noexcept =
default;
89 virtual void send(
const void *buffer,
size_t sise) = 0;
93 virtual void recv(
void *buffer,
size_t sise) = 0;
96 virtual void close() = 0;
110 #endif // #ifndef __forb_stream_hpp__ virtual ~stream() noexcept=default
This class is virtual, so it requires a virtual destructor.
virtual void close()=0
Closes the stream.
Virtual class that represents a stream.
Definition: stream.hpp:69
This function implements a memcpy abstract that is valid also for volatile data.
Definition: base_skeleton.hpp:15
virtual void recv(void *buffer, size_t sise)=0
Blocking receive operation.
virtual void send(const void *buffer, size_t sise)=0
Blocking send operation.
type
The type of the stream.
Definition: stream.hpp:78
virtual bool require_marshal() const
Returns true if the execution platform requires marshalling before sending data over the stream...
Definition: stream.hpp:103
virtual type get_type() const =0
Returns the type of the stream, either type::SOCKET or type::SHMEM.
uint16_t call_id_t
The type that will be used to transmit the call_id.
Definition: declarations.hpp:12