mvIMPACT Acquire SDK C++
PropertyS Class Reference

A class to represent string properties. More...

Inheritance diagram for PropertyS:
Property Component ComponentAccess

Public Member Functions

bool allowsValueCombinations (void) const
 Checks if this enumerated property allows the combination of enum values. More...
 
unsigned int binaryDataBufferMaxSize (void) const
 Reads the max size(in bytes) of binary data this property can store. More...
 
unsigned int binaryDataBufferSize (int index=0) const
 Returns the size(in bytes) needed for the binary representation of the string buffer. More...
 
unsigned int changedCounter (void) const
 Returns the current changed counter for the component referenced by this object. More...
 
unsigned int changedCounterAttr (void) const
 Returns the current attribute changed counter for the component referenced by this object. More...
 
unsigned int dictSize (void) const
 Returns the size of the properties translation dictionary. More...
 
std::string displayName (void) const
 Returns the display name of the component referenced by this object. More...
 
std::string docString (void) const
 Returns a string containing general information about the component referenced by this object. More...
 
Component firstChild (void) const
 Moves to the first child of this component(moves down one level). More...
 
Component firstSibling (void) const
 Moves to the first sibling(the first feature in the current list of features). More...
 
TComponentFlag flags (void) const
 Returns the flags associated with this component. More...
 
std::string flagsAsString (const std::string &separator=" | ") const
 Returns the flags associated with this component as a string. More...
 
bool hasDict (void) const
 Returns whether this property defines a translation dictionary or not. More...
 
bool hasMaxValue (void) const
 Checks if a maximum value is defined for this property. More...
 
bool hasMinValue (void) const
 Checks if a minimum value is defined for this property. More...
 
bool hasStepWidth (void) const
 Checks if a step width is defined for this property. More...
 
HOBJ hObj (void) const
 Returns a unique identifier for the component referenced by this object. More...
 
bool isConstDefined (TPropertyLimits constant) const
 Checks if a certain constant is defined for this property(deprecated). More...
 
bool isDefault (void) const
 Checks if this component is currently referencing the default for this component. More...
 
bool isList (void) const
 Checks if this component is of type mvIMPACT::acquire::ComponentList. More...
 
bool isMeth (void) const
 Checks if this component is of type mvIMPACT::acquire::Method. More...
 
bool isProp (void) const
 Checks if this component is of type mvIMPACT::acquire::Property or a derived type. More...
 
bool isValid (void) const
 Checks if the internal component referenced by this object is still valid. More...
 
bool isVisible (void) const
 Checks if the component is currently shadowed due to a settings made elsewhere or not. More...
 
bool isWriteable (void) const
 Checks if the caller has write/modify access to the component. More...
 
Component lastSibling (void) const
 Moves to the last sibling(the last feature in the current list of features). More...
 
unsigned int maxValCount (void) const
 Returns maximum number of values that can be managed by this property. More...
 
std::string name (void) const
 Returns the name of the component referenced by this object. More...
 
Component nextSibling (void)
 Moves to the next sibling(the next feature in the current list of features). More...
 
 operator HOBJ () const
 Allows implicit conversion to a HOBJ. More...
 
Component operator++ (int)
 Moves to the next sibling(the next feature in the current list of features). More...
 
Componentoperator++ (void)
 Moves to the next sibling(the next feature in the current list of features). More...
 
Component parent (void) const
 Moves to the parent of this component(moves up one level). More...
 
 PropertyS ()
 Constructs a new unbound mvIMPACT::acquire::PropertyS object. More...
 
 PropertyS (const PropertyS &src)
 Constructs a new mvIMPACT::acquire::PropertyS from an existing one. More...
 
 PropertyS (HOBJ hProp)
 Constructs a new mvIMPACT::acquire::PropertyS object. More...
 
std::string read (int index=0) const
 Reads a value from a property. More...
 
void read (std::vector< std::string > &sequence, int start=0, int end=END_OF_LIST) const
 Reads a set of values from a property. More...
 
std::string readBinary (int index=0, bool boLegacyMode=false) const
 Reads a value stored in the property as binary data. More...
 
std::string readS (int index=0, const std::string &format="") const
 Reads data from this property as a string. More...
 
std::string readSArray (const std::string &format="", const std::string &delimiter="", int startIndex=0, int endIndex=INT_MAX, int mode=0) const
 Reads data from this property as a string. More...
 
const PropertyremoveValue (int index=0) const
 Removes a certain value from the property's data. More...
 
TComponentRepresentation representation (void) const
 Returns the recommended representation for this component. More...
 
