Skip to content

Pylon::IStringEx#

Extends the GenApi::IString interface with convenience methods.

#include <pylon/StringParameter.h>

Inherits from GenApi::IString, Pylon::IValueEx, GenApi::IValue, GenApi::IBase

Inherited by Pylon::CStringParameter

Public Functions#

Name
virtual bool TrySetValue(const String_t & value) =0
Sets the value of the parameter if the parameter is writable.
virtual String_t GetValueOrDefault(const String_t & defaultValue) =0
Gets the value of the parameter if the parameter is readable.
virtual void SetValue(const GenICam::gcstring & Value, bool Verify =true) =0
Set node value.
virtual GenICam::gcstring GetValue(bool Verify =false, bool IgnoreCache =false) =0
Get node value.
virtual GenICam::gcstring operator())() =0
Get node value.
virtual GenICam::gcstring operator*() =0
Get node value.
virtual int64_t GetMaxLength() =0
Retrieves the maximum length of the string in bytes.
virtual INode * GetNode()
Get the INode interface of the node.
virtual GenICam::gcstring ToString(bool Verify =false, bool IgnoreCache =false) =0
Get content of the node as string.
virtual void FromString(const GenICam::gcstring & ValueStr, bool Verify =true) =0
Set content of the node as string.
virtual bool IsValueCacheValid() const =0
Checks if the value comes from cache or is requested from another node.
virtual EAccessMode GetAccessMode() const =0
Get the access mode of the node.
virtual bool IsReadable() const =0
Indicates whether the parameter is readable.
virtual bool IsWritable() const =0
Indicates whether the parameter is writable.
virtual bool IsValid() const =0
Indicates whether a node is attached.
virtual String_t GetInfo(EParameterInfo info) =0
Gets the parameter information.
virtual String_t GetInfoOrDefault(EParameterInfo info, const String_t defaultInfo) =0
Gets the parameter information if the parameter is attached to a node.
virtual String_t ToStringOrDefault(const String_t & defaultValue) =0
Gets the parameter value as string if the parameter is readable.

Additional inherited members#

Public Functions inherited from GenApi::IString

Name
virtual IString & operator=(const GenICam::gcstring & Value) =0
Set node value.

Public Functions inherited from GenApi::IBase

Name
virtual ~IBase() =0
Virtual destructor enforcing virtual destructor on all derived classes.

Public Functions Documentation#

function TrySetValue#

virtual bool TrySetValue(
    const String_t & value
) =0

Sets the value of the parameter if the parameter is writable.

Parameters:

  • value The string value to set.

Return: Returns false if the parameter is not writable.

Precondition:

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if the preconditions are not met or if writing the value fails.

Reimplemented by: Pylon::CStringParameter::TrySetValue

function GetValueOrDefault#

virtual String_t GetValueOrDefault(
    const String_t & defaultValue
) =0

Gets the value of the parameter if the parameter is readable.

Parameters:

  • defaultValue The default value returned if the parameter is not readable.

Return: Returns the value of the parameter if the parameter is readable. Otherwise returns the default value.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if reading the value fails.

Reimplemented by: Pylon::CStringParameter::GetValueOrDefault

Otherwise returns the default value.

function SetValue#

virtual void SetValue(
    const GenICam::gcstring & Value,
    bool Verify =true
) =0

Set node value.

Parameters:

  • Value The value to set
  • Verify Enables AccessMode and Range verification (default = true)

Reimplemented by: Pylon::CStringParameter::SetValue

function GetValue#

virtual GenICam::gcstring GetValue(
    bool Verify =false,
    bool IgnoreCache =false
) =0

Get node value.

Parameters:

  • Verify Enables Range verification (default = false). The AccessMode is always checked
  • IgnoreCache If true the value is read ignoring any caches (default = false)

Return: The value read

Reimplemented by: Pylon::CStringParameter::GetValue

function operator()#

virtual GenICam::gcstring operator()() =0

Get node value.

Reimplemented by: Pylon::CStringParameter::operator())

function operator*#

virtual GenICam::gcstring operator*() =0

Get node value.

