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

#include <CArcImagePacket.h>

Inheritance diagram for arc::gen4::CArcImagePacket:
arc::gen4::CArcPacket arc::gen4::CArcBase

Public Member Functions

 CArcImagePacket (void)
 
 CArcImagePacket (const CArcImagePacket &rPacket)
 
virtual ~CArcImagePacket (void)=default
 
virtual bool headerValid (void) const noexcept override
 
bool endOfImage (void) const noexcept
 
bool endOfImage (const imagePacketHeader_t *pHeader) const noexcept
 
void assign (std::uint8_t *pData, std::uint32_t uiSize)
 
void assign (void)
 
bool hasMoreDataSections (void) const noexcept
 
arc::gen4::dataSection_t getNextDataSection (void)
 
const std::string getName (void) const override
 
void serialize (std::ostream &tStream)
 
void deserialize (std::istream &tStream)
 
- 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::uint16_t MAX_PACKET_SIZE = 1500
 

Protected Attributes

imagePacketHeader_tm_pHeader
 
imageDataHeader_tm_pDataHeader
 
std::uint16_t * m_pNextDataSection
 
std::uint16_t * m_pPayload
 
std::uint16_t * m_pEndOfPacket
 
bool m_bHasMoreDataSections
 
- 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
 

Static Protected Attributes

static constexpr std::uint8_t PAYLOAD_ID = 0xAA
 
static constexpr std::uint32_t EOI_RESERVED = 0x454F4949
 
- 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
 

Friends

std::ostream & operator<< (std::ostream &tStream, const arc::gen4::CArcImagePacket &rPacket)
 

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
 

Detailed Description

Definition at line 62 of file CArcImagePacket.h.

Constructor & Destructor Documentation

◆ CArcImagePacket() [1/2]

arc::gen4::CArcImagePacket::CArcImagePacket ( void  )

Constructor

◆ CArcImagePacket() [2/2]

arc::gen4::CArcImagePacket::CArcImagePacket ( const CArcImagePacket rPacket)

Copy constructor

Parameters
rPacket- The image packet to copy into this one.

◆ ~CArcImagePacket()

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

Destructor

Member Function Documentation

◆ headerValid()

virtual bool arc::gen4::CArcImagePacket::headerValid ( void  ) const
overridevirtualnoexcept

Returns whether or not the header contains valid values.

Returns
Returns true if the header contains valid values.

Implements arc::gen4::CArcPacket.

◆ endOfImage() [1/2]

bool arc::gen4::CArcImagePacket::endOfImage ( void  ) const
noexcept

Returns whether or not the packet is a special end-of-image packet.

Returns
Returns true if packet represents end-of-image.

◆ endOfImage() [2/2]

bool arc::gen4::CArcImagePacket::endOfImage ( const imagePacketHeader_t pHeader) const
noexcept

Returns whether or not the specified header the end-of-image indicator.

Parameters
pHeader- A pointer to an image packet header.
Returns
Returns true if the end-of-image indicator is present; false otherwise.

◆ assign() [1/2]

void arc::gen4::CArcImagePacket::assign ( std::uint8_t *  pData,
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::invalid_argument
std::out_of_rangeerror if data too large for packet type.

◆ assign() [2/2]

void arc::gen4::CArcImagePacket::assign ( void  )

Ensure proper object internals if the buffer data has been directly assigned instead of using the assign() method.

Exceptions
std::runtimeerror

◆ hasMoreDataSections()

bool arc::gen4::CArcImagePacket::hasMoreDataSections ( void  ) const
noexcept

Returns whether or not there are more sub-payload data sections within the packet.

Returns
true if there are more data sections; false otherwise.

◆ getNextDataSection()

arc::gen4::dataSection_t arc::gen4::CArcImagePacket::getNextDataSection ( void  )

Returns the next available image data section.

Returns
A std::pair containing the image data section header and data pointer. Returns an empty pair of size zero if there are no more data sections.
Exceptions
std::runtime_error
std::out_of_rangeerror

◆ getName()

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

Returns the packet name.

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

Implements arc::gen4::CArcPacket.

◆ serialize()

void arc::gen4::CArcImagePacket::serialize ( std::ostream &  tStream)

Serialize the class object to the specified output stream. The packet is output using MAX_PACKET_SIZE.

Parameters
tStream- The output stream to place the output of the toLogString() method.
Exceptions
Anyexception thrown by std::basic_ostream::write

◆ deserialize()

void arc::gen4::CArcImagePacket::deserialize ( std::istream &  tStream)

Deserialize the class object from the specified input stream.

Parameters
tStream- The input stream to read the packet from.
Exceptions
Anyexception thrown by std::basic_ostream::read

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  tStream,
const arc::gen4::CArcImagePacket rPacket 
)
friend

Output toLogString() to the specified stream.

Parameters
tStream- The output stream to place the output of toLogString() method.
Returns
The output stream.

Output arc::gen4::CArcImagePacket::toLogString() to the specified stream.

Parameters
tStream- The output stream to place the output of toLogString() method.
Returns
The output stream.

Member Data Documentation

◆ MAX_PACKET_SIZE

constexpr std::uint16_t arc::gen4::CArcImagePacket::MAX_PACKET_SIZE = 1500
staticconstexpr

Maximum packet size ( in bytes )

Definition at line 130 of file CArcImagePacket.h.

◆ PAYLOAD_ID

constexpr std::uint8_t arc::gen4::CArcImagePacket::PAYLOAD_ID = 0xAA
staticconstexprprotected

Payload identifier

Definition at line 153 of file CArcImagePacket.h.

◆ EOI_RESERVED

constexpr std::uint32_t arc::gen4::CArcImagePacket::EOI_RESERVED = 0x454F4949
staticconstexprprotected

End-Of-Packet reserved value

Definition at line 156 of file CArcImagePacket.h.

◆ m_pHeader

imagePacketHeader_t* arc::gen4::CArcImagePacket::m_pHeader
protected

Packet header pointer

Definition at line 159 of file CArcImagePacket.h.

◆ m_pDataHeader

imageDataHeader_t* arc::gen4::CArcImagePacket::m_pDataHeader
protected

Image data header pointer

Definition at line 162 of file CArcImagePacket.h.

◆ m_pNextDataSection

std::uint16_t* arc::gen4::CArcImagePacket::m_pNextDataSection
protected

Next image data pointer

Definition at line 165 of file CArcImagePacket.h.

◆ m_pPayload

std::uint16_t* arc::gen4::CArcImagePacket::m_pPayload
protected

Image packet payload pointer

Definition at line 168 of file CArcImagePacket.h.

◆ m_pEndOfPacket

std::uint16_t* arc::gen4::CArcImagePacket::m_pEndOfPacket
protected

Image packet end

Definition at line 171 of file CArcImagePacket.h.

◆ m_bHasMoreDataSections

bool arc::gen4::CArcImagePacket::m_bHasMoreDataSections
protected

End of data reached

Definition at line 174 of file CArcImagePacket.h.