std::string representationAsString (void) const
 Returns the recommended representation of the referenced component as a string. More...
 
const PropertyresizeValArray (unsigned int newSize) const
 Resizes the property's data array. More...
 
const ComponentrestoreDefault (void) const
 Restores the default for the referenced component. More...
 
Component selectedFeature (unsigned int index) const
 Retrieves a component that is selected by the current one. More...
 
unsigned int selectedFeatureCount (void) const
 Returns the number of features selected by the current one. More...
 
unsigned int selectedFeatures (std::vector< Component > &v) const
 Retrieves the list of components that are selected by the current one. More...
 
Component selectingFeature (unsigned int index) const
 Retrieves a component that is selecting the current one. More...
 
unsigned int selectingFeatureCount (void) const
 Returns the number of features selecting the current one. More...
 
unsigned int selectingFeatures (std::vector< Component > &v) const
 Retrieves the list of components that are selecting the current one. More...
 
std::string stringFormatString (void) const
 Returns the internal format string this property uses to convert data to strings. More...
 
TComponentType type (void) const
 Returns the type of the referenced component. More...
 
std::string typeAsString (void) const
 Returns the type of the referenced component as a string. More...
 
unsigned int valCount (void) const
 Returns the current number of values managed by this property. More...
 
TComponentVisibility visibility (void) const
 Returns the recommended visibility for this component. More...
 
std::string visibilityAsString (void) const
 Returns the recommended visibility of the referenced component as a string. More...
 
const PropertySwrite (const std::string &value, int index=0) const
 Writes one value to the property. More...
 
const PropertySwrite (const std::vector< std::string > &sequence, int index=0) const
 Writes a set of values to the property. More...
 
const PropertySwriteBinary (const std::string &value, int index=0) const
 Writes a block of binary data to one entry of the property. More...
 
const PropertywriteS (const std::string &value, int index=0) const
 Assigns a new value to this property. More...
 
const PropertywriteS (const std::vector< std::string > &sequence, int index=0) const
 Assigns new values to this property. More...
 

Static Public Member Functions

static std::string representationAsString (TComponentRepresentation representation)
 Returns the recommended representation converted to a string. More...
 
static TComponentType type (HOBJ hObj)
 Returns the type of the component referenced by hObj. More...
 
static std::string visibilityAsString (TComponentVisibility visibility)
 Returns the recommended visibility converted to a string. More...
 

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. More...
 
int valuesToRead (int start, int end) const
 

Static Protected Member Functions

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

Protected Attributes

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

Detailed Description

A class to represent string properties.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited

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

◆ PropertyS() [1/3]

PropertyS ( )
inlineexplicit

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

◆ PropertyS() [2/3]

PropertyS ( HOBJ  hProp)
inlineexplicit

Constructs a new mvIMPACT::acquire::PropertyS object.

Parameters
[in]hPropA valid handle to the string property

◆ PropertyS() [3/3]

PropertyS ( const PropertyS src)
inline

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

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

Member Function Documentation

◆ allowsValueCombinations()

bool allowsValueCombinations ( void  ) const
inlineinherited

Checks if this enumerated property allows the combination of enum values.

If this function returns true, the enum constants can be 'ored' together. This works for the enum constants as well as for the string representations returned in the properties translation dictionary.

if a property e.g. defines a dictionary (('1', "one"), ('2', "two")) the following write operations will be valid:

prop = getPropFromSomewhere()
prop.write( 1 | 2 )
prop.write( "one | two" )
const PropertyS & write(const std::string &value, int index=0) const
Writes one value to the property.
Definition: mvIMPACT_acquire.h:5225

If this function returns true code like this will be valid:

enum TEnum
{
eA,
eB
};
typedef EnumPropertyI<TEnum> PropertyIEnum;
PropertyIEnum p = getPropFromSomewhere();
p.write( TEnum(eA | eB) );
Returns
  • true if this property allows the combination of enum values.
  • false otherwise.

◆ binaryDataBufferMaxSize()

unsigned int binaryDataBufferMaxSize ( void  ) const
inline

Reads the max size(in bytes) of binary data this property can store.

When binary data shall be stored in a string property, the user will need to allocate memory when this data shall be written to the property. To find out how much binary data can be stored by a property before calling the function mvIMPACT::acquire::PropertyS::writeBinary this function can be used.

See also
mvIMPACT::acquire::PropertyS::readBinary,
mvIMPACT::acquire::PropertyS::writeBinary,
mvIMPACT::acquire::PropertyS::binaryDataBufferMaxSize
Returns
The size(in bytes) needed for the binary representation of the string buffer.

