API Documentation
Public Member Functions | List of all members
nkDebug::FunctionSet Class Referencefinal

A function set holding testing functions. More...

Public Member Functions

 FunctionSet () noexcept
 
 ~FunctionSet ()
 
std::function< void()> registerFunction (const char *name, std::function< void()> func)
 
TestFunctiongetTestFunction (unsigned int index) const
 
nkMemory::BufferCast< TestFunction * > getTestFunctions (nkMemory::StringView filter="") const
 
unsigned int getSetSize () const
 

Detailed Description

A function set holding testing functions.

Mainly used internally to keep track of registered functions.

Constructor & Destructor Documentation

◆ FunctionSet()

nkDebug::FunctionSet::FunctionSet ( )
noexcept

Default constructor.

◆ ~FunctionSet()

nkDebug::FunctionSet::~FunctionSet ( )

Destructor.

Member Function Documentation

◆ registerFunction()

std::function<void ()> nkDebug::FunctionSet::registerFunction ( const char *  name,
std::function< void()>  func 
)

Register a new function into the set.

Parameters
nameThe function name to attach.
funcThe function to call.
Returns
The function registered.

◆ getTestFunction()

TestFunction* nkDebug::FunctionSet::getTestFunction ( unsigned int  index) const
Parameters
indexThe index of the function to retrieve.
Returns
The function at given index if the set has such an index, nullptr otherwise.

◆ getTestFunctions()

nkMemory::BufferCast<TestFunction*> nkDebug::FunctionSet::getTestFunctions ( nkMemory::StringView  filter = "") const

Allows to retrieve a subset of the registered functions depending on a filter on their names.

Parameters
filterThe filter to apply, in an ECMA script compatible regex format.
Returns
The subset of functions registered satisfying the filter provided.

◆ getSetSize()

unsigned int nkDebug::FunctionSet::getSetSize ( ) const
Returns
The number of functions registered in the set.

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