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

Filter used to restrict which IP addresses may communicate with a server. More...

#include <rodbus.hpp>

Public Member Functions

 AddressFilter (AddressFilter &&other) noexcept
 Transfer ownership of the underlying C-type to this instance and invalidate the other instance. More...
 
 AddressFilter (const std::string &address)
 Create an address filter that matches one or more IP addresses. Ipv4 or IPv6 addresses are allowed. More...
 
 ~AddressFilter ()
 Destroy an address filter. More...
 
void add (const std::string &address)
 Add an allowed IP address to the filter. More...
 

Static Public Member Functions

static AddressFilter any ()
 Create an address filter that accepts any IP address. More...
 

Friends

class CppAddressFilterFriend
 

Detailed Description

Filter used to restrict which IP addresses may communicate with a server.

Constructor & Destructor Documentation

◆ AddressFilter() [1/2]

rodbus::AddressFilter::AddressFilter ( AddressFilter &&  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

◆ AddressFilter() [2/2]

rodbus::AddressFilter::AddressFilter ( const std::string &  address)

Create an address filter that matches one or more IP addresses. Ipv4 or IPv6 addresses are allowed.

Examples: 192.168.1.26, 192.168.0.*, *.*.*.*

Wildcards are only supported for IPv4 addresses

Parameters
addressIP address to accept
Exceptions
ParamException

◆ ~AddressFilter()

rodbus::AddressFilter::~AddressFilter ( )

Destroy an address filter.

Member Function Documentation

◆ add()

void rodbus::AddressFilter::add ( const std::string &  address)

Add an allowed IP address to the filter.

This function may only be called if the AddressFilter was initially constructed with a single static address

Parameters
addressIP address to add
Exceptions
ParamException

◆ any()

static AddressFilter rodbus::AddressFilter::any ( )
static

Create an address filter that accepts any IP address.

Returns
Address filter

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