|
ActiveLib
|
#include <Transport.h>

Public Types | |
| using | TimeFormat = std::optional<xml::XMLDateTime::Format> |
| using | size_type = utility::Memory::size_type |
Public Member Functions | |
| Transport (bool isUnknownNameSkipped=false, TimeFormat timeFormat=iso8601) noexcept | |
| virtual | ~Transport () noexcept |
| virtual void | send (serialise::Cargo &&cargo, const serialise::Identity &identity, utility::BufferOut &&destination, bool isTabbed=false, bool isLineFeeds=false, bool isNameSpaces=true, bool isProlog=true) const =0 |
| virtual void | receive (serialise::Cargo &&cargo, const serialise::Identity &identity, utility::BufferIn &&source) const =0 |
| TimeFormat | getTimeFormat () const noexcept |
| size_type | getLastRow () const noexcept |
| size_type | getLastColumn () const noexcept |
| bool | isUnknownNameSkipped () const noexcept |
| void | setTimeFormat (TimeFormat format) noexcept |
| void | setUnknownNameSkipped (bool state) noexcept |
Protected Member Functions | |
| void | setLastRow (size_type row) const noexcept |
| void | setLastColumn (size_type col) const noexcept |
Interface for objects that send/receive data in a serialised form
|
inlinenoexcept |
Default constructor
| isUnknownNameSkipped | True if unknown tags should be skipped (false = stop parsing with an error) |
| timeFormat | The serialisation date/time format (nullopt = use the format specified in each outgoing item) |

|
inlinevirtualnoexcept |
Destructor
|
inlinenoexcept |
Get the last received character column position of the data source (after calling receive, sfor error diagnostics)
|
inlinenoexcept |
Get the last received character row position of the data source (after calling receive, for error diagnostics)
|
inlinenoexcept |
Set the preferred serialisation date/time format
|
inlinenoexcept |
Determine if unknown names are skipped

|
pure virtual |
Receive cargo from a serialised data source
| cargo | The cargo to receive the serialised data |
| identity | The cargo identity (name, optional namespace) |
| source | The data source (can be a wrapper for file, memory, string) |
| std::system_error | Thrown on read errors, invalid encoding or parsing failure (e.g. ill-formed data) |
Implemented in active::serialise::json::JSONTransport, and active::serialise::xml::XMLTransport.
|
pure virtual |
Send serialised cargo to a specified destination
| cargo | The cargo to be serialised |
| identity | The cargo identity (name, optional namespace) |
| destination | The destination buffer for the exported serialised data (can target file, memory, string) |
| isTabbed | True to indent lines with tabs |
| isLineFeeds | True to add line-feeds |
| isNameSpaces | True to inclued namespaces (where specified) |
| isProlog | True if an serialisation prolog should be written |
| std::system_error | Thrown on write errors, serialisation failure (e.g. invalid names, missing inventory etc) |
Implemented in active::serialise::json::JSONTransport, and active::serialise::xml::XMLTransport.
|
inlineprotectednoexcept |
Set the last received character column position of the data source
| col | The last column position received from the data source |
|
inlineprotectednoexcept |
Set the last received character row position of the data source
| row | The last row position received from the data source |
|
inlinenoexcept |
Set the preferred date/time format for serialisation
| format | The preferred date/time format (nullopt = use the format specified in each outgoing item) |
|
inlinenoexcept |
Set whether unknown names are skipped
| state | True if unknown names are skipped |