VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
tklb::BaseDelegate< Parameters > Class Template Reference

Stripped down version of this delegate implementation https://github.com/marcmo/delegates/tree/f0938dac2ad779226ef637da350e964ac8008ba5 Stripped return value, const and free function version TODO tklb add return type back in. More...

#include <TDelegate.hpp>

Inheritance diagram for tklb::BaseDelegate< Parameters >:
Collaboration diagram for tklb::BaseDelegate< Parameters >:

Public Member Functions

 BaseDelegate (void *context, Callback func)
 
void operator() (Parameters... parameters) const
 
bool valid () const
 

Protected Types

using Callback = void(*)(void *, Parameters...)
 

Protected Attributes

void * mContext
 
Callback mCallback
 

Detailed Description

template<typename... Parameters>
class tklb::BaseDelegate< Parameters >

Stripped down version of this delegate implementation https://github.com/marcmo/delegates/tree/f0938dac2ad779226ef637da350e964ac8008ba5 Stripped return value, const and free function version TODO tklb add return type back in.

Definition at line 13 of file TDelegate.hpp.

Member Typedef Documentation

◆ Callback

template<typename... Parameters>
using tklb::BaseDelegate< Parameters >::Callback = void (*)(void*, Parameters...)
protected

Definition at line 15 of file TDelegate.hpp.

Constructor & Destructor Documentation

◆ BaseDelegate()

template<typename... Parameters>
tklb::BaseDelegate< Parameters >::BaseDelegate ( void *  context,
Callback  func 
)
inline

Definition at line 19 of file TDelegate.hpp.

19: mContext(context), mCallback(func) { }
Callback mCallback
Definition: TDelegate.hpp:17

Member Function Documentation

◆ operator()()

template<typename... Parameters>
void tklb::BaseDelegate< Parameters >::operator() ( Parameters...  parameters) const
inline

Definition at line 20 of file TDelegate.hpp.

20 {
21 (*mCallback)(mContext, parameters...);
22 }

◆ valid()

template<typename... Parameters>
bool tklb::BaseDelegate< Parameters >::valid ( ) const
inline

Definition at line 23 of file TDelegate.hpp.

23{ return mCallback != nullptr; }

Member Data Documentation

◆ mCallback

template<typename... Parameters>
Callback tklb::BaseDelegate< Parameters >::mCallback
protected

Definition at line 17 of file TDelegate.hpp.

◆ mContext

template<typename... Parameters>
void* tklb::BaseDelegate< Parameters >::mContext
protected

Definition at line 16 of file TDelegate.hpp.


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