Leviathan game engine
Leviathan::LambdaDelegateSlot Class Reference

#include <DelegateSlot.h>

+ Inheritance diagram for Leviathan::LambdaDelegateSlot:

Public Member Functions

void OnCalled (const NamedVars::pointer &values) override
 Called from Delegate::Call. More...
- Public Member Functions inherited from Leviathan::BaseDelegateSlot
- Public Member Functions inherited from Leviathan::ReferenceCounted
 ReferenceCounted (const ReferenceCounted &other)=delete
ReferenceCountedoperator= (const ReferenceCounted &other)=delete
FORCE_INLINE void AddRef ()
FORCE_INLINE void Release ()
 removes a reference and deletes the object if reference count reaches zero More...
int32_t GetRefCount () const
 Returns the reference count. More...

Protected Member Functions

 LambdaDelegateSlot (std::function< void(const NamedVars::pointer &values)> callback)
- Protected Member Functions inherited from Leviathan::ReferenceCounted
DLLEXPORT ReferenceCounted ()
virtual DLLEXPORT ~ReferenceCounted ()

Protected Attributes

friend ReferenceCounted

Additional Inherited Members

- Public Types inherited from Leviathan::ReferenceCounted
using basepointer = boost::intrusive_ptr< ReferenceCounted >
using refcountedpointer = boost::intrusive_ptr< ReferenceCounted >
- Static Public Member Functions inherited from Leviathan::ReferenceCounted
template<class ActualType >
static boost::intrusive_ptr< ActualType > WrapPtr (ActualType *ptr)
 Creates an intrusive_ptr from raw pointer. More...
template<class ActualType , class... Args>
static boost::intrusive_ptr< ActualType > MakeShared (Args &&... args)
 Constructs a new instance and wraps it. More...

Detailed Description

Definition at line 23 of file DelegateSlot.h.

Constructor & Destructor Documentation

◆ LambdaDelegateSlot()

Leviathan::LambdaDelegateSlot::LambdaDelegateSlot ( std::function< void(const NamedVars::pointer &values)>  callback)

Definition at line 35 of file DelegateSlot.h.

35  :
36  Callback(callback){
38  }

Member Function Documentation

◆ OnCalled()

void Leviathan::LambdaDelegateSlot::OnCalled ( const NamedVars::pointer &  values)

Called from Delegate::Call.

Implements Leviathan::BaseDelegateSlot.

Definition at line 26 of file DelegateSlot.h.

26  {
27  Callback(values);
28  }

Member Data Documentation

◆ ReferenceCounted

friend Leviathan::LambdaDelegateSlot::ReferenceCounted

Definition at line 33 of file DelegateSlot.h.

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