|
ndmspc
v1.2.0-0.1.rc3
|
Thread-local data object for NDMSPC processing. More...
#include <NThreadData.h>
Public Member Functions | |
| void | SetItemCount (long long itemCount) |
| Setters for data members. More... | |
| void | SetCoordSum (long long coordSum) |
| Set the sum of coordinates processed by the thread. More... | |
| void | SetThreadId (std::thread::id threadId) |
| Set the thread's unique identifier. More... | |
| void | SetIdSet (bool idSet) |
| Set whether the thread ID has been assigned. More... | |
| void | SetAssignedIndex (size_t assignedIndex) |
| Set the assigned index for the thread. More... | |
| void | SetResourceMonitor (NResourceMonitor *monitor) |
| Sets the resource monitor for this thread data. More... | |
| long long | GetItemCount () const |
| Getters for data members. More... | |
| long long | GetCoordSum () const |
| Get the sum of coordinates processed by the thread. More... | |
| std::thread::id | GetThreadId () const |
| Get the thread's unique identifier. More... | |
| bool | GetIdSet () const |
| Check if the thread ID has been assigned. More... | |
| size_t | GetAssignedIndex () const |
| Get the assigned index for the thread. More... | |
| NResourceMonitor * | GetResourceMonitor () const |
| Gets the resource monitor associated with this thread data. More... | |
| NThreadData () | |
| Default constructor. More... | |
| virtual | ~NThreadData () |
| Virtual destructor. More... | |
| virtual void | Process (const std::vector< int > &coords) |
| Process method for thread data. More... | |
| virtual void | Print (Option_t *option="") const |
| Print method override. More... | |
Static Public Attributes | |
| static std::mutex | fSharedMutex |
| Shared mutex for thread-safe operations. | |
Protected Attributes | |
| NResourceMonitor * | fResourceMonitor {nullptr} |
| Pointer to resource monitor. | |
Private Attributes | |
| long long | fItemCount = 0 |
| Number of items processed. | |
| long long | fCoordSum = 0 |
| Sum of coordinates. | |
| std::thread::id | fThreadId |
| Thread ID. | |
| bool | fIdSet = false |
| Flag to indicate if the thread ID is set. | |
| size_t | fAssignedIndex = 0 |
| Index assigned to this object. | |
Thread-local data object for NDMSPC processing.
Stores per-thread statistics, thread ID, assigned index, and provides thread-safe access. Supports processing, printing, and management of thread-specific data.
Definition at line 21 of file NThreadData.h.
| Ndmspc::NThreadData::NThreadData | ( | ) |
|
virtual |
|
inline |
Get the assigned index for the thread.
Definition at line 96 of file NThreadData.h.
References fAssignedIndex.
Referenced by Ndmspc::NDimensionalExecutor::ExecuteParallel(), Ndmspc::NGnThreadData::FlushDeferredDeletes(), Ndmspc::NGnThreadData::Merge(), and Ndmspc::NGnThreadData::Process().
|
inline |
Get the sum of coordinates processed by the thread.
Definition at line 78 of file NThreadData.h.
References fCoordSum.
|
inline |
Check if the thread ID has been assigned.
Definition at line 90 of file NThreadData.h.
References fIdSet.
|
inline |
Getters for data members.
Get the number of items processed by the thread.
Definition at line 72 of file NThreadData.h.
References fItemCount.
|
inline |
Gets the resource monitor associated with this thread data.
Returns a pointer to the NResourceMonitor instance currently associated with this thread data. The caller does not take ownership of the returned pointer.
Definition at line 108 of file NThreadData.h.
References fResourceMonitor.
|
inline |
Get the thread's unique identifier.
Definition at line 84 of file NThreadData.h.
References fThreadId.
|
virtual |
Print method override.
| option | Print options. |
Definition at line 43 of file NThreadData.cxx.
References fAssignedIndex, fCoordSum, fItemCount, and fThreadId.
|
virtual |
Process method for thread data.
| coords | Vector of coordinates to process. |
Reimplemented in Ndmspc::NGnThreadData.
Definition at line 26 of file NThreadData.cxx.
References fCoordSum, fIdSet, fItemCount, and fThreadId.
|
inline |
Set the assigned index for the thread.
| assignedIndex | Index assigned to the thread. |
Definition at line 53 of file NThreadData.h.
References fAssignedIndex.
Referenced by Ndmspc::NGnThreadData::Init().
|
inline |
Set the sum of coordinates processed by the thread.
| coordSum | Sum of coordinates. |
Definition at line 35 of file NThreadData.h.
References fCoordSum.
|
inline |
Set whether the thread ID has been assigned.
| idSet | True if ID is set, false otherwise. |
Definition at line 47 of file NThreadData.h.
References fIdSet.
|
inline |
Setters for data members.
Set the number of items processed by the thread.
| itemCount | Number of items. |
Definition at line 29 of file NThreadData.h.
References fItemCount.
|
inline |
Sets the resource monitor for this thread data.
This function assigns the given NResourceMonitor pointer to the internal resource monitor member. Ownership of the pointer is not transferred; the caller is responsible for managing the lifetime of the monitor object.
| monitor | Pointer to an NResourceMonitor instance to be associated with this thread data. |
Definition at line 64 of file NThreadData.h.
References fResourceMonitor.
|
inline |
Set the thread's unique identifier.
| threadId | Thread ID. |
Definition at line 41 of file NThreadData.h.
References fThreadId.
Referenced by Ndmspc::NGnThreadData::Init().