senf::SocketPolicy< AddressingPolicy > Struct Template Reference

Collection of policy classes. More...

#include <senf/Socket/SocketPolicy.hh>

Static Public Member Functions

static void checkBaseOf (SocketPolicyBase const &other)
 Check dynamic policy compatibility. More...
 

Detailed Description

template<class AddressingPolicy>
struct senf::SocketPolicy< AddressingPolicy >

Collection of policy classes.

The SocketPolicy template defines the complete Policy used by the socket library. It contains one policy class for each policy axis. This template takes one policy from each axis as it's template arguments (this example implementation only has AddressingPolicy as an argument).

A SocketPolicy can be complete or incomplete. An incomplete SocketPolicy will have at least one axis set to Undefined Axis (or a generic derived class which is used to group some other policies but does not (completely) define the policy behavior). A complete SocketPolicy will have a concrete definition of the desired behavior for each policy axis.

See also
The Policy Framework

Definition at line 475 of file SocketPolicy.hh.

Member Function Documentation

◆ checkBaseOf()

template<class AddressingPolicy >
static void senf::SocketPolicy< AddressingPolicy >::checkBaseOf ( SocketPolicyBase const &  other)
static

Check dynamic policy compatibility.

This check will validate, that a socket with other as it's policy is convertible to a socket with the current SocketPolicy as it's policy. This is true, if for each policy axis, the policy class of that axis as defined in the other policy is convertible to the policy class of that same axis in the current SocketPolicy instance (as is defined by the template arguments). This again is true, if the other policy class is derived from (or is the same as) the policy class taken from the current SocketPolicy instance.

In other words, this call checks, that the current SocketPolicy (as defined via the template arguments) is more generic than the other socket policy.

Parameters
[in]otherSocketPolicy to check
Exceptions
std::bad_castif other is not a compatible policy

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