PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | List of all members
Arp::Io::Commons::IoThread Class Reference

This class shall be used for fieldbus threads. More...

#include <IoThread.hpp>

Public Types

using ThreadLoopBodyDelegate = delegate< void(void)>
 

Public Member Functions

 IoThread (const IoThread &arg)=delete
 
 IoThread (IoThread &&arg) noexcept
 The default move constructor.
 
IoThreadoperator= (const IoThread &arg)=delete
 
IoThreadoperator= (IoThread &&arg) noexcept
 The default move-assignment operator.
 
 ~IoThread (void)
 The default destructor.
 
 IoThread (const String &name, size_t priority, Duration cycleTime, size_t cpuAffinityMask, ThreadLoopBodyDelegate threadLoopBodyDelegate)
 Constructs a IoThread instance. More...
 
const StringGetName (void) const
 Gets the name of this thread. More...
 
size_t GetPriority (void) const
 Gets the priority of this thread. More...
 
Duration GetCycleTime (void) const
 Gets the cycle time of this thread in milliseconds. More...
 
size_t GetCpuAffinityMask (void) const
 Gets the CPU affinity mask of this thread. More...
 
void Start (void)
 This operation starts this thread.
 
void Join (bool interrupt=true)
 This operation joins this thread.
 
void Abort (void)
 This operation aborts this thread.
 
Impl & GetImpl (void)
 For internal use only.
 
const Impl & GetImpl (void) const
 

Detailed Description

This class shall be used for fieldbus threads.

This class uses internal the class Thread. For further details on parameters see that class.

Additional to the standard Thread this class puts an internal configured offset to the wake up time of the cycle time, so that it will not wake up at the exactly same time point with the Esm tasks und will reduce displacements. Therefore this thread class should be used for cyclic high priority real time threads used in Io components.

Constructor & Destructor Documentation

◆ IoThread()

Arp::Io::Commons::IoThread::IoThread ( const String name,
size_t  priority,
Duration  cycleTime,
size_t  cpuAffinityMask,
ThreadLoopBodyDelegate  threadLoopBodyDelegate 
)

Constructs a IoThread instance.

Parameters
nameThe name of this thread.
priorityThe priority of this thread in range [0..98].
cycleTimeThe cycle time of this thread.
cpuAffinityMaskThe CPU affinity mask of this thread as bitmask.
threadLoopBodyDelegateThe thread loop body to execute in every cycle.

Member Function Documentation

◆ GetCpuAffinityMask()

size_t Arp::Io::Commons::IoThread::GetCpuAffinityMask ( void  ) const

Gets the CPU affinity mask of this thread.

Returns
The CPU affinity mask of this thread.

◆ GetCycleTime()

Duration Arp::Io::Commons::IoThread::GetCycleTime ( void  ) const

Gets the cycle time of this thread in milliseconds.

Returns
The cycle time of this thread.

◆ GetName()

const String & Arp::Io::Commons::IoThread::GetName ( void  ) const

Gets the name of this thread.

Returns
The name of this thread.

◆ GetPriority()

size_t Arp::Io::Commons::IoThread::GetPriority ( void  ) const

Gets the priority of this thread.

Returns
The priority of this thread.

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