OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
Thread Class Referenceabstract

Public Member Functions

 Thread (const std::string &name)
virtual ~Thread ()
void start ()
void stopAsync ()
bool stopRequested () const
void join () const
ThreadId id () const

Detailed Description

Custom thread classes should derive from this class and implement the 'run' method.

Definition at line 101 of file Thread.h.

Constructor & Destructor Documentation

◆ Thread()

Thread ( const std::string & name)
explicit

Creates the Thread object without running a real thread.

◆ ~Thread()

virtual ~Thread ( )
virtual

Cleans up internal resources.

Note
Calls the std::terminate if the thread is not stopped at the moment.

Member Function Documentation

◆ id()

ThreadId id ( ) const

Returns the platform identifier.

◆ join()

void join ( ) const

Joins the thread completion.

◆ start()

void start ( )

Creates and runs an actual thread.

Can be called only once for the current 'Thread' instance.

Exceptions
Thestd::exception if the thread is started or joined already.

◆ stopAsync()

void stopAsync ( )

Sends a stop signal to the thread.

◆ stopRequested()

bool stopRequested ( ) const

Returns 'true' if a stop signal is sent to the thread by the stopAsync method or in a different way, otherwise 'false'.