
Public Member Functions | |
| TMCSMPArray () | |
| virtual | ~TMCSMPArray () |
| void | SetStackDepth (int32 depth) |
| void | SetAverageElemSpace (int32 elemSpace) |
| TMCArray< T > & | GetArray (TMCSMPArrayRequest< T > &request) |
Protected Member Functions | |
| void | PopArray () |
Static Protected Member Functions | |
| static void | FreeArray (void **privData) |
Protected Attributes | |
| int32 | fStackDepth |
| int32 | fAverageElemSpace |
| TMCLocalStorage * | fTLSArray |
| TMCLocalStorage * | fStackIndex |
Friends | |
| class | TMCSMPArrayRequest< T > |
It behaves like a stack. So a function that uses an SMPArray can be recursively called.
Usage:
TMCSMPArrayRequest< _TYPE_ > request;
TMCArray< _TYPE_ >& myArray = fArrayVolumeRec.GetArray( request );
Prelated class: TMCArray
| TMCSMPArray< T >::TMCSMPArray | ( | ) | [inline] |
Construt a dynamic array (TMCArray) SMP-friendly. That is to say, the array will not be allocated on the stack. But all the Threads will have their own.
| virtual TMCSMPArray< T >::~TMCSMPArray | ( | ) | [inline, virtual] |
Destructor. Remove the TLS. Note: the memory used by the arrays is freed when the thread dies.
| void TMCSMPArray< T >::SetStackDepth | ( | int32 | depth | ) | [inline] |
[Optional] Can be used to optimize memory allocation by setting directly the number of wanted recursion.
| void TMCSMPArray< T >::SetAverageElemSpace | ( | int32 | elemSpace | ) | [inline] |
[Optional] Can be used to optimize memory allocation by setting directly the the size of the array.
| TMCArray< T > & TMCSMPArray< T >::GetArray | ( | TMCSMPArrayRequest< T > & | request | ) | [inline] |
This is the way to get a reference to an TMCArray
| request | is a class instanciated on the stack to help for asking and destructing the array. Just create it like that : TMCSMPArrayRequest request; or TMCSMPArrayRequest request(size_of_the_wanted_array); |
| void TMCSMPArray< T >::PopArray | ( | ) | [inline, protected] |
Pop the last gotten array
| void TMCSMPArray< T >::FreeArray | ( | void ** | privData | ) | [inline, static, protected] |
This is to remove the all allocated memory when the thread die
friend class TMCSMPArrayRequest< T > [friend] |
int32 TMCSMPArray< T >::fStackDepth [protected] |
int32 TMCSMPArray< T >::fAverageElemSpace [protected] |
TMCLocalStorage* TMCSMPArray< T >::fTLSArray [protected] |
TMCLocalStorage* TMCSMPArray< T >::fStackIndex [protected] |
1.5.3