Advanced Multi-Physics (AMP)
On-Line Documentation
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
AMP::ThreadPoolID Class Reference

This a class to hold the work item id. More...

#include <ThreadPoolId.h>

Public Types

enum class  Status : int8_t { none = 0 , added = 1 , started = 2 , finished = 3 }
 

Public Member Functions

bool finished () const
 Check if the work has finished.
 
uint64_t getLocalID () const
 
int8_t getPriority () const
 
ThreadPoolWorkItemgetWork () const
 Check if thread id is null.
 
bool initialized () const volatile
 
bool isNull () const
 Check if thread id is null.
 
bool operator!= (const ThreadPoolID &rhs) const
 
bool operator!= (const volatile ThreadPoolID &rhs) const volatile
 
bool operator< (const ThreadPoolID &rhs) const
 
bool operator< (const volatile ThreadPoolID &rhs) const volatile
 
bool operator<= (const ThreadPoolID &rhs) const
 
bool operator<= (const volatile ThreadPoolID &rhs) const volatile
 
ThreadPoolIDoperator= (const ThreadPoolID &rhs)
 
ThreadPoolIDoperator= (const ThreadPoolID &rhs) volatile
 
ThreadPoolIDoperator= (const volatile ThreadPoolID &rhs)
 
ThreadPoolIDoperator= (const volatile ThreadPoolID &rhs) volatile
 
ThreadPoolIDoperator= (ThreadPoolID &&rhs)
 
ThreadPoolIDoperator= (volatile ThreadPoolID &&rhs) volatile
 
bool operator== (const ThreadPoolID &rhs) const
 
bool operator== (const volatile ThreadPoolID &rhs) const volatile
 
bool operator> (const ThreadPoolID &rhs) const
 
bool operator> (const volatile ThreadPoolID &rhs) const volatile
 
bool operator>= (const ThreadPoolID &rhs) const
 
bool operator>= (const volatile ThreadPoolID &rhs) const volatile
 
bool ready () const
 
void reset ()
 
void reset () volatile
 Reset the id back to a NULL id.
 
void reset (int8_t priority, uint64_t local_id, void *work)
 
void setPriority (int8_t priority)
 
bool started () const
 Check if the work has started (will return true if it has started or finished)
 
Status status () const
 Return the status of the work item.
 
void swap (ThreadPoolID &rhs)
 swap with rhs
 
 ThreadPoolID ()=default
 Empty constructor.
 
 ThreadPoolID (const ThreadPoolID &rhs)
 
 ThreadPoolID (const volatile ThreadPoolID &rhs)
 Copy constructors.
 
 ThreadPoolID (volatile ThreadPoolID &&rhs)
 
 ~ThreadPoolID ()
 Destructor.
 

Static Public Member Functions

static uint64_t createId (int8_t priority, uint64_t local_id)
 

Static Public Attributes

static constexpr uint64_t maxThreadID = 0x00FFFFFFFFFFFFFD
 
static constexpr uint64_t nullThreadID = 0x0FFFFFFFFFFFFFFF
 

Private Attributes

volatile std::atomic_int32_t * d_count = nullptr
 
uint64_t d_id = nullThreadID
 
void * d_work = nullptr
 

Detailed Description

This a class to hold the work item id.

This class hold the id of the work item that is being processed by the thread pool. It is created when a work item is added to the thread pool and is used by various routines within the thread pool.

Definition at line 24 of file ThreadPoolId.h.

Member Enumeration Documentation

◆ Status

enum class AMP::ThreadPoolID::Status : int8_t
strong
Enumerator
none 
added 
started 
finished 

Definition at line 28 of file ThreadPoolId.h.

Constructor & Destructor Documentation

◆ ThreadPoolID() [1/4]

AMP::ThreadPoolID::ThreadPoolID ( )
default

Empty constructor.

◆ ~ThreadPoolID()

AMP::ThreadPoolID::~ThreadPoolID ( )
inline

Destructor.

Definition at line 38 of file ThreadPoolId.h.

References reset().

◆ ThreadPoolID() [2/4]

AMP::ThreadPoolID::ThreadPoolID ( const volatile ThreadPoolID rhs)

Copy constructors.

◆ ThreadPoolID() [3/4]

AMP::ThreadPoolID::ThreadPoolID ( volatile ThreadPoolID &&  rhs)

◆ ThreadPoolID() [4/4]

AMP::ThreadPoolID::ThreadPoolID ( const ThreadPoolID rhs)

Member Function Documentation

◆ createId()

static uint64_t AMP::ThreadPoolID::createId ( int8_t  priority,
uint64_t  local_id 
)
static

◆ finished()

bool AMP::ThreadPoolID::finished ( ) const
inline

Check if the work has finished.

Definition at line 102 of file ThreadPoolId.h.

References status().

◆ getLocalID()

uint64_t AMP::ThreadPoolID::getLocalID ( ) const

◆ getPriority()

int8_t AMP::ThreadPoolID::getPriority ( ) const

◆ getWork()

ThreadPoolWorkItem * AMP::ThreadPoolID::getWork ( ) const
inline

Check if thread id is null.

Definition at line 116 of file ThreadPoolId.h.

References d_work.

◆ initialized()

bool AMP::ThreadPoolID::initialized ( ) const volatile
inline

Definition at line 135 of file ThreadPoolId.h.

References d_id.

◆ isNull()

bool AMP::ThreadPoolID::isNull ( ) const
inline

Check if thread id is null.

Definition at line 113 of file ThreadPoolId.h.

References d_id, and nullThreadID.

◆ operator!=() [1/2]

