Pylon Logo Basler Logo
Public Member Functions | List of all members
Pylon::CParameter Class Reference

CParameter class used to simplify access to GenApi parameters. More...

#include <pylon/Parameter.h>

Inheritance diagram for Pylon::CParameter:
Inheritance graph
[legend]

Public Member Functions

 CParameter ()
 Creates an empty CParameter object. More...
 
 CParameter (GenApi::INode *pNode)
 Creates a CParameter object and attaches it to a node, typically retrieved for a nodemap calling GetNode(). More...
 
 CParameter (GenApi::IValue *pValue)
 Creates a CParameter object and attaches it to a node of a matching type. More...
 
 CParameter (GenApi::INodeMap *pNodeMap, const char *pName)
 Creates a CParameter object and attaches it to a node retrieved from the provided node map. More...
 
 CParameter (GenApi::INodeMap &nodeMap, const char *pName)
 Creates a CParameter object and attaches it to a node retrieved from the provided node map. More...
 
 CParameter (const CParameter &rhs)
 Copies a CParameter object. More...
 
virtual ~CParameter ()
 Destroys the CParameter object. More...
 
virtual bool Attach (GenApi::INodeMap *pNodeMap, const char *pName)
 Attaches a node retrieved from the provided node map. More...
 
virtual bool Attach (GenApi::INodeMap &nodeMap, const char *pName)
 Attaches a node retrieved from the provided node map. More...
 
virtual bool Attach (GenApi::INode *pNode)
 Attaches a node, typically retrieved for a nodemap calling GetNode(). More...
 
virtual bool Attach (GenApi::IValue *pValue)
 Assigns a node of the same type to the parameter object. More...
 
CParameteroperator= (const CParameter &rhs)
 Assigns a CParameter object. More...
 
virtual bool Equals (const CParameter &rhs) const
 Returns true if the same nodes are attached or both parameters are empty. More...
 
virtual bool Equals (const GenApi::INode *pNode) const
 Returns true if the attached node pointer is equal. More...
 
virtual bool Equals (const GenApi::IValue *pValue) const
 Returns true if the attached node pointer is equal. More...
 
virtual void Release ()
 Releases the attached node. More...
 
virtual GenApi::EAccessMode GetAccessMode () const
 Get the access mode of the node.
 
virtual GenApi::INodeGetNode ()
 Get the INode interface of the node.
 
virtual GenICam::gcstring ToString (bool verify=false, bool ignoreCache=false)
 Get content of the node as string. More...
 
virtual void FromString (const GenICam::gcstring &valueStr, bool verify=true)
 Set content of the node as string. More...
 
virtual bool IsValueCacheValid () const
 Checks if the value comes from cache or is requested from another node.
 
virtual bool IsReadable () const
 Indicates whether the parameter is readable. More...
 
virtual bool IsWritable () const
 Indicates whether the parameter is writable. More...
 
virtual bool IsValid () const
 Indicates whether a node is attached. More...
 
virtual String_t GetInfo (EParameterInfo info)
 Gets the parameter information. More...
 
virtual String_t GetInfoOrDefault (EParameterInfo info, const String_t defaultInfo)
 Gets the parameter information if the parameter is attached to a node. More...
 
virtual String_t ToStringOrDefault (const String_t &defaultValue)
 Gets the parameter value as string if the parameter is readable. More...
 

Detailed Description

CParameter class used to simplify access to GenApi parameters.

Constructor & Destructor Documentation

Pylon::CParameter::CParameter ( )

Creates an empty CParameter object.

Error Safety:
Does not throw C++ exceptions.
Pylon::CParameter::CParameter ( GenApi::INode pNode)
explicit

Creates a CParameter object and attaches it to a node, typically retrieved for a nodemap calling GetNode().

Parameters
[in]pNodeThe node to attach.
Postcondition
  • If the passed node does not match the parameter type, the parameter will be empty, see IsValid().
  • If the passed node does match the parameter type, it is attached and the parameter object can be used to access the node's functionality.
  • The parameter object must not be used to access the node's functionality if the source of the attached pNode has been destroyed. In this case, call Release() or attach a new node.
Error Safety:
Does not throw C++ exceptions.
Pylon::CParameter::CParameter ( GenApi::IValue pValue)
explicit

Creates a CParameter object and attaches it to a node of a matching type.

Parameters
[in]pValueThe node to attach.
Postcondition
The parameter object must not be used to access the node's functionality if the source of the attached pValue has been destroyed. In this case, call Release() or attach a new node.
Error Safety:
Does not throw C++ exceptions.
Pylon::CParameter::CParameter ( GenApi::INodeMap pNodeMap,
const char *  pName 
)

