CppELib 1.7.0
Loading...
Searching...
No Matches
TestDoubleOSWrapper::TestDoubleThread Class Reference

#include <TestDoubleThreadFactory.h>

Public Member Functions

 TestDoubleThread ()
 
void setCreateArgs (OSWrapper::Runnable *r, int priority, std::size_t stackSize, void *stackAddress, const char *name)
 
virtual ~TestDoubleThread ()
 
virtual void start ()
 Transit this thread to the READY state.
 
virtual OSWrapper::Error wait ()
 Block the current thread until this thread transits to the FINISHED state.
 
virtual OSWrapper::Error tryWait ()
 Query without blocking whether this thread is in the FINISHED state.
 
virtual OSWrapper::Error timedWait (OSWrapper::Timeout tmout)
 Block the current thread until this thread transits to the FINISHED state but only within the limited time.
 
virtual bool isFinished () const
 Return true if this thread is in the FINISHED state.
 
virtual void setName (const char *name)
 Set the object's name.
 
virtual const char * getName () const
 Get the object's name.
 
virtual void setPriority (int priority)
 Change this thread priority.
 
virtual int getPriority () const
 Get this thread priority.
 
virtual int getInitialPriority () const
 Get this thread priority when this thread was created.
 
virtual std::size_t getStackSize () const
 Get the stack size of this thread.
 
virtual void * getNativeHandle ()
 Get the native handle of RTOS's thread.
 
- Public Member Functions inherited from OSWrapper::Thread
void setUncaughtExceptionHandler (UncaughtExceptionHandler *handler)
 Set the UncaughtExceptionHandler for this Thread.
 
UncaughtExceptionHandlergetUncaughtExceptionHandler () const
 Get the UncaughtExceptionHandler for this Thread.
 

Protected Attributes

OSWrapper::Runnablem_runnable
 
int m_priority
 
int m_initialPriority
 
std::size_t m_stackSize
 
void * m_stackAddress
 
const char * m_name
 

Additional Inherited Members

- Static Public Member Functions inherited from OSWrapper::Thread
static void setDefaultUncaughtExceptionHandler (UncaughtExceptionHandler *handler)
 Set the default UncaughtExceptionHandler for all the Thread.
 
static UncaughtExceptionHandlergetDefaultUncaughtExceptionHandler ()
 Get the default UncaughtExceptionHandler.
 
static Threadcreate (Runnable *r, int priority=INHERIT_PRIORITY, std::size_t stackSize=0U, void *stackAddress=0, const char *name="")
 Create a Thread object.
 
static void destroy (Thread *t)
 Destroy a Thread object.
 
static void sleep (unsigned long millis)
 Sleep the current thread while the time that is set by argument.
 
static void yield ()
 Transit the current thread from the RUNNING state to the READY state to give other thread the RUNNING state.
 
static ThreadgetCurrentThread ()
 Get the current running Thread object.
 
static int getMaxPriority ()
 Get the maximum value of RTOS's thread priority.
 
static int getMinPriority ()
 Get the minimum value of RTOS's thread priority.
 
static int getNormalPriority ()
 Get the middle priority between the minimum and maximum value.
 
static int getHighestPriority ()
 Get the highest thread priority of RTOS.
 
static int getLowestPriority ()
 Get the lowest thread priority of RTOS.
 
static int getPriorityHigherThan (int basePriority, int d)
 Get the thread priority of RTOS higher than basePriority by d.
 
- Static Public Attributes inherited from OSWrapper::Thread
static const int INHERIT_PRIORITY = -1
 Use when set the same priority as the caller thread.
 
- Protected Member Functions inherited from OSWrapper::Thread
 Thread (Runnable *r)
 
virtual ~Thread ()
 
void threadMain ()
 Common thread main method.
 

Constructor & Destructor Documentation

◆ TestDoubleThread()

TestDoubleOSWrapper::TestDoubleThread::TestDoubleThread ( )
inline

◆ ~TestDoubleThread()

virtual TestDoubleOSWrapper::TestDoubleThread::~TestDoubleThread ( )
inlinevirtual

Member Function Documentation

◆ getInitialPriority()

virtual int TestDoubleOSWrapper::TestDoubleThread::getInitialPriority ( ) const
inlinevirtual

Get this thread priority when this thread was created.

Returns
Initial thread priority

Implements OSWrapper::Thread.

