39#ifdef OPENMRN_FEATURE_EXECUTOR_SELECT
50 remove_local_node_from_map(node);
68 LOG_ERROR(
"Deleting nonexistent owned flow.");
73 if (expected.
id && actual.
id)
75 return expected.
id == actual.
id;
78 LOG(
VERBOSE,
"Cannot reconcile expected and actual NodeHandles for "
115 std::unique_ptr<TcpHubDeviceSelect> port_;
117 bool deleting_{
false};
118 void notify()
override
135 if (deleting_ || !port_)
139 if (!port_->write_done())
148 RemotePort *p =
new RemotePort(
this, on_error);
165 auto id = b->
data()->dst.id;
171 b->
data()->dstNode = dst;
187 :
If(device->service()->executor(), local_nodes_count)
Base class for all QMember types that hold data in an expandable format.
void unref()
Decrement count.
T * data()
get a pointer to the start of the data.
Base class of everything with a virtual destructor.
An object that can be scheduled on an executor to run.
virtual void add(Executable *action, unsigned priority=UINT_MAX)=0
Send a message to this Executor's queue.
void register_port(port_type *port)
Adds a new port.
void unregister_port(port_type *port)
Removes a previously added port.
HubPort that connects a select-aware device to a strongly typed Hub.
An object that can schedule itself on an executor to run.
virtual void notify()=0
Generic callback.
ExecutorBase * executor()
void send(MessageType *msg, unsigned priority=UINT_MAX) OVERRIDE
Sends a message to the state flow for processing.
Implementation of sequence number generator that uses the real clock.
Network interface class for a character stream link that speaks the (point-to-point) TcpTransfer prot...
TcpSendFlow * sendFlow_
Flow used for converting GenMessage into the binary representation.
bool matching_node(NodeHandle expected, NodeHandle actual) override
void delete_owned_flow(Destructable *d)
Finds a given pointer in the owned flows list, deletes it and removes it from the list.
void delete_local_node(Node *node) override
Removes a local node from this interface.
void add_owned_flow(Executable *e) override
Transfers ownership of a module to the interface.
void add_network_fd(int fd, Notifiable *on_error=nullptr)
Adds a network client connection to the device.
HubFlow * device_
Where to send traffic to.
ClockBaseSequenceNumberGenerator * seq_
Sequence number generator for outgoing TCP packets.
std::vector< std::unique_ptr< Destructable > > ownedFlows_
Various implementation control flows that this interface owns.
NodeID get_default_node_id() override
TcpRecvFlow * recvFlow_
Flow for parsing incoming messages. Owned by ownedFlows_.
IfTcp(NodeID gateway_node_id, HubFlow *device, int local_nodes_count)
Creates a TCP interface.
Abstract class representing an OpenLCB Interface.
MessageDispatchFlow * dispatcher()
MessageHandler * addressedWriteFlow_
Allocator containing the addressed write flows.
Node * lookup_local_node(NodeID id)
Looks up a node ID in the local nodes' registry.
MessageHandler * globalWriteFlow_
Allocator containing the global write flows.
Component that drops incoming addressed messages that are not destined for a local node.
Base class for NMRAnet nodes conforming to the asynchronous interface.
Simple stateless translator for incoming TCP messages from binary format into the structured format.
This flow renders outgoing OpenLCB messages to their TCP stream representation.
NodeID get_gateway_node_id()
Message handler that is registered as a fallback handler in the interface's message dispatcher.
This handler handles VerifyNodeId messages (both addressed and global) on the interface level.
#define LOG(level, message...)
Conditionally write a message to the logging output.
static const int VERBOSE
Loglevel that is usually not printed, reporting debugging information.
#define LOG_ERROR(message...)
Shorthand for LOG(LEVEL_ERROR, message...). See LOG.
uint64_t NodeID
48-bit NMRAnet Node ID type
Container of both a NodeID and NodeAlias.
NodeID id
48-bit NMRAnet Node ID