Developer Application Interface (ARC API) v3.6.2
ARC, Inc. GenII/III Application Interface
|
#include <CArcBase.h>
Public Member Functions | |
virtual | ~CArcBase (void) |
Static Public Member Functions | |
static const std::string | version (void) |
static void | zeroMemory (void *pDest, const std::size_t uiSize) |
static void | copyMemory (void *pDest, void *pSrc, const std::size_t uiSize) |
static void | throwOutOfRange (const std::string &sMethodName, const std::int32_t iLine, const std::uint32_t uiElement, std::pair< std::uint32_t, std::uint32_t > range) |
static void | throwOutOfRange (const std::string &sMethodName, const std::int32_t iLine, const std::string &sElement, const std::size_t uiSize) |
static void | throwNoDeviceError (const std::string &sMethodName, const std::int32_t iLine, const std::string &sMsg="") |
template<typename T = std::runtime_error> | |
static void | throwException (const std::string &sMethodName, const std::int32_t iLine, const std::string &sMsg) |
template<typename T = std::runtime_error> | |
static void | throwException (const std::string &sMethodName, const std::int32_t iLine, const char *pszFmt,...) |
template<typename ErrCode > requires std::is_integral_v<ErrCode> | |
static const std::string | getSystemMessage (ErrCode iCode) |
static std::int32_t | getSystemError (void) noexcept |
static std::unique_ptr< CArcStringList > | splitString (const std::string &sString, const char &zDelim=' ') |
static std::string | formatString (const char *pszFmt,...) |
static std::string | convertWideToAnsi (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) |
static std::string | cmdToString (const std::uint32_t uiReply, const std::initializer_list< std::uint32_t > &tCmdList) |
static std::string | setDots (std::string_view svText, const std::size_t uiMaxLength, const char szDot='.') |
template<typename T > | |
static std::string | iterToString (T *pBegin, T *pEnd, char zSeperator=' ') |
Protected Member Functions | |
CArcBase (void)=default | |
CArcBase (const CArcBase &)=delete | |
CArcBase (CArcBase &&)=delete | |
CArcBase & | operator= (const CArcBase &)=delete |
CArcBase & | operator= (CArcBase &&)=delete |
Static Protected Attributes | |
static const std::string | m_sVersion |
Standard ARC device base class that makes a set of useful methods available to all subclasses. Class methods include throwing formatted exceptions, ascii to string command conversion, error uiCode formatting and character conversion ( unicode to ascii and vice versa ).
|
virtual |
Destructor
|
protecteddefault |
Default constructor
|
protecteddelete |
Delete copy constructor
|
protecteddelete |
Delete move constructor
|
static |
Converts a device or controller ascii command to a string represented by changing each each byte to its ascii letter equivalent. This is useful for logging human readable versions of a command. For example, 0x54444C would be converted to "TDL". If the command fails to be converted, then the hexadecimal value is returned as a string. For example, 0x212223 would be returned as "0x212223" and not "!*#".
uiCmd | - A device or controller ascii command. |
|
static |
Converts a device or controller ascii command to a string represented by changing each each byte to its ascii letter equivalent. This is useful for logging human readable versions of a command. For example, 0x54444C would be converted to "TDL". If the command fails to be converted, then the hexadecimal value is returned as a string. For example, 0x212223 would be returned as "0x212223" and not "!*#".
uiCmd | - A controller ascii command reply value. |
tCmdList | - The controller ascii command list. |
|
static |
Converts an ansi string to a unicode string.
pszString | - The ansi string to convert. |
|
static |
Converts a unicode string to an ansi string.
wsString | - The unicode string to convert. |
|
staticnoexcept |
Converts a unicode character array to an ansi string.
wzString | - The unicode character array to convert. |
|
static |
Copies the source buffer into the destination buffer.
pDest | - Pointer to the destination buffer to copy into. |
pSrc | - Pointer to the source buffer to copy out of. |
uiSize | - The size of the buffers ( in bytes ). |
std::invalid_argument | if arguments are invalid. |
|
static |
Formats a std::string using printf-style formatting. Acceptable format string specifiers:
Acceptable format string specifiers: %u -> unsigned integer %d -> integer %f -> double %l -> long %j -> unsigned long %J -> unsigned long long %s -> char * string %e -> system message (as returned by errno or GetLastError) %x/X -> lower/upper case hexadecimal integer.
pszFmt | - A printf-style format string. See above for specifiers. |
... | - Arguments to fill in format string specifiers. |
|
inlinestaticnoexcept |
Returns the current system error code.
|
inlinestatic |
Returns a string that represents the specified system error uiCode.
uiCode/iCode | - The system specific error uiCode ( GetLastError() on windows, errno on linux/mac ). |
|
inlinestatic |
Moves through the specified iterator positions and places each value into a return string that is seperated by the specified zSeperator.
Example: std::initializer_list<std::uint32_t> list = { 1, 2, 3, 4 }; produces the following output: "1 2 3 4 "
pBegin | - Pointer to iterator to the first element. |
pEnd | - Pointer to iterator to the last element. |
zSeperator | - Seperator character ( default = ' ' ). |
std::invalid_argument | if iterator pointers are invalid. |
Delete move assignment constructor
Delete copy assignment constructor
|
static |
Appends dots to the end of the specified string to show a connection to a component.
svText | - The text to append the dots too. |
uiMaxLength | - The maximum length of the returned string. |
szDot | - The dot character (default = '.'). |
std::ios_base::failure | |
std::length_error |
|
static |
Splits a string based on the specified deliminator.
sString | - The string to split. |
zDelim | - The character used to split the string ( default = ' ' ). |
std::runtime_error() |
|
inlinestatic |
Throws a std::exception based on the template parameter (default = std::runtime_error). Uses printf-style formatting. Acceptable format string specifiers:
Acceptable format string specifiers: %u -> unsigned integer %d -> integer %f -> double %l -> long %j -> unsigned long %J -> unsigned long long %s -> char * string %e -> system message (as returned by errno or GetLastError) %x/X -> lower/upper case hexadecimal integer.
sMethodName | - The name of the method that's the source of the exception. |
iLine | - The line number that's the source of the exception. |
pszFmt | - A printf-style format string. See above for specifiers. |
... | - Arguments to fill in format string specifiers. |
|
inlinestatic |
Throws a std::exception based on the template parameter (default = std::runtime_error).
sMethodName | - The name of the method that's the source of the exception. |
iLine | - The line number that's the source of the exception. |
sMsg | - The exception message. |
|
static |
Throws a std::runtime_error exception.
sMethodName | - The name of the method that's the source of the exception. |
iLine | - The line number that's the source of the exception. |
sMsg | - The exception message. |
|
static |
Throws a std::out_of_range exception.
sMethodName | - The name of the method that's the source of the exception. |
iLine | - The line number that's the source of the exception. |
sElement | - The element that's out of range. |
uiSize | - The elements max size. |
|
static |
Throws a std::out_of_range exception.
sMethodName | - The name of the method that's the source of the exception. |
iLine | - The line number that's the source of the exception. |
uiElement | - The element that's out of range. |
range | - A pair that defines the valid range. |
|
static |
Returns a textual representation of the library version.
|
static |
Zero out the specified buffer.
pDest | - Pointer to the buffer to zero. |
uiSize | - The size of the buffer ( in bytes ). |
std::invalid_argument | if arguments are invalid. |
|
staticprotected |
version() text holder