◆ getName()

virtual const char * TestDoubleOSWrapper::TestDoubleThread::getName ( ) const
inlinevirtual

Get the object's name.

Returns
The object's name

Implements OSWrapper::Thread.

◆ getNativeHandle()

virtual void * TestDoubleOSWrapper::TestDoubleThread::getNativeHandle ( )
inlinevirtual

Get the native handle of RTOS's thread.

Returns
native handle

Implements OSWrapper::Thread.

◆ getPriority()

virtual int TestDoubleOSWrapper::TestDoubleThread::getPriority ( ) const
inlinevirtual

Get this thread priority.

Returns
Thread priority

Implements OSWrapper::Thread.

◆ getStackSize()

virtual std::size_t TestDoubleOSWrapper::TestDoubleThread::getStackSize ( ) const
inlinevirtual

Get the stack size of this thread.

Returns
stack size

Implements OSWrapper::Thread.

◆ isFinished()

virtual bool TestDoubleOSWrapper::TestDoubleThread::isFinished ( ) const
inlinevirtual

Return true if this thread is in the FINISHED state.

Return values
trueThis thread is in the FINISHED state
falseThis thread is not in the FINISHED state

Implements OSWrapper::Thread.

◆ setCreateArgs()

void TestDoubleOSWrapper::TestDoubleThread::setCreateArgs ( OSWrapper::Runnable r,
int  priority,
std::size_t  stackSize,
void *  stackAddress,
const char *  name 
)
inline

◆ setName()

virtual void TestDoubleOSWrapper::TestDoubleThread::setName ( const char *  name)
inlinevirtual

Set the object's name.

Parameters
nameThe object's name

Implements OSWrapper::Thread.

◆ setPriority()

virtual void TestDoubleOSWrapper::TestDoubleThread::setPriority ( int  priority)
inlinevirtual

Change this thread priority.

Parameters
priorityThread priority

Implements OSWrapper::Thread.

◆ start()

virtual void TestDoubleOSWrapper::TestDoubleThread::start ( )
inlinevirtual

Transit this thread to the READY state.

After this method, when this thread transits to the RUNNING state, this thread calls Runnable::run() specified at create().

Note
If this thread is already in the READY state, do nothing.
If this thread is finished, you can start() again.

Implements OSWrapper::Thread.

◆ timedWait()

virtual OSWrapper::Error TestDoubleOSWrapper::TestDoubleThread::timedWait ( OSWrapper::Timeout  tmout)
inlinevirtual

Block the current thread until this thread transits to the FINISHED state but only within the limited time.

Parameters
tmoutThe limited time
Return values
OKSuccess. This thread is in the FINISHED state
TimedOutThe limited time was elapsed
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
Note
If tmout is Timeout::POLLING then this method queries the state without blocking.
If tmout is Timeout::FOREVER then this method waits forever until the condition is satisfied.

Implements OSWrapper::Thread.

◆ tryWait()

virtual OSWrapper::Error TestDoubleOSWrapper::TestDoubleThread::tryWait ( )
inlinevirtual

Query without blocking whether this thread is in the FINISHED state.

Return values
OKThis thread is already in the FINISHED state
TimedOutThis thread is not in the FINISHED state
Note
Same as timedWait(Timeout::POLLING)

Implements OSWrapper::Thread.

◆ wait()

virtual OSWrapper::Error TestDoubleOSWrapper::TestDoubleThread::wait ( )
inlinevirtual

Block the current thread until this thread transits to the FINISHED state.

Return values
OKSuccess. This thread is in the FINISHED state
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
Note
Same as timedWait(Timeout::FOREVER)

Implements OSWrapper::Thread.

Member Data Documentation

◆ m_initialPriority

int TestDoubleOSWrapper::TestDoubleThread::m_initialPriority
protected

◆ m_name

const char* TestDoubleOSWrapper::TestDoubleThread::m_name
protected

◆ m_priority

int TestDoubleOSWrapper::TestDoubleThread::m_priority
protected

◆ m_runnable

OSWrapper::Runnable* TestDoubleOSWrapper::TestDoubleThread::m_runnable
protected

◆ m_stackAddress

void* TestDoubleOSWrapper::TestDoubleThread::m_stackAddress
protected

◆ m_stackSize

std::size_t TestDoubleOSWrapper::TestDoubleThread::m_stackSize
protected

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