◆ binaryDataBufferSize()

unsigned int binaryDataBufferSize ( int  index = 0) const
inline

Returns the size(in bytes) needed for the binary representation of the string buffer.

When binary data has been stored in a string property it has been stored in Base64 format internally. If the user wants to know the length of the binary data in decoded format, this function can be called.

See also
mvIMPACT::acquire::PropertyS::readBinary,
mvIMPACT::acquire::PropertyS::writeBinary,
mvIMPACT::acquire::PropertyS::binaryDataBufferMaxSize
Returns
The size(in bytes) needed for the binary representation of the string buffer.
Parameters
[in]indexThe index of the value for which to query the buffer size(if this property holds more than one value).

◆ changedCounter()

unsigned int changedCounter ( void  ) const
inlineinherited

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:1321
Returns
The current changed counter of this object.

◆ changedCounterAttr()

unsigned int changedCounterAttr ( void  ) const
inlineinherited

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
inlineprotectedinherited

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

◆ dictSize()

unsigned int dictSize ( void  ) const
inlineinherited

Returns the size of the properties translation dictionary.

If the property does define a translation dictionary this function returns the number of elements contained in this dictionary.

Returns
  • The size of the properties translation dictionary.
  • 0 If this property does not define a translation dictionary.

◆ displayName()

std::string displayName ( void  ) const
inlineinherited

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
exampleHelper.h.

◆ docString()

std::string docString ( void  ) const
inlineinherited

Returns a string containing general information about the component referenced by this object.

Returns
A string containing general information about the component referenced by this object.
Examples
exampleHelper.h.

◆ firstChild()

Component firstChild ( void  ) const
inlineinherited

Moves to the first child of this component(moves down one level).

Calling this function will only succeed, if the current mvIMPACT::acquire::Component references a list.

Returns
A new mvIMPACT::acquire::Component object

◆ firstSibling()

Component firstSibling ( void  ) const
inlineinherited

Moves to the first sibling(the first feature in the current list of features).

Returns
A new mvIMPACT::acquire::Component object

◆ flags()

TComponentFlag flags ( void  ) const
inlineinherited

Returns the flags associated with this component.

Returns
The flags associated with this component.

◆ flagsAsString()

std::string flagsAsString ( const std::string &  separator = " | ") const
inlineinherited

Returns the flags associated with this component as a string.

Returns
The flags associated with this component as a string.
Parameters
[in]separatorA user definable string to separate the individual flags. The default value is ' | ' resulting in the string to look e.g. like this: 'cfWriteAccess | cfReadAccess'
Examples
exampleHelper.h.

◆ hasDict()

bool hasDict ( void  ) const
inlineinherited

Returns whether this property defines a translation dictionary or not.

Returns
  • true if this property defines a translation table
  • false otherwise
Examples
exampleHelper.h.

◆ hasMaxValue()

bool hasMaxValue ( void  ) const
inlineinherited

Checks if a maximum value is defined for this property.

Since
1.12.63
Returns
  • true if this property defines a maximum value
  • false otherwise
Examples
exampleHelper.h.

◆ hasMinValue()

bool hasMinValue ( void  ) const
inlineinherited

Checks if a minimum value is defined for this property.

Since
1.12.63
Returns
  • true if this property defines a minimum value
  • false otherwise
Examples
exampleHelper.h.

◆ hasStepWidth()

bool hasStepWidth ( void  ) const
inlineinherited

Checks if a step width is defined for this property.

Since
1.12.63
Returns
  • true if this property defines a step width
  • false otherwise
Examples
exampleHelper.h.

◆ hObj()

HOBJ hObj ( void  ) const
inlineinherited

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

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

◆ isConstDefined()

bool isConstDefined ( TPropertyLimits  constant) const
inherited

Checks if a certain constant is defined for this property(deprecated).

Deprecated:
This function has been declared deprecated and will be removed in future versions of this interface. Use mvIMPACT::acquire::Property::hasMaxValue(), mvIMPACT::acquire::Property::hasMinValue() and mvIMPACT::acquire::Property::hasStepWidth() instead and see the corresponding 'Porting existing code' section in the documentation.

Valid values for constant are defined by the enum mvIMPACT::acquire::TPropertyLimits.

Returns
  • true if this property defines this constant
  • false otherwise [in] The constant whose existence is in question

◆ isDefault()

bool isDefault ( void  ) const
inlineinherited

Checks if this component is currently referencing the default for this component.

