Impact Acquire SDK C++
ComponentAccess Class Reference

A base class to implement access to internal driver objects. More...

#include <mvIMPACT_acquire.h>

Inheritance diagram for ComponentAccess:
[legend]

Public Member Functions

unsigned int changedCounter (void) const
 Returns the current changed counter for the component referenced by this object.
 
unsigned int changedCounterAttr (void) const
 Returns the current attribute changed counter for the component referenced by this object.
 
 ComponentAccess (const ComponentAccess &src)
 Constructs a new mvIMPACT::acquire::ComponentAccess from an existing one.
 
std::string displayName (void) const
 Returns the display name of the component referenced by this object.
 
HOBJ hObj (void) const
 Returns a unique identifier for the component referenced by this object.
 
std::string name (void) const
 Returns the name of the component referenced by this object.
 
 operator HOBJ () const
 Allows implicit conversion to a HOBJ.
 
ComponentAccessoperator= (const ComponentAccess &rhs)
 Allows assignments of mvIMPACT::acquire::ComponentAccess objects.
 
virtual ~ComponentAccess (void)
 

Protected Types

enum  { BUFFER_INCREMENT_FACTOR = 6 }
 An internal constant that defines by which factor dynamic buffers will grow when the current size is not sufficient. More...
 

Protected Member Functions

std::string compGetStringParam (TOBJ_StringQuery query, int param1=0, int param2=0) const
 A helper function to query certain component related string parameters.
 
 ComponentAccess (HOBJ hObj)
 Constructs a new mvIMPACT::acquire::ComponentAccess object to a driver object.
 
 ComponentAccess (void)
 Constructs a new unbound mvIMPACT::acquire::ComponentAccess object.
 

Static Protected Member Functions

static char * stringAllocator (const char *pBuf, size_t reqBufSize)
 An internal helper function for fast string allocation.
 

Protected Attributes

HOBJ m_hObj
 A unique identifier for the internal driver object referenced by this instance of mvIMPACT::acquire::ComponentAccess.
 

Friends

class ComponentLocatorBase
 

Detailed Description

A base class to implement access to internal driver objects.

Instances of this class can't be constructed directly.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

An internal constant that defines by which factor dynamic buffers will grow when the current size is not sufficient.

Enumerator
BUFFER_INCREMENT_FACTOR 

Constructor & Destructor Documentation

◆ ComponentAccess() [1/3]

ComponentAccess ( HOBJ hObj)
inlineexplicitprotected

Constructs a new mvIMPACT::acquire::ComponentAccess object to a driver object.

Parameters
[in]hObjA valid handle to a component object

◆ ComponentAccess() [2/3]

ComponentAccess ( void )
inlineexplicitprotected

Constructs a new unbound mvIMPACT::acquire::ComponentAccess object.

◆ ~ComponentAccess()

virtual ~ComponentAccess ( void )
inlinevirtual

◆ ComponentAccess() [3/3]

ComponentAccess ( const ComponentAccess & src)
inline

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

Parameters
[in]srcA constant reference to the mvIMPACT::acquire::ComponentAccess object, this object shall be created from

Member Function Documentation

◆ changedCounter()

unsigned int changedCounter ( void ) const
inline

Returns the current changed counter for the component referenced by this object.

This changed counter is incremented internally each time the component is modified. To check if this component has been modified since the last time, this check has been performed, keep track of the last return value of this function and compare it with the new value. This can be helpful e.g. to keep a GUI up to date. The value returned by this function will always be larger than or equal to the value returned by mvIMPACT::acquire::ComponentAccess::changedCounterAttr (except in case of a wrap around) when called at the same time for the same object as it's always incremented when the component has been modified in any way while the latter one will only be incremented if the attributes (e.g. the flags) but NOT if e.g. the value(s) of a property has been modified.

//-----------------------------------------------------------------------------
struct ComponentRef
//-----------------------------------------------------------------------------
{
unsigned int lastChangedCount_;
ComponentRef( mvIMPACT::acquire::Component c ) : c_( c ), lastChangedCount_( 0 ) {}
};
//-----------------------------------------------------------------------------
void fn( ComponentRef& cr )
//-----------------------------------------------------------------------------
{
if( cr.c_.isValid() )
{
const unsigned int currentChangedCount = cr.c_.changedCounter();
if( currentChangedCount != cr.lastChangedCount_ )
{
// something has happened since the last check!
doWhatNeedsToBeDone();
// and remember the current changed counter
cr.lastChangedCount_ = currentChangedCount;
}
}
}
A base class to implement access to internal driver components.
Definition mvIMPACT_acquire.h:1439
Returns
The current changed counter of this object.

◆ changedCounterAttr()

unsigned int changedCounterAttr ( void ) const
inline

Returns the current attribute changed counter for the component referenced by this object.

This changed counter is incremented internally each time the components attributes have been modified. To check if this components attributes have been modified since the last time, this check has been performed, keep track of the last return value of this function and compare it with the new value. This can be helpful e.g. to keep a GUI up to date.

Note
Attributes changes are e.g. a modification to a property's translation dictionary, but NOT a property's value. Because of this the value returned by this function will always be less or equal than the value returned by the function mvIMPACT::acquire::ComponentAccess::changedCounter (except in case of a wrap around) when called at the same time for the same object.
See also
mvIMPACT::acquire::ComponentAccess::changedCounter
Returns
The current attributes changed counter of this object.

◆ compGetStringParam()

std::string compGetStringParam ( TOBJ_StringQuery query,
int param1 = 0,
int param2 = 0 ) const
inlineprotected

A helper function to query certain component related string parameters.

This function might throw an exception, if an invalid parameter has been queried.

Returns
A string containing the data to be queried.
Parameters
queryThe type of the parameter to read
[in]param1An additional parameter
[in]param2An additional parameter

◆ displayName()

std::string displayName ( void ) const
inline

Returns the display name of the component referenced by this object.

Since
1.11.20
Returns
The display name of the component referenced by this object. This might be an empty string if no display name has been specified.
Examples
GenICamSequencerParameterChangeAtRuntime.cpp, GenICamSequencerUsage.cpp, GenICamSequencerUsage.legacy.cpp, GenICamSequencerUsageWithPaths.cpp, GenICamSequencerUsageWithPaths.legacy.cpp, and exampleHelper.h.

◆ hObj()

HOBJ hObj ( void ) const
inline

Returns a unique identifier for the component referenced by this object.

Returns
A unique identifier for the component referenced by this object.

◆ name()

◆ operator HOBJ()

operator HOBJ ( ) const
inline

Allows implicit conversion to a HOBJ.

◆ operator=()

ComponentAccess & operator= ( const ComponentAccess & rhs)
inline

Allows assignments of mvIMPACT::acquire::ComponentAccess objects.

◆ stringAllocator()

static char * stringAllocator ( const char * pBuf,
size_t reqBufSize )
inlinestaticprotected

An internal helper function for fast string allocation.

Friends And Related Symbol Documentation

◆ ComponentLocatorBase

friend class ComponentLocatorBase
friend

Member Data Documentation

◆ m_hObj

HOBJ m_hObj
protected

A unique identifier for the internal driver object referenced by this instance of mvIMPACT::acquire::ComponentAccess.