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

#include <CArcSystem.h>

Inheritance diagram for arc::gen4::CArcSystem:
arc::gen4::CArcBase

Static Public Member Functions

static bool open (arc::gen4::arcDevHandle_t &hDevice, const arcDev_t &tDevice, std::uint64_t uiFlags=0) noexcept
 
static bool close (arc::gen4::arcDevHandle_t &hDevice) noexcept
 
static bool write (arc::gen4::arcDevHandle_t hDevice, const std::uint8_t *pBuffer, const std::uint32_t uiBufferSize, std::uint32_t *pBytesWritten=nullptr) noexcept
 
static bool read (arc::gen4::arcDevHandle_t hDevice, std::uint8_t *pBuffer, const std::uint32_t uiBufferSize, std::uint32_t *pBytesRead=nullptr) noexcept
 
static bool ioctl (arc::gen4::arcDevHandle_t hDevice, const std::uint32_t uiCommand, void *pIn, std::uint32_t uiInSize, void *pOut=nullptr, std::uint32_t uiOutSize=0) noexcept
 
static void * mmap (arc::gen4::arcDevHandle_t hDevice, const std::int32_t iMapCommand, const std::size_t uiSize) noexcept
 
static bool munmap (arc::gen4::arcDevHandle_t hDevice, const std::int32_t iMapCommand, void *pAddress, const std::size_t uiSize) noexcept
 
- 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

 CArcSystem (void)=default
 
 ~CArcSystem (void)=default
 
- 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
 

Additional Inherited Members

- Public Member Functions inherited from arc::gen4::CArcBase
virtual ~CArcBase (void)
 
- Static Protected Attributes inherited from arc::gen4::CArcBase
static const std::string m_sVersion
 

Detailed Description

ARC system class provide access to platform specific operations for device (PCIe) access.

Definition at line 162 of file CArcSystem.h.

Constructor & Destructor Documentation

◆ CArcSystem()

arc::gen4::CArcSystem::CArcSystem ( void  )
protecteddefault

Default constructor

◆ ~CArcSystem()

arc::gen4::CArcSystem::~CArcSystem ( void  )
protecteddefault

Default destructor

Member Function Documentation

◆ open()

static bool arc::gen4::CArcSystem::open ( arc::gen4::arcDevHandle_t hDevice,
const arcDev_t tDevice,
std::uint64_t  uiFlags = 0 
)
staticnoexcept

Opens a connection to the specified device ( ARC-460 PCIe board ).

Parameters
hDevice- A reference to a device handle storage location.
tDevice- A string reference to the name of the device to open.
uiFlags- Any device specific flags.
Returns
Returns true</> if the device closed successfully; false otherwise.

◆ close()

static bool arc::gen4::CArcSystem::close ( arc::gen4::arcDevHandle_t hDevice)
staticnoexcept

Closes a connection to the specified device ( ARC-460 PCIe board ).

Parameters
hDevice- A handle reference to the device.
Returns
Returns true</> if the device closed successfully; false otherwise.

◆ write()

static bool arc::gen4::CArcSystem::write ( arc::gen4::arcDevHandle_t  hDevice,
const std::uint8_t *  pBuffer,
const std::uint32_t  uiBufferSize,
std::uint32_t *  pBytesWritten = nullptr 
)
staticnoexcept

Writes a control packet to the device, which is then forwarded to the controller.

Parameters
hDevice- A reference to a device handle storage location.
pBuffer- A pointer to the control packets' data buffer.
uiBufferSize- The size of the control packets' data buffer (in bytes).
pBytesWritten- A pointer that will receive the number of bytes actually written to the device (default = nullptr).

◆ read()

static bool arc::gen4::CArcSystem::read ( arc::gen4::arcDevHandle_t  hDevice,
std::uint8_t *  pBuffer,
const std::uint32_t  uiBufferSize,
std::uint32_t *  pBytesRead = nullptr 
)
staticnoexcept

Reads a status packet from the device, which was sent by the controller.

Parameters
hDevice- A reference to a device handle storage location.
pBuffer- A pointer to a status packets' data buffer.
uiBufferSize- The size of the status packets' data buffer (in bytes).
pBytesWritten- A pointer that will receive the number of bytes actually read from the device (default = nullptr).

◆ ioctl()

static bool arc::gen4::CArcSystem::ioctl ( arc::gen4::arcDevHandle_t  hDevice,
const std::uint32_t  uiCommand,
void *  pIn,
std::uint32_t  uiInSize,
void *  pOut = nullptr,
std::uint32_t  uiOutSize = 0 
)
staticnoexcept

Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.

Parameters
hDevice- A handle reference to the device.
uiCommand- The device driver control code.
pIn- A pointer to an input buffer.
uiInSize- The size of the input buffer, in bytes.
pOut- A pointer to an output buffer.
uiOutSize- The size of the output buffer, in bytes.
Returns
Returns true</> if the operation completed successfully; false otherwise.

◆ mmap()

static void * arc::gen4::CArcSystem::mmap ( arc::gen4::arcDevHandle_t  hDevice,
const std::int32_t  iMapCommand,
const std::size_t  uiSize 
)
staticnoexcept

Map a device into memory.

Parameters
hDevice- A handle reference to the device.
iMapCommand- The device driver map code.
uiSize- The length of the mapping ( which must be greater than 0 ). Not used on Windows.
Returns
Returns a pointer to the mapped area.

◆ munmap()

static bool arc::gen4::CArcSystem::munmap ( arc::gen4::arcDevHandle_t  hDevice,
const std::int32_t  iMapCommand,
void *  pAddress,
const std::size_t  uiSize 
)
staticnoexcept

Un-map a device from memory.

Parameters
hDevice- A handle reference to the device.
iMapCommand- The device driver map code.
pAddress- A pointer to the mapped area.
uiSize- The length of the mapping ( which must be greater than 0 ).