Creates a CParameter object and attaches it to a node retrieved from the provided node map.

Parameters
[in]pNodeMapThe node map. The source of the parameter.
[in]pNameThe name of the parameter to attach.
Postcondition
  • If pNodeMap or name is NULL, the parameter will be empty, see IsValid().
  • If the node does not match the parameter type, the parameter will be empty, see IsValid().
  • If the node does match the parameter type, it is attached and the parameter object can be used to access the node's functionality.
  • The parameter object must not be used to access the node's functionality if the provided node map has been destroyed. In this case, call Release() or attach a new node.
Error Safety:
The call to GenApi::INodeMap::GetNode can throw C++ exceptions.
Pylon::CParameter::CParameter ( GenApi::INodeMap nodeMap,
const char *  pName 
)

Creates a CParameter object and attaches it to a node retrieved from the provided node map.

Parameters
[in]nodeMapThe node map. The source of the parameter.
[in]pNameThe name of the parameter to attach.
Postcondition
  • If name is NULL, the parameter will be empty, see IsValid().
  • If the node does not match the parameter type, the parameter will be empty, see IsValid().
  • If the node does match the parameter type, it is attached and the parameter object can be used to access the node's functionality.
  • The parameter object must not be used to access the node's functionality if the provided node map has been destroyed. In this case, call Release() or attach a new node.
Error Safety:
The call to GenApi::INodeMap::GetNode can throw C++ exceptions.
Pylon::CParameter::CParameter ( const CParameter rhs)

Copies a CParameter object.

Parameters
[in]rhsThe object to copy.
Error Safety:
Does not throw C++ exceptions.
virtual Pylon::CParameter::~CParameter ( )
virtual

Destroys the CParameter object.

Does not access the attached node.

Error Safety:
Does not throw C++ exceptions.

Member Function Documentation

virtual bool Pylon::CParameter::Attach ( GenApi::INodeMap pNodeMap,
const char *  pName 
)
virtual

Attaches a node retrieved from the provided node map.

Parameters
[in]pNodeMapThe node map. The source of the parameter.
[in]pNameThe name of the parameter to attach.
Returns
Returns true if the node has been attached.
Postcondition
  • If pNodeMap or name is NULL, the parameter will be empty, see IsValid().
  • If the node does not match the parameter type, the parameter will be empty, see IsValid().
  • If the node does match the parameter type, it is attached and the parameter object can be used to access the node's functionality.
  • The parameter object must not be used to access the node's functionality if the provided node map has been destroyed. In this case, call Release() or attach a new node.
Error Safety:
The call to GenApi::INodeMap::GetNode can throw C++ exceptions.

Reimplemented in Pylon::CFloatParameter, Pylon::CIntegerParameter, Pylon::CEnumParameter, Pylon::CStringParameter, Pylon::CBooleanParameter, Pylon::CCommandParameter, and Pylon::CArrayParameter.

virtual bool Pylon::CParameter::Attach ( GenApi::INodeMap nodeMap,
const char *  pName 
)
virtual

Attaches a node retrieved from the provided node map.

Parameters
[in]nodeMapThe node map. The source of the parameter.
[in]pNameThe name of the parameter to attach.
Returns
Returns true if the node has been attached.
Postcondition
  • If name is NULL the parameter will be empty, see IsValid().
  • If the node does not match the parameter type, the parameter will be empty, see IsValid().
  • If the node does match the parameter type, it is attached and the parameter object can be used to access the node's functionality.
  • The parameter object must not be used to access the node's functionality if the provided node map has been destroyed. In this case, call Release() or attach a new node.
Error Safety:
The call to GenApi::INodeMap::GetNode can throw C++ exceptions.

Reimplemented in Pylon::CFloatParameter, Pylon::CIntegerParameter, Pylon::CEnumParameter, Pylon::CStringParameter, Pylon::CBooleanParameter, Pylon::CCommandParameter, and Pylon::CArrayParameter.

virtual bool Pylon::CParameter::Attach ( GenApi::INode pNode)
virtual

Attaches a node, typically retrieved for a nodemap calling GetNode().

Parameters
[in]pNodeThe node to assign.
Returns
Returns true if the node has been attached.
Postcondition
  • If the node does not match the parameter type, the parameter will be empty, see IsValid().
  • If the node does match the parameter type, it is attached and the parameter object can be used to access the node's functionality.
  • The parameter object must not be used to access the node's functionality if the source of the attached pNode has been destroyed. In this case, call Release() or attach a new node.
Error Safety:
Does not throw C++ exceptions.

Reimplemented in Pylon::CFloatParameter, Pylon::CIntegerParameter, Pylon::CEnumParameter, Pylon::CStringParameter, Pylon::CBooleanParameter, Pylon::CCommandParameter, and Pylon::CArrayParameter.

