3#include <NDEVR/Connection.h>
4#include <NDEVR/Translator.h>
46 virtual bool open(
bool start_forward_thread =
true);
void setForwardAToB(bool forward)
Enables or disables forwarding data from A to B.
void setAConnectionInfo(const ConnectionInfo &info)
Sets the connection info for endpoint A.
bool m_is_open
Whether the forwarding link is currently active.
bool forwardBToA() const
Checks whether data is being forwarded from B to A.
bool m_forward_b_to_a
Whether to forward data from B to A.
Connection * b() const
Returns the second connection endpoint.
Connection * a() const
Returns the first connection endpoint.
TimeSpan m_update_span
Interval between forwarding updates.
ConnectionForwarding(Connection *a, Connection *b, LogPtr log=nullptr)
Constructs a ConnectionForwarding from two existing Connection pointers.
bool forwardAToB() const
Checks whether data is being forwarded from A to B.
ConnectionForwarding(ConnectionInfo a, ConnectionInfo b, LogPtr log=nullptr)
Constructs a ConnectionForwarding from two connection info objects.
void setUpdateInterval(const TimeSpan &span)
Sets the interval between forwarding updates.
ConnectionForwarding(LogPtr log=nullptr)
Constructs a ConnectionForwarding with no connections.
virtual void update(Time time) override
Performs a single forwarding update, moving data between the two connections.
virtual bool isOpen() const
Checks whether both connections are currently open.
Connection * m_a
The first connection endpoint.
void setBConnectionInfo(const ConnectionInfo &info)
Sets the connection info for endpoint B.
Connection * m_b
The second connection endpoint.
bool m_forward_a_to_b
Whether to forward data from A to B.
void close()
Closes both connections and stops forwarding.
void setForwardBToA(bool forward)
Enables or disables forwarding data from B to A.
TimeSpan updateInterval() const override
Returns the interval between forwarding updates.
virtual void _close()
Internal close implementation that tears down the forwarding link.
bool m_request_close
Whether a close has been requested.
virtual bool open(bool start_forward_thread=true)
Opens both connections and optionally starts a forwarding thread.
A standard interface for all types of connections that allow transmitting and receiving of data betwe...
Device(const Model &model, LogPtr log, QObject *parent=nullptr)
Constructs a Device from a Model with the given log and optional Qt parent.
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
Stores a time span, or difference between two times, with an optional start time.
Represents a timestamp with utilities for manipulation and conversion.
The primary namespace for the NDEVR SDK.
A structure designed to store information about a specific Connection.