Impact Acquire SDK C++

Adapter between the std::iostreambuf and the SFNC Features representing the device file system. More...

#include <mvIMPACT_acquire_GenICam_FileStream.h>

Public Member Functions

bool attach (mvIMPACT::acquire::Device *pDev, const std::string &settingName="Base")
 Attach file protocol adapter to the corresponding properties.
 
bool closeFile (const char *pFileName)
 Close a file on the device.
 
 FileProtocolAdapter ()
 Constructor.
 
int64_type getBufSize (const char *pFileName, std::ios_base::openmode mode)
 Fetch max FileAccessBuffer length for a file.
 
bool openFile (const char *pFileName, std::ios_base::openmode mode)
 Open a file on the device.
 
std::streamsize read (char *pBuf, int64_type offs, std::streamsize len, const char *pFileName)
 Read data from the device into a buffer.
 
std::streamsize size (void) const
 Fetch the size of the file currently selected on the device.
 
std::streamsize write (const char *pBuf, int64_type offs, int64_type len, const char *pFileName)
 Writes data into a file.
 

Detailed Description

Adapter between the std::iostreambuf and the SFNC Features representing the device file system.

The adapter assumes, that the features provide stdio file access compatible semantic

Constructor & Destructor Documentation

◆ FileProtocolAdapter()

FileProtocolAdapter ( )
inlineexplicit

Constructor.

Member Function Documentation

◆ attach()

bool attach ( mvIMPACT::acquire::Device * pDev,
const std::string & settingName = "Base" )
inline

Attach file protocol adapter to the corresponding properties.

Returns
true if attach was successful, false if not
Parameters
pDevA pointer to a mvIMPACT::acquire::Device object obtained from a mvIMPACT::acquire::DeviceManager object.
settingNameThe name of the driver internal setting to access with this instance. A list of valid setting names can be obtained by a call to mvIMPACT::acquire::FunctionInterface::getAvailableSettings, new settings can be created with the function mvIMPACT::acquire::FunctionInterface::createSetting

◆ closeFile()

bool closeFile ( const char * pFileName)
inline

Close a file on the device.

Returns
true on success, false on error
Parameters
pFileNameName of the file to open. The file name must exist in the Enumeration FileSelector

◆ getBufSize()

int64_type getBufSize ( const char * pFileName,
std::ios_base::openmode mode )
inline

Fetch max FileAccessBuffer length for a file.

Returns
Max length of FileAccessBuffer in the given mode on the given file
Parameters
pFileNameName of the file to open. The file name must exist in the Enumeration FileSelector
modemode to open the file. The mode must exist in the Enumeration FileOpenMode

◆ openFile()

bool openFile ( const char * pFileName,
std::ios_base::openmode mode )
inline

Open a file on the device.

Returns
true on success, false on error
Parameters
pFileNameName of the file to open. The file name must exist in the Enumeration FileSelector
modemode to open the file. The mode must exist in the Enumeration FileOpenMode

◆ read()

std::streamsize read ( char * pBuf,
int64_type offs,
std::streamsize len,
const char * pFileName )
inline

Read data from the device into a buffer.

Returns
number of bytes successfully read
Parameters
pBufTarget buffer
offsOffset in the device file to read from
lenNumber of bytes to read
pFileNameName of the file to write into The file name must exist in the Enumeration FileSelector

◆ size()

std::streamsize size ( void ) const
inline

Fetch the size of the file currently selected on the device.

Returns
The size(in bytes) of the file currently selected.

◆ write()

std::streamsize write ( const char * pBuf,
int64_type offs,
int64_type len,
const char * pFileName )
inline

Writes data into a file.

Returns
Number of bytes written
Parameters
pBufSource buffer
offsOffset into the device file
lenNumber of bytes to write
pFileNameName of the file to write into The file name must exist in the Enumeration FileSelector