This function will return true only for derived components that have not been modified.

Returns
  • true if the component is currently set to its default value
  • false otherwise.

◆ isList()

bool isList ( void  ) const
inlineinherited

Checks if this component is of type mvIMPACT::acquire::ComponentList.

Returns
  • true if the component references a list
  • false otherwise

◆ isMeth()

bool isMeth ( void  ) const
inlineinherited

Checks if this component is of type mvIMPACT::acquire::Method.

Returns
  • true if the component references a method
  • false otherwise

◆ isProp()

bool isProp ( void  ) const
inlineinherited

Checks if this component is of type mvIMPACT::acquire::Property or a derived type.

Returns
  • true if the component references a property
  • false otherwise

◆ isValid()

bool isValid ( void  ) const
inlineinherited

Checks if the internal component referenced by this object is still valid.

This function can be used to verify whether a referenced component is still valid or not. When e.g. referencing a driver property after mvIMPACT::acquire::Device::close has been called this function would return false. Calling any other function that tries to access the referenced component in that case would raise an exception.

Returns
  • true if this object currently references a valid component
  • false otherwise.
Examples
exampleHelper.h.

◆ isVisible()

bool isVisible ( void  ) const
inlineinherited

Checks if the component is currently shadowed due to a settings made elsewhere or not.

Settings applied to certain components might affect the behaviour of others. For example an activated automatic gain control might shadow the value written to the gain property by the user as the gain is calculated internally. In order to check if modifying the actual component will affect the behaviour of the system this function may be used. When it returns true, the mvIMPACT::acquire::Component will have an impact on the system, if false is returned, the feature might be modified, but this will currently NOT influence the acquisition process or the overall behaviour of the device or driver.

This is what is called visibility. The user still might modify or read the current mvIMPACT::acquire::Component when it's not visible however the actual data will be used only if the Component is visible (mvIMPACT::acquire::cfInvisible must NOT be set).

The visibility of a mvIMPACT::acquire::Component object will change only if other mvIMPACT::acquire::Component objects are modified and NEVER when a program runs but does not change any mvIMPACT::acquire::Component.

◆ isWriteable()

bool isWriteable ( void  ) const
inlineinherited

Checks if the caller has write/modify access to the component.

Returns
  • true if the caller is allowed to call write/modify operation for this component.
  • false otherwise.
Examples
exampleHelper.h.

◆ lastSibling()

Component lastSibling ( void  ) const
inlineinherited

Moves to the last sibling(the last feature in the current list of features).

Since
1.10.64
Returns
A new mvIMPACT::acquire::Component object

◆ maxValCount()

unsigned int maxValCount ( void  ) const
inlineinherited

Returns maximum number of values that can be managed by this property.

For the majority of properties this function will return '1', but as properties might manage more than a single value, this value might be interesting from time to time.

Returns
the maximum number of values that can be managed by this property.

◆ name()

std::string name ( void  ) const
inlineinherited

Returns the name of the component referenced by this object.

Returns
The name of the component referenced by this object.
Examples
exampleHelper.h.

◆ nextSibling()

Component nextSibling ( void  )
inlineinherited

Moves to the next sibling(the next feature in the current list of features).

Returns
A new mvIMPACT::acquire::Component object

◆ operator HOBJ()

operator HOBJ ( ) const
inlineinherited

Allows implicit conversion to a HOBJ.

◆ operator++() [1/2]

Component operator++ ( int  )
inlineinherited

Moves to the next sibling(the next feature in the current list of features).

Returns
A new mvIMPACT::acquire::Component object

◆ operator++() [2/2]

Component& operator++ ( void  )
inlineinherited

Moves to the next sibling(the next feature in the current list of features).

Returns
A self reference

◆ parent()

Component parent ( void  ) const
inlineinherited

Moves to the parent of this component(moves up one level).

Returns
A new mvIMPACT::acquire::Component object

◆ read() [1/2]

std::string read ( int  index = 0) const
inline

Reads a value from a property.

This function queries a single value stored under index index in the property.

Returns
The value stored at index within the property.
Parameters
[in]indexThe index of the value to read from the property.

◆ read() [2/2]

void read ( std::vector< std::string > &  sequence,
int  start = 0,
int  end = END_OF_LIST 
) const
inline

Reads a set of values from a property.

This function queries a set of values from a property and stores these values into sequence.

Returns
Nothing.
Parameters
[out]sequenceA reference to a container to store the data read from the property into.
[in]startThe index from where to start reading values from the property.
[in]endThe index where to stop reading values from the property.

