1 #ifndef Ndmspc_NThreadData_H
2 #define Ndmspc_NThreadData_H
8 #include "NResourceMonitor.h"
124 virtual void Process(
const std::vector<int> & coords);
130 virtual void Print(Option_t * option =
"")
const;
Monitors and records resource usage (CPU, memory, wall time) for processes or threads.
Thread-local data object for NDMSPC processing.
void SetItemCount(long long itemCount)
Setters for data members.
NResourceMonitor * GetResourceMonitor() const
Gets the resource monitor associated with this thread data.
void SetResourceMonitor(NResourceMonitor *monitor)
Sets the resource monitor for this thread data.
bool fIdSet
Flag to indicate if the thread ID is set.
long long GetCoordSum() const
Get the sum of coordinates processed by the thread.
size_t fAssignedIndex
Index assigned to this object.
virtual ~NThreadData()
Virtual destructor.
long long fCoordSum
Sum of coordinates.
long long GetItemCount() const
Getters for data members.
virtual void Print(Option_t *option="") const
Print method override.
size_t GetAssignedIndex() const
Get the assigned index for the thread.
std::thread::id fThreadId
Thread ID.
std::thread::id GetThreadId() const
Get the thread's unique identifier.
virtual void Process(const std::vector< int > &coords)
Process method for thread data.
void SetAssignedIndex(size_t assignedIndex)
Set the assigned index for the thread.
NResourceMonitor * fResourceMonitor
Pointer to resource monitor.
NThreadData()
Default constructor.
long long fItemCount
Number of items processed.
void SetCoordSum(long long coordSum)
Set the sum of coordinates processed by the thread.
void SetThreadId(std::thread::id threadId)
Set the thread's unique identifier.
void SetIdSet(bool idSet)
Set whether the thread ID has been assigned.
bool GetIdSet() const
Check if the thread ID has been assigned.
static std::mutex fSharedMutex
Shared mutex for thread-safe operations.