![]() |
Developer Application Interface (ARC API) v4.5.8
ARC, Inc. GenIV Application Interface
|
#include <CArcPacket.h>
Public Member Functions | |
virtual | ~CArcPacket (void)=default |
virtual bool | headerValid (void) const noexcept=0 |
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 | getName (void) const =0 |
virtual const std::string | toString (void) const |
virtual const std::string | toLogString (void) const |
![]() | |
virtual | ~CArcBase (void) |
Protected Member Functions | |
CArcPacket (const std::uint32_t uiSize=MAX_PACKET_SIZE) | |
void | incrementLength (const std::uint8_t uiIncr=1) noexcept |
![]() | |
CArcBase (void)=default | |
CArcBase (const CArcBase &)=delete | |
CArcBase (CArcBase &&)=delete | |
CArcBase & | operator= (const CArcBase &)=delete |
CArcBase & | operator= (CArcBase &&)=delete |
Protected Attributes | |
packetHeader_t * | m_pHeader |
std::uint32_t * | m_pPayload |
std::unique_ptr< std::uint8_t[]> | m_pData |
std::uint32_t | m_uiSize |
Static Protected Attributes | |
static constexpr auto | MAX_PACKET_SIZE = static_cast< std::uint32_t >( 1024 ) |
![]() | |
static const std::string | m_sVersion |
Additional Inherited Members | |
![]() | |
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 |
ARC GenIV packet class. All ARC GenIV images are sent to the host computer using this packets type.
ARC GenIV base packet class. All ARC GenIV packets derive from this class.
Definition at line 49 of file CArcPacket.h.
|
virtualdefault |
Destructor
|
protected |
Constructor
|
pure virtualnoexcept |
Returns whether or not the header contains valid values.
Implemented in arc::gen4::CArcAlertPacket, arc::gen4::CArcCommandPacket, arc::gen4::CArcDLoadPacket, arc::gen4::CArcImagePacket, and arc::gen4::CArcStatusPacket.
|
inlineconstexprnoexcept |
Returns the packet header maxLength in dwords ( 32-bits ).
Definition at line 65 of file CArcPacket.h.
|
inlineconstexprnoexcept |
Returns the packet header maxLength in bytes.
Definition at line 73 of file CArcPacket.h.
std::uint8_t arc::gen4::CArcPacket::packetId | ( | void | ) | const |
Returns the packet id.
std::runtime_error |
|
noexcept |
Checks if the specified packet ID exists in the specified partial header.
uiHeader | - The partial (first) packet header. |
uiPacketId | - The packet ID to check for. |
std::uint8_t arc::gen4::CArcPacket::payloadId | ( | void | ) | const |
Returns the payload id.
std::runtime_error |
std::uint8_t arc::gen4::CArcPacket::payloadLength | ( | void | ) | const |
Returns the payload dword count.
std::runtime_error |
std::uint32_t arc::gen4::CArcPacket::payloadByteLength | ( | void | ) | const |
Returns the payload byte count.
std::runtime_error |
|
noexcept |
Returns a pointer to the start of the payload.
void arc::gen4::CArcPacket::add | ( | const std::uint32_t | uiValue | ) |
Add a value to the end of the payload.
uiValue | - The value to append to the end of the payload. |
std::out_of_range | exception if index is beyond max length of packet. |
|
noexcept |
Returns the number of dwords ( 32-bit values ) that define the current packet ( header plus payload length ).
|
noexcept |
Returns the number of bytes that define the current packet ( header plus payload length ).
|
noexcept |
Returns the maximum number of bytes that the packet may contain.
|
noexcept |
Returns the maximum number of dwords ( 32-bit values ) that the packet may contain.
std::uint32_t arc::gen4::CArcPacket::at | ( | const std::uint32_t | uiIndex | ) | const |
Returns the 32-bit packet data value at the specified index.
uiIndex | - The index of the value to readRunnable. |
std::out_of_range | exception if index exceeds packet size. |
std::runtime_error |
std::uint32_t & arc::gen4::CArcPacket::operator[] | ( | const std::uint32_t | uiIndex | ) |
Access the specified 32-bit value in the packet.
uiIndex | - The index of the value to access. Starts at beginning of packet (i.e. header ). |
std::out_of_range | exception if index exceeds packet size. |
std::runtime_error |
|
noexcept |
Returns a pointer to the underlying packet data storage.
|
pure virtual |
Returns the packet name.
Any | exception thrown by std::string |
Implemented in arc::gen4::CArcAlertPacket, arc::gen4::CArcCommandPacket, arc::gen4::CArcDLoadPacket, arc::gen4::CArcImagePacket, and arc::gen4::CArcStatusPacket.
|
virtual |
Returns the packet as a formatted string. The format, which may change at any time, is not documented here.
std::ios_base::failure |
|
virtual |
Returns the packet as a formatted string for the log class. The format, which may change at any time, is not documented here.
std::ios_base::failure |
|
protectednoexcept |
Increment the header payload maxLength by the specified amount.
uiIncr | - The number of dwords ( 32-bits ) by which to increment the header payload maxLength field. |
|
staticconstexprprotected |
Default maximum packet size ( in bytes ) IMPORTANT NOTE: The header cannot support more than 255 dwords
Definition at line 194 of file CArcPacket.h.
|
protected |
Packet header pointer
Definition at line 197 of file CArcPacket.h.
|
protected |
Packet payload pointer
Definition at line 200 of file CArcPacket.h.
|
protected |
Packet data
Definition at line 203 of file CArcPacket.h.
|
protected |
Packet data byte size
Definition at line 206 of file CArcPacket.h.