Reimplemented by: Pylon::CStringParameter::operator*

function GetMaxLength#

virtual int64_t GetMaxLength() =0

Retrieves the maximum length of the string in bytes.

Reimplemented by: Pylon::CStringParameter::GetMaxLength

function GetNode#

inline virtual INode * GetNode()

Get the INode interface of the node.

Reimplemented by: Pylon::CArrayParameter::GetNode

function ToString#

virtual GenICam::gcstring ToString(
    bool Verify =false,
    bool IgnoreCache =false
) =0

Get content of the node as string.

Parameters:

  • Verify Enables Range verification (default = false). The AccessMode is always checked
  • IgnoreCache If true the value is read ignoring any caches (default = false)

Return: The value read

Reimplemented by: Pylon::CArrayParameter::ToString

function FromString#

virtual void FromString(
    const GenICam::gcstring & ValueStr,
    bool Verify =true
) =0

Set content of the node as string.

Parameters:

  • ValueStr The value to set
  • Verify Enables AccessMode and Range verification (default = true)

Reimplemented by: Pylon::CArrayParameter::FromString

function IsValueCacheValid#

virtual bool IsValueCacheValid() const =0

Checks if the value comes from cache or is requested from another node.

Reimplemented by: Pylon::CArrayParameter::IsValueCacheValid

function GetAccessMode#

virtual EAccessMode GetAccessMode() const =0

Get the access mode of the node.

Reimplemented by: Pylon::CArrayParameter::GetAccessMode

function IsReadable#

virtual bool IsReadable() const =0

Indicates whether the parameter is readable.

Return: Returns true if the parameter is readable.

Error Safety:

Does not throw C++ exceptions.

Reimplemented by: Pylon::CArrayParameter::IsReadable

function IsWritable#

virtual bool IsWritable() const =0

Indicates whether the parameter is writable.

Return: Returns true if the parameter is writable.

Error Safety:

Does not throw C++ exceptions.

Reimplemented by: Pylon::CArrayParameter::IsWritable

function IsValid#

virtual bool IsValid() const =0

Indicates whether a node is attached.

Return: Returns true if a node is attached.

Error Safety:

Does not throw C++ exceptions.

Reimplemented by: Pylon::CArrayParameter::IsValid, Pylon::CCommandParameter::IsValid, Pylon::CBooleanParameter::IsValid, Pylon::CStringParameter::IsValid, Pylon::CParameter::IsValid, Pylon::CEnumParameter::IsValid, Pylon::CIntegerParameter::IsValid, Pylon::CFloatParameter::IsValid

function GetInfo#

virtual String_t GetInfo(
    EParameterInfo info
) =0

Gets the parameter information.

Parameters:

  • info The type information to return.

Return: Returns the parameter information.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Throws an exception if no node is attached. Can throw exceptions if the retrieval of the information fails.

Reimplemented by: Pylon::CArrayParameter::GetInfo

function GetInfoOrDefault#

virtual String_t GetInfoOrDefault(
    EParameterInfo info,
    const String_t defaultInfo
) =0

Gets the parameter information if the parameter is attached to a node.

Parameters:

  • info The type information to return. Otherwise returns the default information. This method is useful if you want to display parameter information and handle the case that some parameters are not available for a device.
  • defaultInfo The default information returned if the parameter is not attached to a node.

Return: Returns the parameter information if the parameter is attached to a node. Otherwise returns the default information.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if the retrieval of the information fails.

Reimplemented by: Pylon::CArrayParameter::GetInfoOrDefault

See IsValid().

function ToStringOrDefault#

virtual String_t ToStringOrDefault(
    const String_t & defaultValue
) =0

Gets the parameter value as string if the parameter is readable.

Parameters:

  • defaultValue The default value returned if the parameter is not readable.

Return: Returns the parameter value if the parameter is readable. Otherwise returns the default value.

Thread Safety:

The method accesses the parameter multiple times. These accesses are not synchronized by a lock.

Error Safety:

Can throw exceptions if reading the value fails.

Reimplemented by: Pylon::CArrayParameter::ToStringOrDefault

Otherwise returns the default value.