OnixS C++ FIX Engine 4.14.0
Users' manual and API documentation
Loading...
Searching...
No Matches
Thread Class Referenceabstract

#include <OnixS/FIXEngine/Threading/Thread.h>

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

Manipulates a thread. 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'.