Template Class FromHostWriter
Defined in File fromhost_writer.hpp
Class Documentation
-
template<class BUF>
class FromHostWriter FromHostWriter owns a network Receiver that runs the (event loop) thread. Messages are received from the network, encoded, and written into the FromHost buffer. The FromHost can be shared by more than one FromHostWriter.
- Template Parameters:
BUF -- buffer of type FlxFromHostBuffer or FileFromHostBuffer.
Public Functions
FromHostWriter contructor.
- Parameters:
buffer -- shared pointer to Fromhost DMA buffer.
elinks -- vector of enabled e-links.
receiver -- pointer to network receiver.
thread_id -- identifier of the thred the writer is running on
encode and write an incoming network message.
- Parameters:
buffer -- shared pointer to Fromhost DMA buffer.
elinks_type -- type of e-links to be enabled.
receiver -- pointer to network receiver.
thread_id -- identifier of the thred the writer is running on
-
FromHostWriter(const FromHostWriter&) = delete
-
FromHostWriter &operator=(const FromHostWriter&) = delete
-
FromHostWriter(FromHostWriter&&) noexcept = default
-
FromHostWriter &operator=(FromHostWriter&&) noexcept = default
-
inline void connection_established(const std::string &s)
on-connection-established callback.
-
inline void connection_closed(const std::string &s)
on-connection-closed callback.
-
void encode_and_write(const std::vector<ToFlxMessage> &messages)
encode and write an incoming network message.
- Parameters:
messages -- vector of ToFlxMessage structs representing incoming network messages.
-
std::map<local_elink_t, FromHostElinkStats> get_writer_elink_stats()
- Returns:
map of e-link / e-link monitoring information.
-
inline unsigned int get_number_of_connections()
- Returns:
number of open connections.
-
inline int get_thread_id() const
- Returns:
id of the thread the writer runs on.
-
inline uint16_t get_port() const
- Returns:
the port number assigned by the system.