FireSTARR
Loading...
Searching...
No Matches
fs::SafeVector Class Reference

A vector with added thread safety. More...

#include <SafeVector.h>

Collaboration diagram for fs::SafeVector:

Public Member Functions

 SafeVector ()=default
 Construct empty SafeVector.
 
 SafeVector (const SafeVector &rhs)
 
 SafeVector (SafeVector &&rhs) noexcept
 
SafeVector & operator= (const SafeVector &rhs) noexcept
 
SafeVector & operator= (SafeVector &&rhs) noexcept
 
void addValue (MathSize value)
 Add a value to the SafeVector.
 
std::vector< MathSize > getValues () const
 Get a vector with the stored values.
 
Statistics getStatistics () const
 Calculate Statistics for values in this SafeVector.
 
size_t size () const noexcept
 Number of values in the SafeVector.
 

Private Attributes

std::vector< MathSize > values_ {}
 Vector of stored values.
 
mutex mutex_ {}
 Mutex for parallel access.
 

Detailed Description

A vector with added thread safety.

Member Function Documentation

◆ addValue()

void fs::SafeVector::addValue ( MathSize value)

Add a value to the SafeVector.

Parameters
valueValue to add

◆ getStatistics()

Statistics fs::SafeVector::getStatistics ( ) const
nodiscard

Calculate Statistics for values in this SafeVector.

Returns
Statistics for values in this SafeVector

◆ getValues()

vector< MathSize > fs::SafeVector::getValues ( ) const
nodiscard

Get a vector with the stored values.

Returns
A vector with the stored values
Here is the caller graph for this function:

◆ size()

size_t fs::SafeVector::size ( ) const
nodiscardnoexcept

Number of values in the SafeVector.

Returns
Size of the SafeVector

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