Skip to content

pylon/StringParameter.h#

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

Namespaces#

Name
Pylon
Contains definitions of pylon types.

Classes#

Name
struct Pylon::IStringEx
Extends the GenApi::IString interface with convenience methods.
class Pylon::CStringParameter
CStringParameter 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_CSTRINGPARAMETER_H
#define INCLUDED_BASLER_PYLON_CSTRINGPARAMETER_H

#pragma once

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

        virtual bool TrySetValue( const String_t& value ) = 0;


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


    class PYLONBASE_API CStringParameter : public IStringEx, public CParameter
    {
    public:
        CStringParameter();


        explicit CStringParameter( GenApi::INode* pNode );


        explicit CStringParameter( GenApi::IString* pString );


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


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


        CStringParameter( const CStringParameter& rhs );


        virtual ~CStringParameter();


        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::IString* pString );


        CStringParameter& operator=( const CStringParameter& rhs );


        virtual bool Equals( const CStringParameter& rhs ) const;


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


        virtual bool Equals( const GenApi::IString* pString ) const;


        virtual void Release();


        // Implements IValueEx
        virtual bool IsValid() const;


        // Implements GenApi::IString
        virtual void SetValue( const GenICam::gcstring& value, bool verify = true );

        // Implements GenApi::IString
        virtual GenApi::IString& operator=( const GenICam::gcstring& value );

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

        // Implements GenApi::IString
        virtual GenICam::gcstring operator()();

        // Implements GenApi::IString
        virtual GenICam::gcstring operator*();

        // Implements GenApi::IString
        virtual int64_t GetMaxLength();


        // Implements IStringEx
        virtual bool TrySetValue( const String_t& value );

        // Implements IStringEx
        virtual String_t GetValueOrDefault( const String_t& defaultValue );

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

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

#endif /* INCLUDED_BASLER_PYLON_CSTRINGPARAMETER_H */

Updated on 5 July 2022 at 15:30:01