bool AMP::ThreadPoolID::operator!= ( const ThreadPoolID rhs) const
inline

Definition at line 58 of file ThreadPoolId.h.

References d_id, and nullThreadID.

◆ operator!=() [2/2]

bool AMP::ThreadPoolID::operator!= ( const volatile ThreadPoolID rhs) const volatile
inline

Definition at line 70 of file ThreadPoolId.h.

References d_id, and nullThreadID.

◆ operator<() [1/2]

bool AMP::ThreadPoolID::operator< ( const ThreadPoolID rhs) const
inline

Definition at line 65 of file ThreadPoolId.h.

References d_id.

◆ operator<() [2/2]

bool AMP::ThreadPoolID::operator< ( const volatile ThreadPoolID rhs) const volatile
inline

Definition at line 86 of file ThreadPoolId.h.

References d_id.

◆ operator<=() [1/2]

bool AMP::ThreadPoolID::operator<= ( const ThreadPoolID rhs) const
inline

Definition at line 63 of file ThreadPoolId.h.

References d_id.

◆ operator<=() [2/2]

bool AMP::ThreadPoolID::operator<= ( const volatile ThreadPoolID rhs) const volatile
inline

Definition at line 78 of file ThreadPoolId.h.

References d_id.

◆ operator=() [1/6]

ThreadPoolID & AMP::ThreadPoolID::operator= ( const ThreadPoolID rhs)

◆ operator=() [2/6]

ThreadPoolID & AMP::ThreadPoolID::operator= ( const ThreadPoolID rhs) volatile

◆ operator=() [3/6]

ThreadPoolID & AMP::ThreadPoolID::operator= ( const volatile ThreadPoolID rhs)

◆ operator=() [4/6]

ThreadPoolID & AMP::ThreadPoolID::operator= ( const volatile ThreadPoolID rhs) volatile

◆ operator=() [5/6]

ThreadPoolID & AMP::ThreadPoolID::operator= ( ThreadPoolID &&  rhs)

◆ operator=() [6/6]

ThreadPoolID & AMP::ThreadPoolID::operator= ( volatile ThreadPoolID &&  rhs) volatile

◆ operator==() [1/2]

bool AMP::ThreadPoolID::operator== ( const ThreadPoolID rhs) const
inline

Definition at line 54 of file ThreadPoolId.h.

References d_id, and nullThreadID.

◆ operator==() [2/2]

bool AMP::ThreadPoolID::operator== ( const volatile ThreadPoolID rhs) const volatile
inline

Definition at line 66 of file ThreadPoolId.h.

References d_id, and nullThreadID.

◆ operator>() [1/2]

bool AMP::ThreadPoolID::operator> ( const ThreadPoolID rhs) const
inline

Definition at line 64 of file ThreadPoolId.h.

References d_id.

◆ operator>() [2/2]

bool AMP::ThreadPoolID::operator> ( const volatile ThreadPoolID rhs) const volatile
inline

Definition at line 82 of file ThreadPoolId.h.

References d_id.

◆ operator>=() [1/2]

bool AMP::ThreadPoolID::operator>= ( const ThreadPoolID rhs) const
inline

Definition at line 62 of file ThreadPoolId.h.

References d_id.

◆ operator>=() [2/2]

bool AMP::ThreadPoolID::operator>= ( const volatile ThreadPoolID rhs) const volatile
inline

Definition at line 74 of file ThreadPoolId.h.

References d_id.

◆ ready()

bool AMP::ThreadPoolID::ready ( ) const

◆ reset() [1/3]

void AMP::ThreadPoolID::reset ( )

◆ reset() [2/3]

void AMP::ThreadPoolID::reset ( ) volatile

Reset the id back to a NULL id.

Referenced by ~ThreadPoolID().

◆ reset() [3/3]

void AMP::ThreadPoolID::reset ( int8_t  priority,
uint64_t  local_id,
void *  work 
)

◆ setPriority()

void AMP::ThreadPoolID::setPriority ( int8_t  priority)

◆ started()

bool AMP::ThreadPoolID::started ( ) const
inline

Check if the work has started (will return true if it has started or finished)

Definition at line 99 of file ThreadPoolId.h.

References status().

◆ status()

Status AMP::ThreadPoolID::status ( ) const

Return the status of the work item.

Referenced by finished(), and started().

◆ swap()

void AMP::ThreadPoolID::swap ( ThreadPoolID rhs)
inline

swap with rhs

Definition at line 105 of file ThreadPoolId.h.

References d_count, d_id, and d_work.

Member Data Documentation

◆ d_count

volatile std::atomic_int32_t* AMP::ThreadPoolID::d_count = nullptr
private

Definition at line 140 of file ThreadPoolId.h.

Referenced by swap().

◆ d_id

uint64_t AMP::ThreadPoolID::d_id = nullThreadID
private

◆ d_work

void* AMP::ThreadPoolID::d_work = nullptr
private

Definition at line 141 of file ThreadPoolId.h.

Referenced by getWork(), and swap().

◆ maxThreadID

constexpr uint64_t AMP::ThreadPoolID::maxThreadID = 0x00FFFFFFFFFFFFFD
staticconstexpr

Definition at line 32 of file ThreadPoolId.h.

◆ nullThreadID

constexpr uint64_t AMP::ThreadPoolID::nullThreadID = 0x0FFFFFFFFFFFFFFF
staticconstexpr

Definition at line 31 of file ThreadPoolId.h.

Referenced by isNull(), operator!=(), operator!=(), operator==(), and operator==().


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



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:42.
Comments on this page