VkCV Framework  0.0.1
CV Vulkan framework
vkcv::event< T > Struct Template Reference

#include <Event.hpp>

Public Member Functions

void operator() (T... arguments)
 
event_handle< T... > add (typename event_function< T... >::type callback)
 
void remove (event_handle< T... > handle)
 
void lock ()
 
void unlock ()
 
 event (bool locked=false)
 
 event (const event &other)=delete
 
 event (event &&other)=delete
 
eventoperator= (const event &other)=delete
 
eventoperator= (event &&other)=delete
 

Private Attributes

std::vector< event_function< T... > > m_functions
 
uint32_t m_id_counter
 
std::binary_semaphore m_semaphore
 

Detailed Description

template<typename... T>
struct vkcv::event< T >

template for event handling

Template Parameters
Tparameter list

Member Function Documentation

◆ add()

template<typename... T>
event_handle<T...> vkcv::event< T >::add ( typename event_function< T... >::type  callback)
inline

adds a function handle to the event to be called

Parameters
callbackof the function
Returns
handle of the function

Referenced by vkcv::camera::CameraManager::bindCameraToEvents(), and vkcv::gui::GUI::GUI().

Here is the caller graph for this function:

◆ lock()

template<typename... T>
void vkcv::event< T >::lock ( )
inline

locks the event so its function handles won't be called

Referenced by vkcv::event< int, int, int, int >::operator()(), and vkcv::Window::pollEvents().

Here is the caller graph for this function:

◆ operator()()

template<typename... T>
void vkcv::event< T >::operator() ( T...  arguments)
inline

calls all function handles with the given arguments

Parameters
argumentsof the given function

◆ remove()

template<typename... T>
void vkcv::event< T >::remove ( event_handle< T... >  handle)
inline

removes a function handle of the event

Parameters
handleof the function

Referenced by vkcv::camera::CameraManager::~CameraManager(), and vkcv::gui::GUI::~GUI().

Here is the caller graph for this function:

◆ unlock()

template<typename... T>
void vkcv::event< T >::unlock ( )
inline

unlocks the event so its function handles can be called after locking

Referenced by vkcv::event< int, int, int, int >::operator()(), vkcv::Window::pollEvents(), and vkcv::Window::~Window().

Here is the caller graph for this function:

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