34#ifndef _UTILS_HUB_HXX_
35#define _UTILS_HUB_HXX_
78 CLR_CAN_FRAME_ERR(*
this);
79 CLR_CAN_FRAME_RTR(*
this);
80 SET_CAN_FRAME_EFF(*
this);
90 const struct can_frame &
frame()
const
162 this->negateMatch_ =
true;
204 printf(
"%lld.%06lld: %s", ts / 1000000000, (ts / 1000) % 1000000,
207 printf(
"%s", s.c_str());
FlowInterface< Buffer< HubData > > HubPortInterface
All ports interfacing via a hub will have to derive from this flow.
static const uintptr_t POINTER_MASK
This should work for both 32 and 64-bit architectures.
StateFlow< Buffer< HubData >, QList< 1 > > HubPort
Base class for a port to an ascii hub that is implemented as a stateflow.
StateFlow< Buffer< CanHubData >, QList< 1 > > CanHubPort
Base class for a port to an CAN hub that is implemented as a stateflow.
GenericHubFlow< HubData > HubFlow
A generic hub that proxies packets of untyped (aka string) data.
HubContainer< CanFrameContainer > CanHubData
This class can be sent via a Buffer to a CAN hub.
FlowInterface< Buffer< CanHubData > > CanHubPortInterface
Interface class for a port to an CAN hub.
HubContainer< string > HubData
This class can be sent via a Buffer to a 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.
Base class for all QMember types that hold data in an expandable format.
Base class of everything with a virtual destructor.
Type-specific implementations of the DispatchFlow methods.
void register_handler(HandlerType *handler, ID id, ID mask)
Adds a new handler to this dispatcher.
void unregister_handler(HandlerType *handler, ID id, ID mask)
Removes a specific instance of a handler from this dispatcher.
This port prints all traffic from a (string-typed) hub to stdout.
bool timestamped_
true if the timestamp and debug info should be printed.
Action entry() override
Entry into the StateFlow activity.
DisplayPort(Service *service, bool timestamped)
Constructor.
This class implements an execution of tasks pulled off an input queue.
Shared base class for thread-based and select-based hub devices.
int fd_
The device file descriptor.
Shared base class for thread-based and select-based hub devices.
FdHubPortService(ExecutorBase *exec, int fd)
Constructor.
virtual void report_write_error()=0
Callback from the write flow when it encounters an error.
virtual void report_read_error()=0
Callback from the readflow when it encounters an error.
BarrierNotifiable barrier_
This notifiable will be called (if not NULL) upon read or write error.
Abstract class for message recipients.
Templated implementation of the HubFlow.
GenericHubFlow(Service *s)
Constructor.
FlowInterface< buffer_type > port_type
Base type of an individual port.
void register_port(port_type *port)
Adds a new port.
Buffer< value_type > buffer_type
Type of a biffer being forwarded.
D value_type
Payload of the buffer.
void unregister_port(port_type *port)
Removes a previously added port.
Data type wrapper for sending data through a Hub.
uintptr_t id_type
The type of the identified of these object in the HUB.
id_type id()
Defines the indentifier used for the DispatchFlow inside the Hub.
FlowInterface< Buffer< HubContainer< T > > > * skipMember_
Defines which registered member of the hub should be skipped when the output members are enumerated.
State flow implementing select-aware fd reads.
Collection of related state machines that pend on incoming messages.
Return type for a state flow callback.
Service * service()
Return a pointer to the service I am bound to.
Action release_and_exit()
Terminates the processing of the current message.
State flow with a given typed input queue.
Container for an arbitrary structure to pass through a Hub.
const void * data() const
This flow is listening to data from a TCP connection, segments the incoming data into TcpMessages bas...
long long os_get_time_monotonic(void)
Get the monotonic time since the system started.
Container for (binary) CAN frames going through Hubs.
const struct can_frame & frame() const
struct can_frame * mutable_frame()