|
criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
|
A class to automate private thread copies of objects. More...
#include <ThreadVec.H>
Public Member Functions | |
| ThreadVec () | |
| Construct an empty threadvec. | |
| IdxType | size () const |
| Return the number of distinct objects stored. | |
| T & | operator() () |
| Return the element private to this thread. | |
| const T & | operator() () const |
| Return the element private to this thread. | |
| T & | operator[] (const int i) |
| Return the object belonging to the specified thread. | |
| const T & | operator[] (const int i) const |
| Return the object belonging to the specified thread. | |
Private Attributes | |
| std::vector< T > | obj |
A class to automate private thread copies of objects.
| T | Type of object the ThreadVec holds |
This class is a container to automate the process of each thread having its own private copy of an object. It is a vector that on creation automatically resizes itself to the number of threads in the openMP threadpool, and when accessed by a thread automatically returns the element of the vector that is private to that thread.
|
inline |
Construct an empty threadvec.
|
inline |
Return the element private to this thread.
|
inline |
Return the element private to this thread.
|
inline |
Return the object belonging to the specified thread.
| i | The thread number whose object should be returned |
|
inline |
Return the object belonging to the specified thread.
| i | The thread number whose object should be returned |
|
inline |
Return the number of distinct objects stored.
|
private |
The stored objects