virtual bool Pylon::CParameter::Attach ( GenApi::IValue pValue)
virtual

Assigns a node of the same type to the parameter object.

Parameters
[in]pValueThe node to assign.
Returns
Returns true if the node has been attached.
Error Safety:
Does not throw C++ exceptions.
virtual bool Pylon::CParameter::Equals ( const CParameter rhs) const
virtual

Returns true if the same nodes are attached or both parameters are empty.

Parameters
[in]rhsThe object to compare to.
Returns
Returns true if the same nodes are attached or both parameters are empty.
Error Safety:
Does not throw C++ exceptions.
virtual bool Pylon::CParameter::Equals ( const GenApi::INode pNode) const
virtual

Returns true if the attached node pointer is equal.

Parameters
[in]pNodeThe node to compare to.
Returns
Returns true if the attached node pointer is equal.
Error Safety:
Does not throw C++ exceptions.

Reimplemented in Pylon::CFloatParameter, Pylon::CIntegerParameter, Pylon::CEnumParameter, Pylon::CStringParameter, Pylon::CBooleanParameter, Pylon::CCommandParameter, and Pylon::CArrayParameter.

virtual bool Pylon::CParameter::Equals ( const GenApi::IValue pValue) const
virtual

Returns true if the attached node pointer is equal.

Parameters
[in]pValueThe node to compare to.
Returns
Returns true if the attached node pointer is equal.
Error Safety:
Does not throw C++ exceptions.
virtual void Pylon::CParameter::FromString ( const GenICam::gcstring ValueStr,
bool  Verify = true 
)
virtual

Set content of the node as string.

Parameters
ValueStrThe value to set
VerifyEnables AccessMode and Range verification (default = true)

Implements GenApi::IValue.

virtual String_t Pylon::CParameter::GetInfo ( EParameterInfo  info)
virtual

Gets the parameter information.

Parameters
[in]infoThe type information to return.
Returns
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.

Implements Pylon::IValueEx.

virtual String_t Pylon::CParameter::GetInfoOrDefault ( EParameterInfo  info,
const String_t  defaultInfo 
)
virtual

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

See IsValid().

Parameters
[in]infoThe 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.
Returns
Returns the parameter information if the parameter is attached to a node. Otherwise returns the default information.
Parameters
[in]defaultInfoThe default information returned if the parameter is not attached to a node.
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.

Implements Pylon::IValueEx.

virtual bool Pylon::CParameter::IsReadable ( ) const
virtual

Indicates whether the parameter is readable.

Error Safety:
Does not throw C++ exceptions.
Returns
Returns true if the parameter is readable.

Implements Pylon::IValueEx.

virtual bool Pylon::CParameter::IsValid ( ) const
virtual

Indicates whether a node is attached.

Returns
Returns true if a node is attached.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IValueEx.

Reimplemented in Pylon::CFloatParameter, Pylon::CIntegerParameter, Pylon::CEnumParameter, Pylon::CStringParameter, Pylon::CBooleanParameter, Pylon::CCommandParameter, and Pylon::CArrayParameter.

virtual bool Pylon::CParameter::IsWritable ( ) const
virtual

Indicates whether the parameter is writable.

Error Safety:
Does not throw C++ exceptions.
Returns
Returns true if the parameter is writable.

Implements Pylon::IValueEx.

CParameter& Pylon::CParameter::operator= ( const CParameter rhs)

Assigns a CParameter object.

Parameters
[in]rhsThe object to assign.
Error Safety:
Does not throw C++ exceptions.
virtual void Pylon::CParameter::Release ( )
virtual

Releases the attached node.

Error Safety:
Does not throw C++ exceptions.

Reimplemented in Pylon::CFloatParameter, Pylon::CIntegerParameter, Pylon::CEnumParameter, Pylon::CStringParameter, Pylon::CBooleanParameter, Pylon::CCommandParameter, and Pylon::CArrayParameter.

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

Get content of the node as string.

Parameters
VerifyEnables Range verification (default = false). The AccessMode is always checked
IgnoreCacheIf true the value is read ignoring any caches (default = false)
Returns
The value read

Implements GenApi::IValue.

virtual String_t Pylon::CParameter::ToStringOrDefault ( const String_t defaultValue)
virtual

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

Otherwise returns the default value.

Returns
Returns the parameter value if the parameter is readable. Otherwise returns the default value.
Parameters
[in]defaultValueThe default value returned if the parameter is not readable.
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.

Implements Pylon::IValueEx.


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

pylon 6.1.0
Copyright (c) 2006-2020 Basler AG (Mon Mar 16 2020 10:57:00)