Skip to content

pylon/Parameter.h#

Contains the class CParameter used to simplify access to GenApi parameters.

Namespaces#

Name
Pylon
Contains definitions of pylon types.

Classes#

Name
struct Pylon::IValueEx
Extends the GenApi::IValue interface with convenience methods.
class Pylon::CParameter
CParameter class used to simplify access to GenApi parameters.

Source code#

//------------------------------------------------------------------------------
//  Basler pylon SDK
//  Copyright (c) 2018-2022 Basler AG
//  http://www.baslerweb.com
//------------------------------------------------------------------------------
#ifndef INCLUDED_BASLER_PYLON_CPARAMETER_H
#define INCLUDED_BASLER_PYLON_CPARAMETER_H

#pragma once

#include <pylon/PylonBase.h>
#include <GenApi/IValue.h>


#ifdef _MSC_VER
#   pragma pack(push, PYLON_PACKING)
#endif /* _MSC_VER */

#ifdef _MSC_VER
#   pragma warning( push )
#   pragma warning( disable : 4275 ) // Class needs to have a dll interface to be used by clients of the class.
#   pragma warning( disable : 4250 ) // warning C4250: 'Pylon::CXYZParameter': inherits 'Pylon::CParameter::Pylon::CParameter::ZYX' via dominance
#endif

namespace Pylon
{
    enum EParameterInfo
    {
        ParameterInfo_Name,
        ParameterInfo_DisplayName,
        ParameterInfo_ToolTip,
        ParameterInfo_Description
    };


    interface IValueEx : virtual public GenApi::IValue
    {
        virtual bool IsReadable() const = 0;


        virtual bool IsWritable() const = 0;


        virtual bool IsValid() const = 0;


        virtual String_t GetInfo( EParameterInfo info ) = 0;


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


        virtual String_t ToStringOrDefault( const String_t& defaultValue ) = 0;
    };


    class PYLONBASE_API CParameter : virtual public IValueEx
    {
    public:
        CParameter();


        explicit CParameter( GenApi::INode* pNode );


        explicit CParameter( GenApi::IValue* pValue );


        CParameter( GenApi::INodeMap* pNodeMap, const char* pName );


        CParameter( GenApi::INodeMap& nodeMap, const char* pName );


        CParameter( const CParameter& rhs );


        virtual ~CParameter();


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


        virtual bool Attach( GenApi::INodeMap& nodeMap, const char* pName );


        virtual bool Attach( GenApi::INode* pNode );


        virtual bool Attach( GenApi::IValue* pValue );


        CParameter& operator=( const CParameter& rhs );


        virtual bool Equals( const CParameter& rhs ) const;


        virtual bool Equals( const GenApi::INode* pNode ) const;


        virtual bool Equals( const GenApi::IValue* pValue ) const;


        virtual void Release();





        // Implements GenApi::IBase
        virtual GenApi::EAccessMode GetAccessMode() const;

        // Implements GenApi::IValue
        virtual GenApi::INode* GetNode();

        // Implements GenApi::IValue
        virtual GenICam::gcstring ToString( bool verify = false, bool ignoreCache = false );

        // Implements GenApi::IValue
        virtual void FromString( const GenICam::gcstring& valueStr, bool verify = true );

        // Implements GenApi::IValue
        virtual bool IsValueCacheValid() const;


        // Implements IValueEx
        virtual bool IsReadable() const;

        // Implements IValueEx
        virtual bool IsWritable() const;

        // Implements IValueEx
        virtual bool IsValid() const;

        // Implements IValueEx
        virtual String_t GetInfo( EParameterInfo info );

        // Implements IValueEx
        virtual String_t GetInfoOrDefault( EParameterInfo info, const String_t defaultInfo );

        // Implements IValueEx
        virtual String_t ToStringOrDefault( const String_t& defaultValue );

    protected:
        GenApi::IValue* m_pValue;
    };
}
#ifdef _MSC_VER
#   pragma warning( pop )
#endif

#ifdef _MSC_VER
#   pragma pack(pop)
#endif /* _MSC_VER */

#endif /* INCLUDED_BASLER_PYLON_CPARAMETER_H */

Updated on 5 July 2022 at 15:30:01