|
Open Model Railroad Network (OpenMRN)
|
Go to the source code of this file.
Classes | |
| class | HubSource |
| Empty class that can be used as a pointer for identifying where a piece of data came from. More... | |
| struct | MessageMetadata |
| Metadata that is the same about every message (independent of data type). More... | |
| struct | MessageAccessor< T > |
| Typed message class. More... | |
| struct | MessageAccessor< uint8_t[]> |
| Type specializer for message interface when we are sending untyped data (i.e., byte streams). More... | |
| class | MessageSegmenter |
| Abstract base class for segmenting a byte stream typed input into meaningful packet sized chunks. More... | |
| class | DirectHubPort< T > |
| Interface for a downstream port of a hub (aka a target to send data to). More... | |
| class | DirectHubInterface< T > |
| Interface for a the central part of a hub. More... | |
Typedefs | |
| typedef DirectHubInterface< uint8_t[]> | ByteDirectHubInterface |
| typedef HubContainer< CanFrameContainer > | CanHubData |
| typedef GenericHubFlow< CanHubData > | CanHubFlow |
Functions | |
| ByteDirectHubInterface * | create_hub (ExecutorBase *e) |
| Creates a new byte stream typed hub. | |
| 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. | |
| MessageSegmenter * | create_gc_message_segmenter () |
| Creates a message segmenter for gridconnect data. | |
| MessageSegmenter * | create_trivial_message_segmenter () |
| Creates a message segmenter for arbitrary 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. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Optimized class for ingress and egress of write-once objects, aimed to support multi-recipient messages with fast internal fan-out but low compute overhead.
Definition in file DirectHub.hxx.
| typedef DirectHubInterface<uint8_t[]> ByteDirectHubInterface |
Definition at line 203 of file DirectHub.hxx.
| typedef HubContainer<CanFrameContainer> CanHubData |
Definition at line 241 of file DirectHub.hxx.
| typedef GenericHubFlow<CanHubData> CanHubFlow |
Definition at line 242 of file DirectHub.hxx.
| void create_direct_gc_tcp_hub | ( | ByteDirectHubInterface * | hub, |
| int | port | ||
| ) |
Creates a new GridConnect listener on a given TCP port.
The object is leaked (never destroyed).
| hub | incoming and outgoing data will be multiplexed through this hub instance. |
| port | the TCP port to listen on. |
Definition at line 945 of file DirectHub.cxx.
| MessageSegmenter * create_gc_message_segmenter | ( | ) |
Creates a message segmenter for gridconnect data.
Definition at line 122 of file DirectHubGc.cxx.
| 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.
| gc_hub | the gridconnect hub. |
| can_hub | the CAN hub. |
Definition at line 182 of file DirectHubLegacy.cxx.
| ByteDirectHubInterface * create_hub | ( | ExecutorBase * | e | ) |
Creates a new byte stream typed hub.
Creates a new byte stream typed hub.
Definition at line 251 of file DirectHub.cxx.
| 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.
This port will be automaticelly deleted upon any error reading/writing the fd (unregistered and memory released).
| hub | hub instance on which to register the new port. Onwership retained by caller. |
| fd | where to read and write data. |
| segmenter | is an newly allocated object for the given protocol to segment incoming data into messages. Transfers ownership to the function. |
| on_error | this will be notified if the port closes due to an error. |
Definition at line 880 of file DirectHub.cxx.
| MessageSegmenter * create_trivial_message_segmenter | ( | ) |
Creates a message segmenter for arbitrary data.
Each buffer is left alone.
Definition at line 145 of file DirectHubGc.cxx.