![]() |
Developer Application Interface (ARC API) v4.5.8
ARC, Inc. GenIV Application Interface
|
#include <CArcLog.h>
Public Member Functions | |
| CArcLog (void) | |
| ~CArcLog (void)=default | |
| void | setMaxSize (const qsize_t uiSize=Q_MAX) |
| void | enable (const bool bEnable=true) |
| bool | isEnabled (void) const noexcept |
| void | put (const std::string &sText) |
| void | put (const char *pszFmt,...) |
| const std::string | next (void) |
| const std::string | last (void) |
| std::size_t | count (void) const noexcept |
| bool | empty (void) const noexcept |
| CArcLog & | operator<< (std::string const &sText) |
Public Member Functions inherited from arc::gen4::CArcBase | |
| virtual | ~CArcBase (void) |
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::CArcBase | |
| CArcBase (void)=default | |
| CArcBase (const CArcBase &)=delete | |
| CArcBase (CArcBase &&)=delete | |
| CArcBase & | operator= (const CArcBase &)=delete |
| CArcBase & | operator= (CArcBase &&)=delete |
Static Protected Attributes inherited from arc::gen4::CArcBase | |
| static const std::string | m_sVersion |
Class to log device and controller commands for debugging purposes.
| arc::gen4::CArcLog::CArcLog | ( | void | ) |
Default constructor
|
default |
Destructor
| void arc::gen4::CArcLog::setMaxSize | ( | const qsize_t | uiSize = Q_MAX | ) |
Sets the maximum number of messages that the Q can hold.
| uiSize | - The maximum number of message the Q can hold. Must be > 0 ( default = Q_MAX ). |
| Any | exception thrown by std::lock_guard |
| void arc::gen4::CArcLog::enable | ( | const bool | bEnable = true | ) |
Enable/Disable logging.
| bEnable | - true to enable logging; false to disable ( default = true ). |
| Any | exception thrown by std::lock_guard |
|
noexcept |
Returns whether or not logging is enabled.
| void arc::gen4::CArcLog::put | ( | const std::string & | sText | ) |
Inserts the packet into the log queue. It dumps the oldest message if the queue size is
greater than or equal to Q_MAX.
| sText | - The text to add to the log queue. |
| Any | exception thrown by std::lock_guard |
| Any | exception thrown by std::queue |
| void arc::gen4::CArcLog::put | ( | const char * | pszFmt, |
| ... | |||
| ) |
Inserts a message into the log queue. It dumps the oldest message if the queue size is greater than or equal to Q_MAX.
| pszFmt | - C-printf style format (sort of). See arc::gen4::CArcBase::formatString() for format list. |
| Any | exception thrown by std::lock_guard |
| Any | exception thrown by std::queue |
| const std::string arc::gen4::CArcLog::next | ( | void | ) |
Returns the oldest string ( as char * ) from the front of the queue. Also pops the message from the queue. Applications should call empty() to check if more messages are available. throws std::runtime_error
| const std::string arc::gen4::CArcLog::last | ( | void | ) |
Returns the newest string ( as char * ) from the back of the queue. Also pops the message from the queue.
| Any | exception thrown by std::lock_guard |
| Any | exception thrown by std::queue |
|
noexcept |
Returns the number of elements in the queue. throws std::runtime_error
|
noexcept |
Checks if the Q is empty. i.e. if there are any messages in the Q. Returns 'true' if the queue is empty; 'false' otherwise. throws std::runtime_error
| CArcLog & arc::gen4::CArcLog::operator<< | ( | std::string const & | sText | ) |
Append operator. Appends a string to the end of the log.
| sElem | - The string to add to the log. |