|
forb
|
Virtual class that represents a stream. More...
#include <stream.hpp>
Public Types | |
| enum | type : call_id_t { SOCKET = 0, SHMEM = 1 << (std::numeric_limits<call_id_t>::digits - 1) } |
| The type of the stream. More... | |
| using | size_t = std::size_t |
| An unsigned size type. | |
Public Member Functions | |
| virtual | ~stream () noexcept=default |
| This class is virtual, so it requires a virtual destructor. More... | |
| virtual void | send (const void *buffer, size_t sise)=0 |
| Blocking send operation. More... | |
| virtual void | recv (void *buffer, size_t sise)=0 |
| Blocking receive operation. More... | |
| virtual void | close ()=0 |
| Closes the stream. | |
| virtual type | get_type () const =0 |
| Returns the type of the stream, either type::SOCKET or type::SHMEM. | |
| virtual bool | require_marshal () const |
| Returns true if the execution platform requires marshalling before sending data over the stream, false otherwise. More... | |
Virtual class that represents a stream.
The actual implementations of this class (socket or shared_memory) may rely on a unidirectional data channel to perform communication. The classes that use this stream shall ensure that there won't be concurrent access to an end of the stream (either input or output), otherwise the behavior of the stream is undefined. Concurrent access to different ends of the stream is instead a good practice, also because some implementations may block a sending task waiting for a receiving task to free some space consuming data.
|
strong |
The type of the stream.
The underlying value of the enumeration uses the most significant bit to check the socket type, so it can be bit-wisely ORed with the remotely called method ID.
|
virtualdefaultnoexcept |
This class is virtual, so it requires a virtual destructor.
It has no fields, so no copy/move operations are needed.
|
pure virtual |
Blocking receive operation.
It repeats the underlying call until all data are received or an error occurs.
Implemented in forb::streams::socket, and forb::streams::shared_memory.
|
inlinevirtual |
Returns true if the execution platform requires marshalling before sending data over the stream, false otherwise.
Reimplemented in forb::streams::socket, and forb::streams::shared_memory.
|
pure virtual |
Blocking send operation.
It repeats the underlying call until all data are received or an error occurs.
Implemented in forb::streams::socket, and forb::streams::shared_memory.
1.8.12