C++ Pixels Library For Windows
Enable communications with Pixels dice using Bluetooth Low Energy.
Loading...
Searching...
No Matches
Systemic::GuardedList< T > Class Template Reference

A simple thread safe list of items. More...

#include <GuardedList.h>

Public Types

using Index = typename std::list< T >::const_iterator
 Type of an item index.
 

Public Member Functions

std::vector< T > get () const
 Gets a copy of the list of items. More...
 
Index add (const T &item)
 Adds the given item to the list and returns its index. More...
 
void remove (const Index &index)
 Removes the item at the given index from the list. More...
 

Detailed Description

template<typename T>
class Systemic::GuardedList< T >

A simple thread safe list of items.

Template Parameters
TThe item type.

Member Function Documentation

◆ add()

template<typename T >
Index Systemic::GuardedList< T >::add ( const T &  item)

Adds the given item to the list and returns its index.

Parameters
itemThe item to add.
Returns
The index of the added item.

◆ get()

template<typename T >
std::vector< T > Systemic::GuardedList< T >::get ( ) const

Gets a copy of the list of items.

Returns
A copy of the list of items.

◆ remove()

template<typename T >
void Systemic::GuardedList< T >::remove ( const Index index)

Removes the item at the given index from the list.

Parameters
indexThe index of the item to remove.

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