◆ readBinary()

std::string readBinary ( int  index = 0,
bool  boLegacyMode = false 
) const
inline

Reads a value stored in the property as binary data.

Binary data can only be stored in string properties. When writing binary data to a string property it's stored in Base64 format internally. The Base64 algorithm converts arbitrary data into a read and printable string representation. As a result of this 3 bytes of arbitrary binary data will occupy 4 bytes of memory.

Reading binary data with this function obviously only makes sense if the property has been assigned the value by a previous call to mvIMPACT::acquire::PropertyS::writeBinary (here you find a small code example as well). However using this method any kind of data can be stored by a string property. This can e.g. be interesting when certain data shall be stored in the user accessible part of the devices non-volatile memory.

See also
mvIMPACT::acquire::PropertyS::writeBinary,
mvIMPACT::acquire::PropertyS::binaryDataBufferSize,
mvIMPACT::acquire::PropertyS::binaryDataBufferMaxSize
Returns
The binary data representation of the specified property value as a new std::string object.
Parameters
[in]indexThe index of the value to get(if this property holds more than one value).
[in]boLegacyModeIf set to true this allows applications compiled with mvIMPACT Acquire 2.32.0 or greater using this function to run on systems with mvIMPACT Acquire smaller than 2.32.0. The legacy version of this function runs slower!

◆ readS()

std::string readS ( int  index = 0,
const std::string &  format = "" 
) const
inlineinherited

Reads data from this property as a string.

Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT::acquire::ImpactAcquireException.
Returns
A string containing the data questioned.
Parameters
[in]indexThe index of the desired value(only necessary for properties containing more than one value)
[in]formatThe format string telling the function how to format the result. If left empty the property uses its standard way of converting its data into a string
Examples
ContinuousCapture.win32.cpp, ContinuousCaptureMultiPart.legacy.cpp, GenICamCallbackOnEvent.cpp, GenICamCommonSettingsUsage.legacy.cpp, GenICamSequencerUsageWithPaths.cpp, GenICamSequencerUsageWithPaths.legacy.cpp, and exampleHelper.h.

◆ readSArray()

std::string readSArray ( const std::string &  format = "",
const std::string &  delimiter = "",
int  startIndex = 0,
int  endIndex = INT_MAX,
int  mode = 0 
) const
inlineinherited

Reads data from this property as a string.

This function can be used to query a set of values if this property stores more than a single value which might be useful for GUI applications.

PropertyI p = getPropFromSomewhere();
p.write( 1 );
p.write( 2, 1 );
p.write( 666, 2 );
std::string s = p.readSArray( "%d", "&&:", 1 );
// now s should contain '2&&:666'
s = p.readSArray( "%4d", " ", 0, 1 );
// now s should contain ' 1, 2'
EnumPropertyI< int > PropertyI
A type for integer properties.
Definition: mvIMPACT_acquire.h:4516
Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT::acquire::ImpactAcquireException.
Returns
A string containing the data questioned.
Parameters
[in]formatThe format string telling the function how to format the result. If left empty the property uses its standard way of converting its data into a string
[in]delimiterThis string is used to separate the individual values from one another. If left empty, a single blank will separate the data.
[in]startIndexThe index of the first of the desired values
[in]endIndexThe index of the last of the desired values. If INT_MAX is passed, every from startIndex to the last value stored by the property will be returned.
[in]modeSpecifies the mode this function operates in. Currently only the LSB affects the behaviour of this function. When the LSB is set, the translation dictionary (if defined) will be ignored for this call.

◆ removeValue()

const Property& removeValue ( int  index = 0) const
inlineinherited

Removes a certain value from the property's data.

Returns
A const reference to the calling property.
Parameters
[in]indexThe index of the value to be removed

◆ representation()

TComponentRepresentation representation ( void  ) const
inlineinherited

Returns the recommended representation for this component.

The representation can be used e.g. to develop a GUI that creates convenient controls for certain features.

Valid values for this property are defined by the enumeration mvIMPACT::acquire::TComponentRepresentation.

Since
2.14.0
Returns
The recommended representation for this component.

◆ representationAsString() [1/2]

static std::string representationAsString ( TComponentRepresentation  representation)
inlinestaticinherited

Returns the recommended representation converted to a string.

Since
2.14.0
Returns
The recommended representation converted to a string.
Parameters
[in]representationThe representation to query the string representation for

◆ representationAsString() [2/2]

std::string representationAsString ( void  ) const
inlineinherited

Returns the recommended representation of the referenced component as a string.

