A default request factory.
Applications need to derive from this class and must re-implement the function mvIMPACT::acquire::RequestFactory::createRequest to work with custom objects derived from mvIMPACT::acquire::Request.
Deriving from mvIMPACT::acquire::Request can be useful when a certain device driver or device offers a custom feature that is returned as part of the request object that can not be accessed using the mvIMPACT::acquire::Request class offered by this interface.
This shows how a request factory could be used to create custom request objects from within a mvIMPACT::acquire::FunctionInterface instance.
class MyRequestFactory;
{
friend class MyRequestFactory;
void init( void )
{
locator.bindComponent( myRequestResult, "Result" );
}
protected:
explicit MyRequest(
Device* pDev,
int requestNr ) :
Request(pDev, requestNr), myRequestResult()
{
init();
}
public:
explicit MyRequest( const MyRequest& src ) : Request(src), myRequestResult(src.myRequestResult) {}
MyRequest& operator=( const MyRequest& rhs )
{
if( this != &rhs )
{
Request::operator=( rhs );
init();
}
return *this;
}
};
{
public:
};
A class to locate components within the driver.
Definition mvIMPACT_acquire.h:8043
This class and its functions represent an actual device detected by this interface in the current sys...
Definition mvIMPACT_acquire.h:6118
A default request factory.
Definition mvIMPACT_acquire.h:10717
Contains information about a captured buffer.
Definition mvIMPACT_acquire.h:8640
EnumPropertyI< TRequestResult > PropertyIRequestResult
Defines a property for values defined by mvIMPACT::acquire::TRequestResult.
Definition mvIMPACT_acquire.h:4640
Now the request factory must be passed to the constructor of the function interface
{
MyRequestFactory mrf;
const Request* pRequest = fi.getRequest( getRequestNrFromSomewhere() );
{
const MyRequest* pMyRequest(dynamic_cast<const MyRequest*>(pRequest));
cout << pMyRequest->myRequestResult.name() << ": " << pMyRequest->myRequestResult.readS() << endl;
}
}
The function interface to devices supported by this interface.
Definition mvIMPACT_acquire.h:10758
bool isOK(void) const
Convenience function to check if a request has been processed successfully.
Definition mvIMPACT_acquire.h:9474
- Since
- 1.12.56