CARLA
Loading...
Searching...
No Matches
carla::client::detail::CallbackList< InputsT > Class Template Reference

#include <CallbackList.h>

Inheritance diagram for carla::client::detail::CallbackList< InputsT >:

Classes

struct  Item

Public Types

using CallbackType = std::function<void(InputsT...)>

Public Member Functions

void Call (InputsT... args) const
void Clear ()
size_t Push (CallbackType &&callback)
void Remove (size_t id)

Private Attributes

std::atomic_size_t _counter {0u}
AtomicList< Item > _list

Additional Inherited Members

Private Member Functions inherited from carla::NonCopyable
 NonCopyable ()=default
 NonCopyable (const NonCopyable &)=delete
 NonCopyable (NonCopyable &&)=delete
NonCopyable & operator= (const NonCopyable &)=delete
NonCopyable & operator= (NonCopyable &&)=delete

Detailed Description

template<typename... InputsT>
class carla::client::detail::CallbackList< InputsT >

Definition at line 20 of file CallbackList.h.

Member Typedef Documentation

◆ CallbackType

template<typename... InputsT>
using carla::client::detail::CallbackList< InputsT >::CallbackType = std::function<void(InputsT...)>

Definition at line 23 of file CallbackList.h.

Member Function Documentation

◆ Call()

template<typename... InputsT>
void carla::client::detail::CallbackList< InputsT >::Call ( InputsT... args) const
inline

Definition at line 25 of file CallbackList.h.

References _list.

◆ Clear()

template<typename... InputsT>
void carla::client::detail::CallbackList< InputsT >::Clear ( )
inline

Definition at line 43 of file CallbackList.h.

References _list.

◆ Push()

template<typename... InputsT>
size_t carla::client::detail::CallbackList< InputsT >::Push ( CallbackType && callback)
inline

Definition at line 32 of file CallbackList.h.

References _counter, _list, and DEBUG_ASSERT.

◆ Remove()

template<typename... InputsT>
void carla::client::detail::CallbackList< InputsT >::Remove ( size_t id)
inline

Definition at line 39 of file CallbackList.h.

References _list.

Member Data Documentation

◆ _counter

template<typename... InputsT>
std::atomic_size_t carla::client::detail::CallbackList< InputsT >::_counter {0u}
private

Definition at line 66 of file CallbackList.h.

Referenced by Push().

◆ _list

template<typename... InputsT>
AtomicList<Item> carla::client::detail::CallbackList< InputsT >::_list
private

Definition at line 68 of file CallbackList.h.

Referenced by Call(), Clear(), Push(), and Remove().


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