Skip to content

pylon/Info.h#

Definition of the IProperties interface and the CInfoBase class.

Namespaces#

Name
Pylon
Contains definitions of pylon types.
Pylon::TLType
This namespace contains values for the different transport layer types.
Pylon::Key
This namespace contains keys for accessing the properties of pylon info objects.

Classes#

Name
interface Pylon::IProperties
interface for a property container
class Pylon::CInfoBase
Base implementation for PYLON info container.

Source code#

//-----------------------------------------------------------------------------
//  Basler pylon SDK
//  Copyright (c) 2006-2022 Basler AG
//  http://www.baslerweb.com
//  Author:  AH
//-----------------------------------------------------------------------------
#ifndef __INFO_H__
#define __INFO_H__

#if _MSC_VER > 1000
#pragma once
#endif

#include <pylon/Platform.h>

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

#include <pylon/stdinclude.h>
#include <pylon/PylonBase.h>

namespace Pylon
{
    interface PUBLIC_INTERFACE IProperties
    {
        virtual int GetPropertyNames( StringList_t& ) const = 0;
        virtual bool GetPropertyAvailable( const String_t& Name ) const = 0;
        virtual bool GetPropertyValue( const String_t& Name, String_t& Value ) const = 0;
        virtual IProperties& SetPropertyValue( const String_t& Name, const String_t& Value ) = 0;
        virtual bool IsSubset( const IProperties& Subset ) const = 0;

    };

    namespace TLType
    {
        const char* const TLTypeGigE = "GEV";
        const char* const TLTypeUSB = "U3V";
        const char* const TLType1394 = "IIDC";
        const char* const TLTypeCL = "CL";
        const char* const TLTypeCamEmu = "CamEmu";
        const char* const TLTypeIPCam = "IPCam";
        const char* const TLTypeCXP = "CXP";
        const char* const TLTypeCustom = "Custom";
    }

    namespace Key
    {
        const char* const FriendlyNameKey = "FriendlyName";
        const char* const FullNameKey = "FullName";
        const char* const VendorNameKey = "VendorName";
        const char* const DeviceClassKey = "DeviceClass";
        const char* const TLTypeKey = "TLType";
        const char* const InterfaceIDKey = "InterfaceID";
    }

    class CInfoImpl;

    class PYLONBASE_API CInfoBase : public IProperties
    {
    public:
        static const char* const PropertyNotAvailable;

        CInfoBase& operator=( const CInfoBase& );

        bool operator==( const CInfoBase& rhs ) const;

        bool operator < ( const CInfoBase& rhs ) const;

        /* The underlying implementation does not need to support all the listed properties.
        The properties that are not supported always have the value "N/A" which is the value of CInfoBase::PropertyNotAvailable */

        String_t GetFriendlyName() const;
        CInfoBase& SetFriendlyName( const String_t& FriendlyNameValue );
        bool IsFriendlyNameAvailable() const;

        String_t GetFullName() const;
        CInfoBase& SetFullName( const String_t& FullNameValue );
        bool IsFullNameAvailable() const;

        String_t GetVendorName() const;
        CInfoBase& SetVendorName( const String_t& VendorNameValue );
        bool IsVendorNameAvailable() const;

        String_t GetDeviceClass() const;
        CInfoBase& SetDeviceClass( const String_t& DeviceClassValue );
        bool IsDeviceClassAvailable() const;

        String_t GetTLType() const;
        CInfoBase& SetTLType( const String_t& value );
        bool IsTLTypeAvailable() const;

    public:
        static const char* GetPropertyNotAvailable();
        virtual int GetPropertyNames( StringList_t& ) const;
        virtual bool GetPropertyAvailable( const String_t& Name ) const;
        /* Returns the value of the property if this property is supported by the underlying implementation or "N/A". */
        virtual bool GetPropertyValue( const String_t& Name, String_t& Value ) const;
        virtual IProperties& SetPropertyValue( const String_t& Name, const String_t& Value );
        virtual bool IsUserProvided() const;
        virtual bool IsSubset( const IProperties& Subset ) const;

    protected:
        CInfoBase();
        CInfoBase( const CInfoBase& );
        virtual ~CInfoBase();

    protected:
        CInfoImpl* m_pImpl;
    };
}

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

#endif

Updated on 5 July 2022 at 15:30:01