Skip to content

pylon/BooleanParameter.h#

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

Namespaces#

Name
Pylon
Contains definitions of pylon types.

Classes#

Name
struct Pylon::IBooleanEx
Extends the GenApi::IBoolean interface with convenience methods.
class Pylon::CBooleanParameter
CBooleanParameter 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_CBOOLEANPARAMETER_H
#define INCLUDED_BASLER_PYLON_CBOOLEANPARAMETER_H

#pragma once

#include <pylon/PylonBase.h>
#include <GenApi/IBoolean.h>
#include <pylon/Parameter.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
{
    interface IBooleanEx : virtual public GenApi::IBoolean, virtual public IValueEx
    {
        using GenApi::IBoolean::operator=;

        virtual bool TrySetValue( bool value ) = 0;


        virtual bool GetValueOrDefault( bool defaultValue ) = 0;
    };


    class PYLONBASE_API CBooleanParameter : public IBooleanEx, public CParameter
    {
    public:
        CBooleanParameter();


        explicit CBooleanParameter( GenApi::INode* pNode );


        explicit CBooleanParameter( GenApi::IBoolean* pBoolean );


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


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


        CBooleanParameter( const CBooleanParameter& rhs );


        virtual ~CBooleanParameter();


        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::IBoolean* pBoolean );


        CBooleanParameter& operator=( const CBooleanParameter& rhs );


        virtual bool Equals( const CBooleanParameter& rhs ) const;


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


        virtual bool Equals( const GenApi::IBoolean* pBoolean ) const;


        virtual void Release();


        // Implements IValueEx
        virtual bool IsValid() const;


        // Implements GenApi::IBoolean
        virtual void SetValue( bool value, bool verify = true );

        // Implements GenApi::IBoolean
        virtual void operator=( bool value );

        // Implements GenApi::IBoolean
        virtual bool GetValue( bool verify = false, bool ignoreCache = false ) const;

        // Implements GenApi::IBoolean
        virtual bool operator()() const;


        // Implements IBooleanEx
        virtual bool TrySetValue( bool value );

        // Implements IEnumerationEx
        virtual bool GetValueOrDefault( bool defaultValue );

    protected:
        GenApi::IBoolean* m_pFeature;
    };
}
#ifdef _MSC_VER
#   pragma warning( pop )
#endif

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

#endif /* INCLUDED_BASLER_PYLON_CBOOLEANPARAMETER_H */

Updated on 5 July 2022 at 15:30:01