AMS Advanced Air Mobility Sensors UG
Loading...
Searching...
No Matches
CSoftwareComponentPort< tPortDataType, uPortId > Class Template Reference
Inheritance diagram for CSoftwareComponentPort< tPortDataType, uPortId >:
CSoftwareComponentPortBase

Public Types

using DataType = tPortDataType
 

Public Member Functions

 CSoftwareComponentPort ()=default
 
 ~CSoftwareComponentPort ()=default
 
 CSoftwareComponentPort (CSoftwareComponentPort &)=delete
 
 CSoftwareComponentPort (CSoftwareComponentPort &&)=delete
 
CSoftwareComponentPortoperator= (const CSoftwareComponentPort &orOther)=delete
 
CSoftwareComponentPortoperator= (CSoftwareComponentPort &&orOther)=delete
 
bool Write (const tPortDataType &korData)
 
bool Read (tPortDataType &orData)
 
uint8_t GetId () const final
 Get port unique identifier.
 
- Public Member Functions inherited from CSoftwareComponentPortBase
 CSoftwareComponentPortBase ()
 
 ~CSoftwareComponentPortBase ()
 
 CSoftwareComponentPortBase (CSoftwareComponentPortBase &)=delete
 
 CSoftwareComponentPortBase (CSoftwareComponentPortBase &&)=delete
 
CSoftwareComponentPortBaseoperator= (const CSoftwareComponentPortBase &orOther)=delete
 
CSoftwareComponentPortBaseoperator= (CSoftwareComponentPortBase &&orOther)=delete
 
bool Init ()
 
bool IsPortReady () const
 
bool Lock ()
 
void Unlock ()
 Unlock the port.
 
virtual uint8_t GetId () const =0
 Get port unique identifier.
 

Private Member Functions

tPortDataType readUnlocked ()
 

Private Attributes

tPortDataType oPortData_ {}
 Port data storage.
 

Static Private Attributes

static constexpr uint8_t skuPortId_ {uPortId}
 Port unique identifier.
 

Friends

class CPortReader
 
template<typename... TPortTypes>
struct TArePortIdsAscending
 

Additional Inherited Members

- Protected Types inherited from CSoftwareComponentPortBase
using osStaticMutexDef_t = StaticSemaphore_t
 
- Protected Attributes inherited from CSoftwareComponentPortBase
bool bPortReady_ {false}
 The flag to indicate if the port has been initialized successfully.
 
osMutexId_t pMutexHandle_
 Mutex handle.
 
osStaticMutexDef_t sMutexControlBlock_
 Memory reserved for the mutex control block.
 
const osMutexAttr_t sMutexAttributes_ { NULL, 0, &sMutexControlBlock_, sizeof(sMutexControlBlock_) }
 A structure with mutex attributes required for creation.
 
- Static Protected Attributes inherited from CSoftwareComponentPortBase
static constexpr uint32_t skuPortReadTimeout { 1U }
 Timeout for port read operation (in FreeRTOS ticks)
 
static constexpr uint32_t skuPortWriteTimeout { 1U }
 Timeout for port write operation (in FreeRTOS ticks)
 
static constexpr uint32_t skuPortLockTimeout { 1U }
 Timeout for port write operation (in FreeRTOS ticks)
 

Detailed Description

template<class tPortDataType, uint8_t uPortId>
class CSoftwareComponentPort< tPortDataType, uPortId >

The class implements a software component port. The port is a mutex-protected variable used by software components to pass data from one to another.

Member Typedef Documentation

◆ DataType

template<class tPortDataType , uint8_t uPortId>
using CSoftwareComponentPort< tPortDataType, uPortId >::DataType = tPortDataType

Constructor & Destructor Documentation

◆ CSoftwareComponentPort() [1/3]

template<class tPortDataType , uint8_t uPortId>
CSoftwareComponentPort< tPortDataType, uPortId >::CSoftwareComponentPort ( )
default

◆ ~CSoftwareComponentPort()

template<class tPortDataType , uint8_t uPortId>
CSoftwareComponentPort< tPortDataType, uPortId >::~CSoftwareComponentPort ( )
default

◆ CSoftwareComponentPort() [2/3]

template<class tPortDataType , uint8_t uPortId>
CSoftwareComponentPort< tPortDataType, uPortId >::CSoftwareComponentPort ( CSoftwareComponentPort< tPortDataType, uPortId > &  )
delete

◆ CSoftwareComponentPort() [3/3]

template<class tPortDataType , uint8_t uPortId>
CSoftwareComponentPort< tPortDataType, uPortId >::CSoftwareComponentPort ( CSoftwareComponentPort< tPortDataType, uPortId > &&  )
delete

Member Function Documentation

◆ GetId()

template<class tPortDataType , uint8_t uPortId>
uint8_t CSoftwareComponentPort< tPortDataType, uPortId >::GetId ( ) const
inlinefinalvirtual

Get port unique identifier.

Implements CSoftwareComponentPortBase.

◆ operator=() [1/2]

template<class tPortDataType , uint8_t uPortId>
CSoftwareComponentPort & CSoftwareComponentPort< tPortDataType, uPortId >::operator= ( const CSoftwareComponentPort< tPortDataType, uPortId > &  orOther)
delete

◆ operator=() [2/2]

template<class tPortDataType , uint8_t uPortId>
CSoftwareComponentPort & CSoftwareComponentPort< tPortDataType, uPortId >::operator= ( CSoftwareComponentPort< tPortDataType, uPortId > &&  orOther)
delete

◆ Read()

template<typename tPortDataType , uint8_t uPortId>
bool CSoftwareComponentPort< tPortDataType, uPortId >::Read ( tPortDataType &  orData)

Read from the port.

Parameters
orDataA reference to the output data structure.
Returns
True – success, false – failure.

◆ readUnlocked()

template<class tPortDataType , uint8_t uPortId>
tPortDataType CSoftwareComponentPort< tPortDataType, uPortId >::readUnlocked ( )
inlineprivate

◆ Write()

template<typename tPortDataType , uint8_t uPortId>
bool CSoftwareComponentPort< tPortDataType, uPortId >::Write ( const tPortDataType &  korData)

Write data to the port.

Parameters
korDataA reference to the data to be written to the port.
Returns
True – success, false – failure.

Friends And Related Function Documentation

◆ CPortReader

template<class tPortDataType , uint8_t uPortId>
friend class CPortReader
friend

◆ TArePortIdsAscending

template<class tPortDataType , uint8_t uPortId>
template<typename... TPortTypes>
friend struct TArePortIdsAscending
friend

Member Data Documentation

◆ oPortData_

template<class tPortDataType , uint8_t uPortId>
tPortDataType CSoftwareComponentPort< tPortDataType, uPortId >::oPortData_ {}
private

Port data storage.

◆ skuPortId_

template<class tPortDataType , uint8_t uPortId>
constexpr uint8_t CSoftwareComponentPort< tPortDataType, uPortId >::skuPortId_ {uPortId}
staticconstexprprivate

Port unique identifier.


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