Impact Acquire SDK Java
ComponentAccess Class Reference

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

Inheritance diagram for ComponentAccess:
[legend]

Public Member Functions

long changedCounter ()
 Returns the current changed counter for the component referenced by this object.
 
long changedCounterAttr ()
 Returns the current attribute changed counter for the component referenced by this object.
 
 ComponentAccess (ComponentAccess src)
 Constructs a new mvIMPACT.acquire.ComponentAccess from an existing one.
 
synchronized void delete ()
 
String displayName ()
 Returns the display name of the component referenced by this object.
 
int hObj ()
 Returns a unique identifier for the component referenced by this object.
 
String name ()
 Returns the name of the component referenced by this object.
 

Protected Member Functions

 ComponentAccess (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 

Static Protected Member Functions

static long swigRelease (ComponentAccess obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

A base class to implement access to internal driver objects.

Instances of this class can't be constructed directly.

Constructor & Destructor Documentation

◆ ComponentAccess() [1/2]

ComponentAccess ( long cPtr,
boolean cMemoryOwn )
protected

◆ ComponentAccess() [2/2]

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

Parameters
src[in] A constant reference to the mvIMPACT.acquire.ComponentAccess object, this object shall be created from

Member Function Documentation

◆ changedCounter()

long changedCounter ( )

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.

import mvIMPACT.acquire.*;
//-----------------------------------------------------------------------------
public class ComponentRef
//-----------------------------------------------------------------------------
{
private Component c_;
private long lastChangedCount_;
public ComponentRef( Component c ) : c_( c ), lastChangedCount_( 0 ) {}
public Component getComponent()
{
return c_;
}
public long getLastChangedCounter()
{
return lastChangedCount_;
}
public void setLastChangedCounter( long changedCounter )
{
lastChangedCount_ = lastChangedCount;
}
}
// ...more code, class definition etc.
//-----------------------------------------------------------------------------
public static void fn( ComponentRef cr )
//-----------------------------------------------------------------------------
{
if( cr.c_.isValid() )
{
final long currentChangedCount = cr.getComponent().changedCounter();
if( currentChangedCount != cr.getLastChangedCounter() )
{
// something has happened since the last check!
doWhatNeedsToBeDone();
// and remember the current changed counter
cr.setLastChangedCounter( currentChangedCount );
}
}
}
A base class to implement access to internal driver components.
Definition Component.java:224
Returns
The current changed counter of this object.

◆ changedCounterAttr()

long changedCounterAttr ( )

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.

◆ delete()

◆ displayName()

String displayName ( )

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.

◆ finalize()

◆ hObj()

int hObj ( )

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

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

◆ name()

String name ( )

Returns the name of the component referenced by this object.

Returns
The name of the component referenced by this object.

◆ swigRelease()

static long swigRelease ( ComponentAccess obj)
staticprotected

Member Data Documentation

◆ swigCMemOwn

transient boolean swigCMemOwn
protected