Kea 2.7.5
isc::util::CSCallbackSet Struct Reference

Embodies a named set of CriticalSection callbacks. More...

#include <multi_threading_mgr.h>

Public Types

typedef std::function< void()> Callback
 Defines a callback as a simple void() functor.
 

Public Member Functions

 CSCallbackSet (const std::string &name, const Callback &check_cb, const Callback &entry_cb, const Callback &exit_cb)
 Constructor.
 

Public Attributes

Callback check_cb_
 Check permissions callback associated with name.
 
Callback entry_cb_
 Entry point callback associated with name.
 
Callback exit_cb_
 Exit point callback associated with name.
 
std::string name_
 Name by which the callback can be found.
 

Detailed Description

Embodies a named set of CriticalSection callbacks.

This class associates with a name, a set of callbacks, one to be invoked before CriticalSection entry and exit callbacks to check current thread permissions to perform such actions, one to be invoked upon CriticalSection entry and one to be invoked upon CriticalSection exit. The name allows the set to be uniquely identified such that they can be added and removed as needed. The check current thread permissions callback needs to throw MultiThreadingInvalidOperation if the thread is not allowed to perform CriticalSection entry and exit. Any other exception thrown by the check permission callbacks will be silently ignored. The CriticalSection entry and exit callbacks exceptions will be silently ignored.

Definition at line 36 of file multi_threading_mgr.h.

Member Typedef Documentation

◆ Callback

typedef std::function<void()> isc::util::CSCallbackSet::Callback

Defines a callback as a simple void() functor.

Definition at line 38 of file multi_threading_mgr.h.

Constructor & Destructor Documentation

◆ CSCallbackSet()

isc::util::CSCallbackSet::CSCallbackSet ( const std::string & name,
const Callback & check_cb,
const Callback & entry_cb,
const Callback & exit_cb )
inline

Constructor.

Parameters
nameName by which the callbacks can be found.
check_cbCallback to check current thread permissions to call the CriticalSection entry and exit callbacks.
entry_cbCallback to invoke upon CriticalSection entry.
exit_cbCallback to invoke upon CriticalSection exit.

Definition at line 47 of file multi_threading_mgr.h.

Member Data Documentation

◆ check_cb_

Callback isc::util::CSCallbackSet::check_cb_

Check permissions callback associated with name.

Definition at line 56 of file multi_threading_mgr.h.

◆ entry_cb_

Callback isc::util::CSCallbackSet::entry_cb_

Entry point callback associated with name.

Definition at line 59 of file multi_threading_mgr.h.

◆ exit_cb_

Callback isc::util::CSCallbackSet::exit_cb_

Exit point callback associated with name.

Definition at line 62 of file multi_threading_mgr.h.

◆ name_

std::string isc::util::CSCallbackSet::name_

Name by which the callback can be found.

Definition at line 53 of file multi_threading_mgr.h.


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