Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
GridConnectHub.hxx
Go to the documentation of this file.
1
34#ifndef _UTILS_GRIDCONNECTHUB_HXX_
35#define _UTILS_GRIDCONNECTHUB_HXX_
36
37#include <memory>
38
39#include "utils/Hub.hxx"
40
41class Pipe;
42template <class T> class FlowInterface;
43template <class T, int N> class DispatchFlow;
44
52{
53public:
54 virtual ~GCAdapterBase()
55 {
56 }
57
62 virtual bool shutdown() = 0;
63
84 CanHubFlow *can_side,
85 bool double_bytes);
86
102 static GCAdapterBase *CreateGridConnectAdapter(HubFlow *gc_side_read,
103 HubFlow *gc_side_write, CanHubFlow *can_side, bool double_bytes);
104};
105
109{
110public:
116 GcPacketPrinter(CanHubFlow *can_hub, bool timestamped);
118private:
120 struct Impl;
122 std::unique_ptr<Impl> impl_;
123};
124
139void create_gc_port_for_can_hub(CanHubFlow *can_hub, int fd,
140 Notifiable *on_exit = nullptr, bool use_select = false);
141
142#endif //_UTILS_GRIDCONNECTHUB_HXX_
void create_gc_port_for_can_hub(CanHubFlow *can_hub, int fd, Notifiable *on_exit=nullptr, bool use_select=false)
Creates a new port on a CAN hub in gridconnect format for a select-compatible file descriptor.
Type-specific implementations of the DispatchFlow methods.
Abstract class for message recipients.
Publicly visible API for the gridconnect-to-CAN bridge.
static GCAdapterBase * CreateGridConnectAdapter(HubFlow *gc_side, CanHubFlow *can_side, bool double_bytes)
This function connects an ASCII (GridConnect-format) CAN adapter to a binary CAN adapter,...
virtual bool shutdown()=0
Unregisters *this from the pipes.
Create this port for a CAN hub and all packets will be written to stdout in gridconnect format.
std::unique_ptr< Impl > impl_
pImpl object.
An object that can schedule itself on an executor to run.
Private data for a can device.
Definition Pipe.cxx:47
Implementation for the gridconnect bridge.