cisst-saw
Loading...
Searching...
No Matches
osaThreadId Class Reference

ThreadId type. More...

#include <osaThread.h>

Public Member Functions

 osaThreadId (void)
 ~osaThreadId ()
bool IsValid (void) const
bool Equal (const osaThreadId &other) const
bool operator== (const osaThreadId &other) const
bool operator!= (const osaThreadId &other) const
bool operator() (const osaThreadId &lhs, const osaThreadId &rhs) const
void ToStream (std::ostream &outputStream) const

Friends

class osaThread
class osaThreadTest
CISST_EXPORT osaThreadId osaGetCurrentThreadId (void)

Detailed Description

ThreadId type.

Abstract the thread Id based on the OS. Some OSs use a native C type (e.g., unsigned long) to identify threads but others use more complex

structs hence the need for a class to define the == and << operators.

See also
osaGetCurrentThreadId

Constructor & Destructor Documentation

◆ osaThreadId()

osaThreadId::osaThreadId ( void )

Default constructor. Does nothing but checking that the internal structure use to store the OS specific information for osaThreadId is large enough using CMN_ASSERT. Also sets Valid to false.

◆ ~osaThreadId()

osaThreadId::~osaThreadId ( )

Default destructor. Does nothing.

Member Function Documentation

◆ Equal()

bool osaThreadId::Equal ( const osaThreadId & other) const

Method to compare two thread Ids

◆ IsValid()

bool osaThreadId::IsValid ( void ) const
inline

Method to return whether a valid thread id has been set

◆ operator!=()

bool osaThreadId::operator!= ( const osaThreadId & other) const
inline

Operator to compare two thread Ids

◆ operator()()

bool osaThreadId::operator() ( const osaThreadId & lhs,
const osaThreadId & rhs ) const

Method to compare two thread Ids, used to sort in std::map.

◆ operator==()

bool osaThreadId::operator== ( const osaThreadId & other) const
inline

Operator to compare two thread Ids

◆ ToStream()

void osaThreadId::ToStream ( std::ostream & outputStream) const

Method to compare two thread Ids, used to sort in std::map.

Operator to compare two thread Ids, used to sort in std::map.

Print to stream

◆ osaGetCurrentThreadId

CISST_EXPORT osaThreadId osaGetCurrentThreadId ( void )
friend

Get the ID of the currently executing thread.

See also
osaThreadId

◆ osaThread

friend class osaThread
friend

◆ osaThreadTest

friend class osaThreadTest
friend

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