Developer Application Interface (ARC API) v4.5.8
ARC, Inc. GenIV Application Interface
arc::gen4::CArcStatusPacket Class Reference

#include <CArcStatusPacket.h>

Inheritance diagram for arc::gen4::CArcStatusPacket:
arc::gen4::CArcPacket arc::gen4::CArcBase arc::gen4::CArcAlertPacket

Public Member Functions

 CArcStatusPacket (void)=default
 
virtual ~CArcStatusPacket (void)=default
 
void assign (std::uint8_t *pData, const std::uint32_t uiSize)
 
bool headerValid (void) const noexcept override
 
constexpr std::uint32_t command (void) noexcept
 
std::uint32_t value (const std::uint32_t uiIndex=0) const
 
const std::uint32_t * valueData (void)
 
std::uint8_t valueCount (void)
 
bool compare (const std::uint32_t uiValue=static_cast< std::uint32_t >(cmds_e::DONE)) noexcept
 
template<typename... Args>
std::enable_if_t< std::conjunction_v< std::is_same< std::uint32_t, Args >... >, bool > compare (Args... args)
 
bool success (void) noexcept
 
bool containsError (void) noexcept
 
errorCodes_e errorCode (void) noexcept
 
const std::string errorCodeDescription (void)
 
const std::string getName (void) const override
 
- Public Member Functions inherited from arc::gen4::CArcPacket
virtual ~CArcPacket (void)=default
 
constexpr std::uint32_t headerLength (void) const noexcept
 
constexpr std::uint32_t headerByteLength (void) const noexcept
 
std::uint8_t packetId (void) const
 
bool checkPacketId (std::uint32_t uiHeader, std::uint8_t uiPacketId) const noexcept
 
std::uint8_t payloadId (void) const
 
std::uint8_t payloadLength (void) const
 
std::uint32_t payloadByteLength (void) const
 
std::uint32_t * payload (void) const noexcept
 
void add (const std::uint32_t uiValue)
 
std::uint32_t length (void) const noexcept
 
std::uint32_t byteLength (void) const noexcept
 
std::uint32_t maxByteLength (void) const noexcept
 
std::uint32_t maxLength (void) const noexcept
 
std::uint32_t at (const std::uint32_t uiIndex) const
 
std::uint32_t & operator[] (const std::uint32_t uiIndex)
 
std::uint8_t * data (void) const noexcept
 
virtual const std::string toString (void) const
 
virtual const std::string toLogString (void) const
 
- Public Member Functions inherited from arc::gen4::CArcBase
virtual ~CArcBase (void)
 

Static Public Attributes

static constexpr std::uint32_t STATUS_START_INDEX = 1
 

Static Protected Attributes

static constexpr std::uint8_t PAYLOAD_ID = 0xAF
 
- Static Protected Attributes inherited from arc::gen4::CArcPacket
static constexpr auto MAX_PACKET_SIZE = static_cast< std::uint32_t >( 1024 )
 
- Static Protected Attributes inherited from arc::gen4::CArcBase
static const std::string m_sVersion
 

Additional Inherited Members

- Static Public Member Functions inherited from arc::gen4::CArcBase
static const std::string version (void)
 
static void zeroMemory (void *pDest, std::size_t uiSize)
 
static void copyMemory (void *pDest, void *pSrc, std::size_t uiSize)
 
template<typename T >
static std::tuple< T *, T * > copyAndIncrement (void *pDest, void *pSrc, const std::size_t uiSize)
 
template<typename ErrCode >
requires std::is_integral_v<ErrCode>
static const std::string getSystemErrorMessage (ErrCode iErrCode)
 
static const std::string getSystemErrorMessage (void)
 
static std::uint32_t getSystemError (void) noexcept
 
static pStringList_t splitString (const std::string &sString, const char &zDelim=' ')
 
static std::string formatString (const char *pszFmt,...)
 
static const std::filesystem::path incrementFileName (const std::filesystem::path &tFilePath="", const std::int32_t iStartValue=-1)
 
static std::string convertWideToAnsi (const wchar_t wzString[]) noexcept
 
static std::string convertWideToAnsi (const std::wstring &wsString)
 
static std::wstring convertAnsiToWide (const char *pszString)
 
static std::string cmdToString (const std::uint32_t uiCmd)
 
template<typename T >
static std::string iterToString (T *begin, T *end, const char zSeperator=' ')
 
static std::string setDots (const std::string &sText, const std::size_t uiMaxLength, const char szDot='.')
 
static std::string trim (const std::string &sText) noexcept
 
static const std::chrono::time_point< std::chrono::high_resolution_clock > startCodeTime (void) noexcept
 
template<typename T >
static constexpr auto endCodeTime (const std::chrono::time_point< std::chrono::high_resolution_clock > tStartTimePoint) noexcept
 
- Protected Member Functions inherited from arc::gen4::CArcPacket
 CArcPacket (const std::uint32_t uiSize=MAX_PACKET_SIZE)
 
void incrementLength (const std::uint8_t uiIncr=1) noexcept
 
