dtlmod::DTL

class DTL

A class that implements a Data Transport Layer abstraction.

Public Functions

std::shared_ptr<Stream> add_stream(const std::string &name)

Add a data stream to the Data Transport Layer.

Parameters:

name – The name of the Stream to add to the DTL.

Returns:

A handler on the newly created Stream object.

inline const std::unordered_map<std::string, std::shared_ptr<Stream>> &get_all_streams() const

Retrieve all streams declared in the Data Transport by its name.

Returns:

a map of handlers on Stream objects with their names as keys.

std::shared_ptr<Stream> get_stream_by_name_or_null(const std::string &name) const

Retrieve a data stream from the Data Transport Layer by its name.

Parameters:

name – The name of the Stream to retrieve.

Returns:

A handler on the Stream object or nullptr if it doesn’t exist.

inline bool has_active_connections() const

Helper function to check whether some simulated actors are currently connected to the DTL.

Returns:

A boolean value.

Public Static Functions

static std::shared_ptr<DTL> connect()

Connect an Actor to the Data Transport Layer.

Returns:

A handler on the DTL object.

static void create()

Create the Data Transport Layer.

static void create(const std::string &filename)

Create the Data Transport Layer.

Parameters:

filename – a JSON configuration file that provide stream parameters.

static void disconnect()

Disconnect an Actor to the Data Transport Layer.