mvIMPACT Acquire SDK C++
EventSubSystem Class Reference

An interface class that provides access to all event handling related objects and functions(Device specific interface layout only)(deprecated). More...

Public Member Functions

 EventSubSystem (const EventSubSystem &src)
 Constructs a new mvIMPACT::acquire::EventSubSystem from an existing one. More...
 
 EventSubSystem (Device *pDev)
 Constructs a new mvIMPACT::acquire::EventSubSystem object(deprecated). More...
 
EventgetEventByIndex (int index) const
 Returns a reference to an mvIMPACT::acquire::Event based on the index in the internal array of event references. More...
 
EventgetEventByName (const std::string &name) const
 Returns a reference to an mvIMPACT::acquire::Event based on the type (represented as a string) of the event. More...
 
EventgetEventByType (TDeviceEventType type) const
 Returns a reference to an mvIMPACT::acquire::Event based on the type of the event. More...
 
unsigned int getEventCount (void) const
 Returns the number of different event types available for the device that has been passed to the constructor of this object. More...
 
EventSubSystemoperator= (const EventSubSystem &rhs)
 Allows assignment of one mvIMPACT::acquire::EventSubSystem to another. More...
 
EventWaitResults waitFor (int timeout_ms, TDeviceEventType mask)
 Waits for the occurrence of one or more events(deprecated). More...
 
 ~EventSubSystem ()
 

Detailed Description

An interface class that provides access to all event handling related objects and functions(Device specific interface layout only)(deprecated).

Deprecated:
This class has been declared deprecated and will be removed in future versions of this interface. A more flexible way of getting informed about changes in driver features has been added to the interface and should be used instead. An example for this new method can be found here: Callback.cpp

Events from the mvIMPACT Acquire interfaces point of view are certain things reported by the hardware like e.g. the detection of a frame start or the change on one of the digital inputs of a device.

This class combines everything that is related mvIMPACT Acquire s event handling.

//-----------------------------------------------------------------------------
void fn( void )
//-----------------------------------------------------------------------------
{
// create an interface to the event processing
unsigned int frameStartEventCnt = 0;
EventSubSystem ess(getDevicePointerFromSomewhere());
Event* pEvent = ess.getEventByType( detFrameStart );
if( !pEvent )
{
cout << "Frame start events not supported by this device." << endl;
return;
}
pEvent->mode.write( demNotify );
TDeviceEventType type = pEvent->type.read();
TDeviceEventType resultMask;
int timeout_ms = 500;
while( !s_boTerminated )
{
// wait for frame start event
EventWaitResults waitResult = ess.waitFor( timeout_ms, type );
if( ( waitResult.errorCode() == DMR_NO_ERROR ) )
{
// we are just waiting for one event type, thus the result mask ain't interesting
frameStartEventCnt = pEvent->getData().count;
// do something
}
else
{
// no event detected within the given timeout
}
}
}
EventSubSystem(Device *pDev)
Constructs a new mvIMPACT::acquire::EventSubSystem object(deprecated).
TDeviceEventType
Defines valid device event types.
Definition: mvDriverBaseEnums.h:1904
@ detFrameStart
An event of this type will be signaled (if desired) each time the start of a new image has been detec...
Definition: mvDriverBaseEnums.h:1926
@ DMR_NO_ERROR
The function call was executed successfully.
Definition: mvDriverBaseEnums.h:2356
@ demNotify
This event will be notified whenever the underlying event has been detected by the device driver.
Definition: mvDriverBaseEnums.h:1885
Note
This class will only be available if mvIMPACT::acquire::Device::interfaceLayout is set to mvIMPACT::acquire::dilDeviceSpecific before the device is opened.

Constructor & Destructor Documentation

◆ EventSubSystem() [1/2]

EventSubSystem ( Device pDev)
explicit

Constructs a new mvIMPACT::acquire::EventSubSystem object(deprecated).