- Protected Member Functions inherited from arc::gen4::CArcBase
 CArcBase (void)=default
 
 CArcBase (const CArcBase &)=delete
 
 CArcBase (CArcBase &&)=delete
 
CArcBaseoperator= (const CArcBase &)=delete
 
CArcBaseoperator= (CArcBase &&)=delete
 
- Protected Attributes inherited from arc::gen4::CArcPacket
packetHeader_tm_pHeader
 
std::uint32_t * m_pPayload
 
std::unique_ptr< std::uint8_t[]> m_pData
 
std::uint32_t m_uiSize
 

Detailed Description

ARC GenIV status packet class. The command reply packet type.

Definition at line 31 of file CArcStatusPacket.h.

Constructor & Destructor Documentation

◆ CArcStatusPacket()

arc::gen4::CArcStatusPacket::CArcStatusPacket ( void  )
default

◆ ~CArcStatusPacket()

virtual arc::gen4::CArcStatusPacket::~CArcStatusPacket ( void  )
virtualdefault

Member Function Documentation

◆ assign()

void arc::gen4::CArcStatusPacket::assign ( std::uint8_t *  pData,
const std::uint32_t  uiSize 
)

Assign data to the packet.

Parameters
pData- The byte data to assign as the packet data.
uiSize- The number of bytes in the data buffer parameter.
Exceptions
std::runtime_errorSee specific packet types to details.
std::out_of_rangeerror if data too large for packet type.

◆ headerValid()

bool arc::gen4::CArcStatusPacket::headerValid ( void  ) const
overridevirtualnoexcept

Determines if the packet contains a valid header. The implementation may change; thus no details are given.

Returns
true if the packet header appears to be valid; false otherwise.

Implements arc::gen4::CArcPacket.

◆ command()

constexpr std::uint32_t arc::gen4::CArcStatusPacket::command ( void  )
inlineconstexprnoexcept

Returns the command code

Returns
The command code

Definition at line 59 of file CArcStatusPacket.h.

◆ value()

std::uint32_t arc::gen4::CArcStatusPacket::value ( const std::uint32_t  uiIndex = 0) const

Returns the status value at the specified index.

Parameters
uiIndex- The value index ( default = 0 ).
Returns
The status value at the specified index.
Exceptions
std::out_of_rangeerror if index is out of range.

◆ valueData()

const std::uint32_t * arc::gen4::CArcStatusPacket::valueData ( void  )

Returns a pointer to the start of the status value(s).

Returns
A pointer to the first status value.
Exceptions
std::runtime_errorerror if there is no valid value.

◆ valueCount()

std::uint8_t arc::gen4::CArcStatusPacket::valueCount ( void  )

Returns the number of status values.

Returns
The status value count.
Exceptions
std::runtime_error

◆ compare() [1/2]

bool arc::gen4::CArcStatusPacket::compare ( const std::uint32_t  uiValue = static_cast< std::uint32_t >(cmds_e::DONE))
noexcept

Compares the specified parameter against the first status value.

Parameters
uiValue- The expected status value ( default = DONE ).
Returns
true if the status values match; false otherwise.

◆ compare() [2/2]

template<typename... Args>
std::enable_if_t< std::conjunction_v< std::is_same< std::uint32_t, Args >... >, bool > arc::gen4::CArcStatusPacket::compare ( Args...  args)
inline

Compares all the values in the list against the first status value.

Parameters
rList- The list of expected status values.
Returns
true if any one of the status values match; false otherwise.

Definition at line 93 of file CArcStatusPacket.h.

◆ success()

bool arc::gen4::CArcStatusPacket::success ( void  )
noexcept

Alias for the default compare() method, which verifies that the status value is a 'DONE'.

See also
arc::gen4::CArcStatusPacket::compare() for details

◆ containsError()

bool arc::gen4::CArcStatusPacket::containsError ( void  )
noexcept

Returns true if the first status value contains a standard error code ( 'ERR', etc ); false otherwise.

◆ errorCode()

errorCodes_e arc::gen4::CArcStatusPacket::errorCode ( void  )
noexcept

Returns the error code returned by the controller.

Returns
The error code as defined in ArcCommandCodes.h.

◆ errorCodeDescription()

const std::string arc::gen4::CArcStatusPacket::errorCodeDescription ( void  )

Returns a text description for the error code returned by the controller.

Returns
A std::string description of the error.
Exceptions
std::runtime_error

◆ getName()

const std::string arc::gen4::CArcStatusPacket::getName ( void  ) const
overridevirtual

Returns the packet name.

Returns
The packet name.
Exceptions
Anyexception thrown by std::string

Implements arc::gen4::CArcPacket.

Member Data Documentation

◆ STATUS_START_INDEX

constexpr std::uint32_t arc::gen4::CArcStatusPacket::STATUS_START_INDEX = 1
staticconstexpr

The index of the first status value

Definition at line 130 of file CArcStatusPacket.h.

◆ PAYLOAD_ID

constexpr std::uint8_t arc::gen4::CArcStatusPacket::PAYLOAD_ID = 0xAF
staticconstexprprotected

Definition at line 135 of file CArcStatusPacket.h.