PLCnext API Documentation 26.6.0.38
Public Types | Public Member Functions | List of all members
Arp::Base::Commons::Runtime::StackCounter Class Reference

This class is used to count sequenced operation calls, which are e.g. invoked during an exception throw. More...

#include <StackCounter.hpp>

Public Types

using Value = size_t
 

Public Member Functions

 StackCounter (void)
 Constructs an StackCounter instance. More...
 
 StackCounter (Value skipDepth)
 Constructs an StackCounter instance. More...
 
 StackCounter (const StackCounter &arg)
 Default copy constructor.
 
 StackCounter (StackCounter &&arg) noexcept=delete
 
StackCounteroperator= (const StackCounter &arg)
 Default copy-assignment operator.
 
StackCounteroperator= (StackCounter &&arg) noexcept=delete
 
 ~StackCounter (void)
 Default destructor.
 
size_t GetDepth (void) const
 Gets the depth of the stack counter. More...
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Detailed Description

This class is used to count sequenced operation calls, which are e.g. invoked during an exception throw.

This helper class determines the number of operation calls, which are invoked during an exception throw, so that the needless operations might be skipped, when creating the stacktrace information of the exception. The user is just interested in the stacktrace of its own code, but not any platform code, which is required to create the exception and its content.

Constructor & Destructor Documentation

◆ StackCounter() [1/2]

Arp::Base::Commons::Runtime::StackCounter::StackCounter ( void  )
default

Constructs an StackCounter instance.

The default constructor initializes the initial skip depth to 2, because this is the most common use case.

◆ StackCounter() [2/2]

Arp::Base::Commons::Runtime::StackCounter::StackCounter ( Value  skipDepth)
explicit

Constructs an StackCounter instance.

Parameters
skipDepthThe inital skip depth of the stack counter.

Member Function Documentation

◆ GetDepth()

StackCounter::Value Arp::Base::Commons::Runtime::StackCounter::GetDepth ( void  ) const

Gets the depth of the stack counter.

Returns
The depth of the stack counter.

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