Deprecated:
All functions belonging to this class have been declared deprecated. See detailed description of mvIMPACT::acquire::EventSubSystem.

[in] A pointer to a mvIMPACT::acquire::Device object obtained from a mvIMPACT::acquire::DeviceManager object.

◆ EventSubSystem() [2/2]

EventSubSystem ( const EventSubSystem src)
inline

Constructs a new mvIMPACT::acquire::EventSubSystem from an existing one.

Deprecated:
All functions belonging to this class have been declared deprecated. See detailed description of mvIMPACT::acquire::EventSubSystem.

Internal data is reference counted, thus modifying an event obtained from src will also modify the same event obtained from this newly constructed class.

Parameters
[in]srcA reference to an existing mvIMPACT::acquire::EventSubSystem.

◆ ~EventSubSystem()

Member Function Documentation

◆ getEventByIndex()

Event* getEventByIndex ( int  index) const
inline

Returns a reference to an mvIMPACT::acquire::Event based on the index in the internal array of event references.

Deprecated:
All functions belonging to this class have been declared deprecated. See detailed description of mvIMPACT::acquire::EventSubSystem.

If the index is either equal or higher than the number of recognized events
a STL out_of_range exception is thrown.

Returns
  • a pointer to a mvIMPACT::acquire::Event object specifying the event the given index in the internal list if available.
  • an invalid pointer or reference otherwise.
Parameters
[in]indexThe index of the event object the user wants to access.

◆ getEventByName()

Event* getEventByName ( const std::string &  name) const
inline

Returns a reference to an mvIMPACT::acquire::Event based on the type (represented as a string) of the event.

Deprecated:
All functions belonging to this class have been declared deprecated. See detailed description of mvIMPACT::acquire::EventSubSystem.
Returns
  • a pointer to a mvIMPACT::acquire::Event object specifying the event of the given type in the internal list if available.
  • an invalid pointer or reference otherwise.
Parameters
[in]nameThe name/string representation of the event object the user wants to access.

◆ getEventByType()

Event* getEventByType ( TDeviceEventType  type) const
inline

Returns a reference to an mvIMPACT::acquire::Event based on the type of the event.

Deprecated:
All functions belonging to this class have been declared deprecated. See detailed description of mvIMPACT::acquire::EventSubSystem.
Returns
  • a pointer to a mvIMPACT::acquire::Event object specifying the event of the given type in the internal list if available.
  • an invalid pointer or reference otherwise.
Parameters
[in]typeThe type of the event object the user wants to access.

◆ getEventCount()

unsigned int getEventCount ( void  ) const
inline

Returns the number of different event types available for the device that has been passed to the constructor of this object.

Deprecated:
All functions belonging to this class have been declared deprecated. See detailed description of mvIMPACT::acquire::EventSubSystem.

◆ operator=()

EventSubSystem& operator= ( const EventSubSystem rhs)
inline

Allows assignment of one mvIMPACT::acquire::EventSubSystem to another.

Deprecated:
Internal data is reference counted, thus modifying an event obtained from src will also modify the same event obtained from this newly constructed class.
Parameters
[in]rhsA reference to an existing mvIMPACT::acquire::EventSubSystem.

◆ waitFor()

EventWaitResults waitFor ( int  timeout_ms,
TDeviceEventType  mask 
)

Waits for the occurrence of one or more events(deprecated).

Deprecated:
This function has been declared deprecated and will be removed in future versions of this interface. A more flexible way of getting informed about changes in driver features has been added to the interface and should be used instead. An example for this new method can be found here: Callback.cpp

This function must be called to wait for one or more events to becomes signalled by the device driver.

Returns
A mvIMPACT::acquire::EventWaitResults object containing information about the result of this operation. [in] The timeout in ms defining the maximum time to be spend waiting [in] A mask specifying the event types to wait for. Here values defined by mvIMPACT::acquire::TDeviceEventType can be ORed together.

The documentation for this class was generated from the following file: