CARLA
Public Member Functions | Private Types | Private Attributes | List of all members
carla::client::detail::AtomicList< T > Class Template Reference

Holds an atomic pointer to a list. More...

#include <AtomicList.h>

+ Inheritance diagram for carla::client::detail::AtomicList< T >:
+ Collaboration diagram for carla::client::detail::AtomicList< T >:

Public Member Functions

 AtomicList ()
 
void Clear ()
 
void DeleteByIndex (size_t index)
 
template<typename ValueT >
void DeleteByValue (const ValueT &value)
 
std::shared_ptr< const ListTLoad () const
 Returns a pointer to the list. More...
 
template<typename ValueT >
void Push (ValueT &&value)
 

Private Types

using ListT = std::vector< T >
 

Private Attributes

AtomicSharedPtr< const ListT_list
 
std::mutex _mutex
 

Additional Inherited Members

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

Detailed Description

template<typename T>
class carla::client::detail::AtomicList< T >

Holds an atomic pointer to a list.

Warning
Only Load method is atomic, modifications to the list are locked with a mutex.

Definition at line 25 of file AtomicList.h.

Member Typedef Documentation

◆ ListT

template<typename T>
using carla::client::detail::AtomicList< T >::ListT = std::vector<T>
private

Definition at line 26 of file AtomicList.h.

Constructor & Destructor Documentation

◆ AtomicList()

template<typename T>
carla::client::detail::AtomicList< T >::AtomicList ( )
inline

Definition at line 29 of file AtomicList.h.

Member Function Documentation

◆ Clear()

template<typename T>
void carla::client::detail::AtomicList< T >::Clear ( void  )
inline

Definition at line 56 of file AtomicList.h.

◆ DeleteByIndex()

template<typename T>
void carla::client::detail::AtomicList< T >::DeleteByIndex ( size_t  index)
inline

Definition at line 39 of file AtomicList.h.

◆ DeleteByValue()

template<typename T>
template<typename ValueT >
void carla::client::detail::AtomicList< T >::DeleteByValue ( const ValueT &  value)
inline

Definition at line 49 of file AtomicList.h.

◆ Load()

template<typename T>
std::shared_ptr<const ListT> carla::client::detail::AtomicList< T >::Load ( ) const
inline

Returns a pointer to the list.

Definition at line 62 of file AtomicList.h.

Referenced by carla::client::detail::AtomicList< carla::client::detail::CallbackList::Item >::DeleteByIndex(), carla::client::detail::AtomicList< carla::client::detail::CallbackList::Item >::DeleteByValue(), and carla::client::detail::AtomicList< carla::client::detail::CallbackList::Item >::Push().

+ Here is the caller graph for this function:

◆ Push()

template<typename T>
template<typename ValueT >
void carla::client::detail::AtomicList< T >::Push ( ValueT &&  value)
inline

Definition at line 32 of file AtomicList.h.

Member Data Documentation

◆ _list

template<typename T>
AtomicSharedPtr<const ListT> carla::client::detail::AtomicList< T >::_list
private

◆ _mutex

template<typename T>
std::mutex carla::client::detail::AtomicList< T >::_mutex
private

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