COMMS
Template library intended to help with implementation of communication protocols.
Public Types | Public Member Functions | List of all members
comms::EnableAssert< TAssert > Class Template Reference

#include "comms/Assert.h"

Detailed Description

template<typename TAssert>
class comms::EnableAssert< TAssert >

Enable new assertion behaviour.

Instantiate object of this class to enable new behaviour of assertion failure.

Template Parameters
TAssertClass derived from Assert that implements new custom behaviour of the assertion failure.
Precondition
TAssert class must be derived from comms::Assert.

Public Types

using AssertType = TAssert
 Type of assert object.
 

Public Member Functions

template<typename... TParams>
 EnableAssert (TParams &&... args)
 Constructor. More...
 
 ~EnableAssert () noexcept
 Destructor. More...
 
AssertTypegetAssert ()
 Provides reference to internal Assert object. More...
 

Constructor & Destructor Documentation

◆ EnableAssert()

template<typename TAssert >
template<typename... TParams>
comms::EnableAssert< TAssert >::EnableAssert ( TParams &&...  args)

Constructor.

Registers new assertion failure behaviour. It forwards all the provided parameters to the constructor of embedded assertion object of type TAssert.

Parameters
argsArguments to pass to the assertion class constructor.

◆ ~EnableAssert()

template<typename TAssert >
comms::EnableAssert< TAssert >::~EnableAssert ( )
noexcept

Destructor.

Restores the assertion behaviour that was recorded during the instantiation of this object.

Member Function Documentation

◆ getAssert()

template<typename TAssert >
AssertType& comms::EnableAssert< TAssert >::getAssert ( )

Provides reference to internal Assert object.

Returns
Reference to object of type TAssert.

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