TTK
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ttk::ArrayLinkedList< datatype, size > Class Template Reference

This class describes a dynamic size data structure for thread safe computation. It is a linked list of arrays that also stores the current number of elements. Its key feature is that the addition of an element will never cause the moving of the data structure in memory, unlike an std::vector, making the access to an element thread safe even if another thread is adding elements. More...

#include <ArrayLinkedList.h>

Public Member Functions

 ArrayLinkedList ()
 
datatype * addArrayElement (datatype element)
 

Public Attributes

std::list< std::array< datatype, size > > list_
 
int numberOfElements_
 
std::array< unsigned char, 32 > padding_ {}
 

Detailed Description

template<typename datatype, int size>
class ttk::ArrayLinkedList< datatype, size >

This class describes a dynamic size data structure for thread safe computation. It is a linked list of arrays that also stores the current number of elements. Its key feature is that the addition of an element will never cause the moving of the data structure in memory, unlike an std::vector, making the access to an element thread safe even if another thread is adding elements.

Author
Eve Le Guillou eve.l.nosp@m.e-gu.nosp@m.illou.nosp@m.@lip.nosp@m.6.fr
Date
Mars 2022.
See also
IntegralLines.h for a usage example.

Definition at line 21 of file ArrayLinkedList.h.

Constructor & Destructor Documentation

◆ ArrayLinkedList()

template<typename datatype , int size>
ttk::ArrayLinkedList< datatype, size >::ArrayLinkedList ( )
inline

Definition at line 31 of file ArrayLinkedList.h.

Member Function Documentation

◆ addArrayElement()

template<typename datatype , int size>
datatype * ttk::ArrayLinkedList< datatype, size >::addArrayElement ( datatype  element)
inline

Definition at line 35 of file ArrayLinkedList.h.

Member Data Documentation

◆ list_

template<typename datatype , int size>
std::list<std::array<datatype, size> > ttk::ArrayLinkedList< datatype, size >::list_

Definition at line 23 of file ArrayLinkedList.h.

◆ numberOfElements_

template<typename datatype , int size>
int ttk::ArrayLinkedList< datatype, size >::numberOfElements_

Definition at line 24 of file ArrayLinkedList.h.

◆ padding_

template<typename datatype , int size>
std::array<unsigned char, 32> ttk::ArrayLinkedList< datatype, size >::padding_ {}

Definition at line 30 of file ArrayLinkedList.h.


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