Since
2.14.0
Returns
The recommended representation of the referenced component as a string.

◆ resizeValArray()

const Property& resizeValArray ( unsigned int  newSize) const
inlineinherited

Resizes the property's data array.

This function resizes the internal data array of this property. The size of this array represents the number of values, which can be stored within the property. This function will only succeed, if the mvIMPACT::acquire::cfFixedSize is NOT set for this property and the user has "write rights" for this property. Otherwise an exception will be thrown. Whenever the user successfully writes an array of values to a property and this array contains more elements than the current internal data array can accommodate at the desired offset the internal data array will be increased automatically.

Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT::acquire::ImpactAcquireException.
In order to be allowed to modify the number of values a property can store, the mvIMPACT::acquire::cfFixedSize flag must NOT be set.
See also
mvIMPACT::acquire::Component::isWriteable
Returns
A const reference to the calling property.
Parameters
[in]newSizeThe new number of values this property shall be allowed to store

◆ restoreDefault()

const Component& restoreDefault ( void  ) const
inlineinherited

Restores the default for the referenced component.

Calling this function will restore the default value for the component referenced by this object.

If this function is called for an object of type mvIMPACT::acquire::ComponentList every component in that list is restored to the default value.

Note
The caller must have the right to modify the component. Otherwise an exception will be thrown.
Returns
A const reference to the component.

◆ selectedFeature()

Component selectedFeature ( unsigned int  index) const
inlineinherited

Retrieves a component that is selected by the current one.

This function retrieves a component that is selected by the current one. This information is mainly useful for GUI applications that want to arrange features in a way that dependencies between features can easily been spotted.

When a component 'selects' other components, this indicates that selected components may change whenever the selecting component changes. An example for a selector might be a property defining the index within a LUT while the value of a particular LUT entry could be a selected feature. Assuming 2 properties LUTIndex and LUTValue then changing LUTIndex will invalidate and possibly change LUTValue.

C++ offers the more efficient function mvIMPACT::acquire::Component::selectedFeatures to obtain this information.

To find out how many mvIMPACT::acquire::Component objects are selected by the current one call mvIMPACT::acquire::Component::selectedFeatureCount. This value minus 1 will also be the max. value for index.

See also
mvIMPACT::acquire::Component::selectedFeatureCount,
mvIMPACT::acquire::Component::selectedFeatures
Since
1.11.20
Returns
A mvIMPACT::acquire::Component that is selected by the current one.
Parameters
[in]indexThe index for the component to query.

◆ selectedFeatureCount()

unsigned int selectedFeatureCount ( void  ) const
inlineinherited

Returns the number of features selected by the current one.

See also
mvIMPACT::acquire::Component::selectedFeatures,
mvIMPACT::acquire::Component::selectedFeature
Since
1.11.20
Returns
The number of features selected by the current one.
Examples
exampleHelper.h.

◆ selectedFeatures()

unsigned int selectedFeatures ( std::vector< Component > &  v) const
inlineinherited

Retrieves the list of components that are selected by the current one.

This function retrieves the list of components that are selected by the current one. This information is mainly useful for GUI applications that want to arrange features in a way that dependencies between features can easily been spotted.

When a component 'selects' other components, this indicates that selected components may change whenever the selecting component changes. An example for a selector might be a property defining the index within a LUT while the value of a particular LUT entry could be a selected feature. Assuming 2 properties LUTIndex and LUTValue then changing LUTIndex will invalidate and possibly change LUTValue.

See also
mvIMPACT::acquire::Component::selectedFeatureCount,
mvIMPACT::acquire::Component::selectedFeature
Since
1.11.20
Returns
The number of features selected by the current one.
Parameters
[out]vAn array that will retrieve the list of components that are selected by the current one.
Examples
exampleHelper.h.

◆ selectingFeature()

Component selectingFeature ( unsigned int  index) const
inlineinherited

Retrieves a component that is selecting the current one.

This function retrieves a component that is selecting the current one. This information is mainly useful for GUI applications that want to arrange features in a way that dependencies between features can easily been spotted.

When a component 'selects' other components, this indicates that selected components may change whenever the selecting component changes. An example for a selector might be a property defining the index within a LUT while the value of a particular LUT entry could be a selected feature. Assuming 2 properties LUTIndex and LUTValue then changing LUTIndex will invalidate and possibly change LUTValue.

C++ offers the more efficient function mvIMPACT::acquire::Component::selectingFeatures to obtain this information.

To find out how many mvIMPACT::acquire::Component objects are selecting the current one call mvIMPACT::acquire::Component::selectingFeatureCount. This value minus 1 will also be the max. value for index.

See also
mvIMPACT::acquire::Component::selectingFeatureCount,
mvIMPACT::acquire::Component::selectingFeatures
Since
1.11.20
Returns
A mvIMPACT::acquire::Component that is selecting the current one.
Parameters
[in]indexThe index for the component to query.

◆ selectingFeatureCount()

unsigned int selectingFeatureCount ( void  ) const
inlineinherited

Returns the number of features selecting the current one.

See also
mvIMPACT::acquire::Component::selectingFeatures,
mvIMPACT::acquire::Component::selectingFeature
Since
1.11.20
Returns
The number of features selecting the current one.
Examples
exampleHelper.h.

◆ selectingFeatures()

unsigned int selectingFeatures ( std::vector< Component > &  v) const
inlineinherited

Retrieves the list of components that are selecting the current one.

This function retrieves the list of components that are selecting the current one. This information is mainly useful for GUI applications that want to arrange features in a way that dependencies between features can easily been spotted.

When a component 'selects' other components, this indicates that selected components may change whenever the selecting component changes. An example for a selector might be a property defining the index within a LUT while the value of a particular LUT entry could be a selected feature. Assuming 2 properties LUTIndex and LUTValue then changing LUTIndex will invalidate and possibly change LUTValue.

See also
mvIMPACT::acquire::Component::selectingFeatureCount,
mvIMPACT::acquire::Component::selectingFeature
Since
1.11.20
Returns
The number of features selecting the current one.
Parameters
[out]vAn array that will retrieve the list of components that are selecting the current one.
Examples
exampleHelper.h.

◆ stringAllocator()

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

An internal helper function for fast string allocation.

◆ stringFormatString()

std::string stringFormatString ( void  ) const
inlineinherited

Returns the internal format string this property uses to convert data to strings.

Returns
A string containing the format string internally used by the property whenever the user reads a value as a string without specifying a format string and the property is not a string type one.

◆ type() [1/2]

static TComponentType type ( HOBJ  hObj)
inlinestaticinherited

Returns the type of the component referenced by hObj.

Returns
The type of the component referenced by hObj.
Parameters
[in]hObjThe component the type shall be retrieved for

◆ type() [2/2]

TComponentType type ( void  ) const
inlineinherited

Returns the type of the referenced component.

Returns
The type of the referenced component.
Examples
exampleHelper.h.

◆ typeAsString()

std::string typeAsString ( void  ) const
inlineinherited

Returns the type of the referenced component as a string.

Returns
The type of the referenced component as a string.
Examples
exampleHelper.h.

◆ valCount()

unsigned int valCount ( void  ) const
inlineinherited

Returns the current number of values managed by this property.

For the majority of properties this function will return '1', but as properties might manage more than a single value, this value might be interesting from time to time.

Returns
the current number of values managed by this property.
Examples
exampleHelper.h.

◆ valuesToRead()

int valuesToRead ( int  start,
int  end 
) const
inlineprotectedinherited

◆ visibility()

TComponentVisibility visibility ( void  ) const
inlineinherited

Returns the recommended visibility for this component.

The visibility can be used e.g. to develop a GUI that displays a crucial subset of features only.

Valid values for this property are defined by the enumeration mvIMPACT::acquire::TComponentVisibility.

Returns
The recommended visibility for this component.

◆ visibilityAsString() [1/2]

static std::string visibilityAsString ( TComponentVisibility  visibility)
inlinestaticinherited

Returns the recommended visibility converted to a string.

Returns
The recommended visibility converted to a string.
Parameters
[in]visibilityThe visibility to query the string representation for

◆ visibilityAsString() [2/2]

std::string visibilityAsString ( void  ) const
inlineinherited

Returns the recommended visibility of the referenced component as a string.

Returns
The recommended visibility of the referenced component as a string.

◆ write() [1/2]

const PropertyS& write ( const std::string &  value,
int  index = 0 
) const
inline

Writes one value to the property.

This function writes a single value under index index to the property.

Returns
A const 'self' reference.
Parameters
[in]valueThe value to write to the property.
[in]indexThe index defining at which position to write the value.

◆ write() [2/2]

const PropertyS& write ( const std::vector< std::string > &  sequence,
int  index = 0 
) const
inline

Writes a set of values to the property.

This function writes a set of values starting at index to the property.

Returns
A const 'self' reference.
Parameters
[in]sequenceAn array containing the values to write to the property.
[in]indexThe index where to write the first value to the property.

◆ writeBinary()

const PropertyS& writeBinary ( const std::string &  value,
int  index = 0 
) const
inline

Writes a block of binary data to one entry of the property.

Binary data can only be stored in string properties. When writing binary data to a string property it's stored in Base64 format internally. The Base64 algorithm converts arbitrary data into a read and printable string representation. As a result of this 3 bytes of arbitrary binary data will occupy 4 bytes of memory.

By writing binary data with this function arbitrary data can be stored by a string property. This can e.g. be interesting when certain data shall be stored in the user accessible part of the devices non-volatile memory.

char binData [6] = { 'A', 'B', 0x00, -128, 'E', 'F' };
const string value( binData, sizeof( binData ) / sizeof( binData[0] ) );
PropertyS prop( getHandleFromSomewhere() );
prop.writeBinary( value );
PropertyS()
Constructs a new unbound mvIMPACT::acquire::PropertyS object.
Definition: mvIMPACT_acquire.h:5080

To find out if a property contains binary data check if mvIMPACT::acquire::cfContainsBinaryData is set e.g. by calling

PropertyS prop( getHandleFromSomewhere() );
if( prop.flags() & cfContainsBinaryData )
{
// Yes!! Binary data
}
@ cfContainsBinaryData
Specifies a property, which contains binary data.
Definition: mvPropHandlingDatatypes.h:249

Performance considerations:

mvIMPACT Acquire 2.15.0 and newer:

  • Base64 encoding/decoding only is performed when read string data previously written as binary data and vice versa.
  • encoding/decoding only is performed if the 2 internal caches are out of sync. so only on the first read access using the other format.
  • this version is more efficient compared to previous implementations.
dot_inline_dotgraph_4.png

mvIMPACT Acquire versions smaller than 2.15.0

  • Base64 encoding/decoding always is performed when reading/writing data in binary format.
dot_inline_dotgraph_5.png
Note
When a property stores binary data that came from a GenICam chunk buffer additional copy operations from the GenApi runtime will take place. This can be considered as an additional copy operation into the application binary buffer. So binary chunk data should be avoided if possible!
See also
mvIMPACT::acquire::PropertyS::readBinary,
mvIMPACT::acquire::PropertyS::binaryDataBufferSize,
mvIMPACT::acquire::PropertyS::binaryDataBufferMaxSize
Returns
A const 'self' reference.
Parameters
[in]valueA const reference to the string holding the binary data that shall be stored by the this property.
[in]indexThe index defining at which position to write the value.

◆ writeS() [1/2]

const Property& writeS ( const std::string &  value,
int  index = 0 
) const
inlineinherited

Assigns a new value to this property.

The user caller have "write rights" for this property in order to be able to modify its value. Also if index is greater than the current internal data array size of this property the user must be allowed to change to size of the properties internal data array (the mvIMPACT::acquire::cfFixedSize flag must NOT be set).

Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT::acquire::ImpactAcquireException.
See also
mvIMPACT::acquire::Component::isWriteable,
mvIMPACT::acquire::Component::flags,
mvIMPACT::acquire::Property::writeS
Returns
A const reference to the calling property.
Parameters
[in]valueThe new value for this property at the given index
[in]indexThe index of the value to modify
Examples
exampleHelper.h.

◆ writeS() [2/2]

const Property& writeS ( const std::vector< std::string > &  sequence,
int  index = 0 
) const
inlineinherited

Assigns new values to this property.

The user must have "write rights" for this property in order to be able to modify its values. Also if index is greater than the current internal data array size of this property the user must be allowed to change to size of the properties internal data array (the mvIMPACT::acquire::cfFixedSize flag must NOT be set). This function behaves exactly like mvIMPACT::acquire::Property::writeS except that is can be used to assign more than one value at the same time. The parameter index here serves as an offset. If for example a property holds 3 values 'one', 'two' and 'three' before this call and the function is then called with an array containing the string 'orange' and 'blue' and index = 2 then after a successful call to this function the property will hold the data 'one', 'two', 'orange' and 'blue'.

Note
If the caller does not have the needed rights this function might throw an exception of the type mvIMPACT::acquire::ImpactAcquireException.
See also
mvIMPACT::acquire::Component::isWriteable,
mvIMPACT::acquire::Component::flags,
mvIMPACT::acquire::Property::writeS
Returns
A const reference to the calling property.
Parameters
[in]sequenceA constant reference to an array containing the strings to be assigned to the property
[in]indexThe offset from where to start to assign the values

Member Data Documentation

◆ m_hObj

HOBJ m_hObj
protectedinherited

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


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