37#ifndef _UTILS_DIRECTHUB_HXX_
38#define _UTILS_DIRECTHUB_HXX_
218 std::unique_ptr<MessageSegmenter> segmenter,
AutoReleaseBuffer< T > BufferPtr
Smart pointer for buffers.
void create_port_for_fd(ByteDirectHubInterface *hub, int fd, std::unique_ptr< MessageSegmenter > segmenter, Notifiable *on_error=nullptr)
Creates a hub port of byte stream type reading/writing a given fd.
void create_direct_gc_tcp_hub(ByteDirectHubInterface *hub, int port)
Creates a new GridConnect listener on a given TCP port.
ByteDirectHubInterface * create_hub(ExecutorBase *e)
Creates a new byte stream typed hub.
MessageSegmenter * create_gc_message_segmenter()
Creates a message segmenter for gridconnect data.
Destructable * create_gc_to_legacy_can_bridge(DirectHubInterface< uint8_t[]> *gc_hub, CanHubFlow *can_hub)
Creates a bridge between a gridconnect-based DirectHub and an old style CAN hub flow.
MessageSegmenter * create_trivial_message_segmenter()
Creates a message segmenter for arbitrary data.
HubContainer< CanFrameContainer > CanHubData
This class can be sent via a Buffer to a CAN hub.
GenericHubFlow< CanHubData > CanHubFlow
A hub that proxies packets of CAN frames.
A BarrierNotifiable allows to create a number of child Notifiable and wait for all of them to finish.
void notify() override
Implementation of the barrier semantics.
Base class of everything with a virtual destructor.
Interface for a the central part of a hub.
virtual MessageAccessor< T > * mutable_message()=0
Accessor to fill in the message payload.
virtual void unregister_port(DirectHubPort< T > *port, Notifiable *done)=0
Asynchronously removes a port from this hub.
virtual void register_port(DirectHubPort< T > *port)=0
Adds a port to this hub.
virtual void enqueue_send(Executable *caller)=0
Signals that the caller wants to send a message to the hub.
virtual void unregister_port(DirectHubPort< T > *port)=0
Synchronously removes a port from this hub.
virtual Service * get_service()=0
virtual void do_send()=0
Sends a message to the hub.
Interface for a downstream port of a hub (aka a target to send data to).
virtual void send(MessageAccessor< T > *msg)=0
Send some data out on this port.
An object that can be scheduled on an executor to run.
This class implements an execution of tasks pulled off an input queue.
Templated implementation of the HubFlow.
Data type wrapper for sending data through a Hub.
Empty class that can be used as a pointer for identifying where a piece of data came from.
A class that keeps ownership of a chain of linked DataBuffer references.
Abstract base class for segmenting a byte stream typed input into meaningful packet sized chunks.
virtual ssize_t segment_message(const void *data, size_t size)=0
Makes a segmenting decision given more input data.
virtual void clear()=0
Resets internal state machine.
An object that can schedule itself on an executor to run.
Collection of related state machines that pend on incoming messages.
Container for (binary) CAN frames going through Hubs.
LinkedDataBufferPtr buf_
Owns a sequence of linked DataBuffers, holds the offset where to start reading in the first one,...
BufferPtr< T > payload_
Contains a reference of the actual data.