rodbus (C++ API) 1.3.1
Loading...
Searching...
No Matches
rodbus::DeviceMap Class Reference

Maps endpoint handlers to Modbus address. More...

#include <rodbus.hpp>

Public Member Functions

 DeviceMap (DeviceMap &&other) noexcept
 Transfer ownership of the underlying C-type to this instance and invalidate the other instance. More...
 
 DeviceMap ()
 Create a device map that will be used to bind devices to a server endpoint. More...
 
 ~DeviceMap ()
 Destroy a previously created device map. More...
 
bool add_endpoint (uint8_t unit_id, std::unique_ptr< WriteHandler > handler, DatabaseCallback &configure)
 Add an endpoint to the map. More...
 

Friends

class CppDeviceMapFriend
 

Detailed Description

Maps endpoint handlers to Modbus address.

Constructor & Destructor Documentation

◆ DeviceMap() [1/2]

rodbus::DeviceMap::DeviceMap ( DeviceMap &&  other)
inlinenoexcept

Transfer ownership of the underlying C-type to this instance and invalidate the other instance.

Note
the moved class will now throw an exception if any method is called
Parameters
otherClass from which ownership will be transfer to this instance

◆ DeviceMap() [2/2]

rodbus::DeviceMap::DeviceMap ( )

Create a device map that will be used to bind devices to a server endpoint.

◆ ~DeviceMap()

rodbus::DeviceMap::~DeviceMap ( )

Destroy a previously created device map.

Member Function Documentation

◆ add_endpoint()

bool rodbus::DeviceMap::add_endpoint ( uint8_t  unit_id,
std::unique_ptr< WriteHandler handler,
DatabaseCallback configure 
)

Add an endpoint to the map.

Parameters
unit_idUnit id of the endpoint
handlerCallback interface for handling write operations for this device
configureOne-time callback interface configuring the initial state of the database
Returns
True if the unit id doesn't already exists, false otherwise

The documentation for this class was generated from the following file: