Skip to content

File INode.h

File List > include > SpinGenApi > INode.h

Go to the documentation of this file

//=============================================================================
// Copyright (c) 2026 FLIR Integrated Imaging Solutions, Inc. All Rights Reserved.
//
// This software is the confidential and proprietary information of FLIR
// Integrated Imaging Solutions, Inc. ("Confidential Information"). You
// shall not disclose such Confidential Information and shall use it only in
// accordance with the terms of the license agreement you entered into
// with FLIR Integrated Imaging Solutions, Inc. (FLIR).
//
// FLIR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE, OR NON-INFRINGEMENT. FLIR SHALL NOT BE LIABLE FOR ANY DAMAGES
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
// THIS SOFTWARE OR ITS DERIVATIVES.
//=============================================================================

#ifndef SPINNAKER_GENAPI_INODE_H
#define SPINNAKER_GENAPI_INODE_H

#include "SpinnakerPlatform.h"
#include "Types.h"
#include "Base.h"
#include "GCString.h"
#include "Container.h"
#include "ISelector.h"
#include "Reference.h"

#include "GCStringVector.h"
#include <assert.h>

#ifdef _WIN32
#pragma warning(push)
#pragma warning(disable : 4250) // C4250 - 'class1' : inherits 'class2::member' via dominance
#pragma warning(disable : 4251) // XXX needs to have dll-interface to be used by clients of class YYY
#pragma warning(disable : 4275) // non dll-interface structXXX used as base
#endif

namespace Spinnaker
{
    namespace GenApi
    {
        interface INode;
        interface INodeMap;

        typedef node_vector NodeList_t;

        typedef intptr_t CallbackHandleType;

        class CNodeCallback;

        //*************************************************************
        // INode interface
        //*************************************************************

        interface SPINNAKER_API_ABSTRACT INode : virtual public ISelector, virtual public IReference
        {
            virtual GenICam::gcstring GetName(bool FullQualified = false) const = 0;

            virtual GenApi::ENameSpace GetNameSpace() const = 0;

            virtual EVisibility GetVisibility() const = 0;

            virtual void InvalidateNode() = 0;

            virtual bool IsCachable() const = 0;

            virtual EYesNo IsAccessModeCacheable() const = 0;

            virtual ECachingMode GetCachingMode() const = 0;

            virtual int64_t GetPollingTime() const = 0;

            virtual GenICam::gcstring GetToolTip() const = 0;

            virtual GenICam::gcstring GetDescription() const = 0;

            virtual GenICam::gcstring GetDisplayName() const = 0;

            virtual GenICam::gcstring GetDeviceName() const = 0;

            virtual void GetChildren(GenApi::NodeList_t & Children, ELinkType LinkType = ctReadingChildren) const = 0;

            virtual void GetParents(GenApi::NodeList_t & Parents) const = 0;

            virtual void GetLockNodes(GenApi::NodeList_t & LockNodes) const = 0;

            virtual CallbackHandleType RegisterCallback(CNodeCallback * pCallback) = 0;

            virtual bool DeregisterCallback(CallbackHandleType hCallback) = 0;

            virtual INodeMap* GetNodeMap() const = 0;

            virtual GenICam::gcstring GetEventID() const = 0;

            virtual bool IsStreamable() const = 0;

            virtual void GetPropertyNames(GenICam::gcstring_vector & PropertyNames) const = 0;

            virtual bool GetProperty(
                const GenICam::gcstring& PropertyName,
                GenICam::gcstring& ValueStr,
                GenICam::gcstring& AttributeStr) = 0;

            virtual void ImposeAccessMode(EAccessMode ImposedAccessMode) = 0;

            virtual void ImposeVisibility(EVisibility ImposedVisibility) = 0;

            virtual INode* GetAlias() const = 0;

            virtual INode* GetCastAlias() const = 0;

            virtual GenICam::gcstring GetDocuURL() const = 0;

            virtual bool IsDeprecated() const = 0;

            virtual EInterfaceType GetPrincipalInterfaceType() const = 0;

            virtual bool IsFeature() const = 0;

            // helpers
            virtual bool operator==(int nullPtr) const = 0;

            virtual bool operator!=(int nullPtr) const = 0;
        };

        inline bool IsReadable(EAccessMode AccessMode)
        {
            return RO == AccessMode || RW == AccessMode;
        }

        inline bool IsReadable(const IBase* p)
        {
            return (p != NULL) && IsReadable(p->GetAccessMode());
        }

        inline bool IsReadable(const IBase& r)
        {
            return IsReadable(r.GetAccessMode());
        }

        inline bool IsWritable(EAccessMode AccessMode)
        {
            return WO == AccessMode || RW == AccessMode;
        }

        inline bool IsWritable(const IBase* p)
        {
            return (p != NULL) && IsWritable(p->GetAccessMode());
        }

        inline bool IsWritable(const IBase& r)
        {
            return IsWritable(r.GetAccessMode());
        }

        inline bool IsImplemented(EAccessMode AccessMode)
        {
            return AccessMode != NI;
        }

        inline bool IsImplemented(const IBase* p)
        {
            return (p != NULL) && IsImplemented(p->GetAccessMode());
        }

        inline bool IsImplemented(const IBase& r)
        {
            return IsImplemented(&r);
        }

        inline bool IsAvailable(EAccessMode AccessMode)
        {
            return !(AccessMode == NA || AccessMode == NI);
        }

        inline bool IsAvailable(const IBase* p)
        {
            return (p != NULL) && IsAvailable(p->GetAccessMode());
        }

        inline bool IsAvailable(const IBase& r)
        {
            return IsAvailable(r.GetAccessMode());
        }

        inline EAccessMode Combine(EAccessMode Peter, EAccessMode Paul)
        {
            assert(Peter != _UndefinedAccesMode);
            assert(Paul != _UndefinedAccesMode);

            if (Peter == NI || Paul == NI)
                return NI;
            else if (Peter == NA || Paul == NA)
                return NA;
            else if ((Peter == RO && Paul == WO) || (Peter == WO && Paul == RO))
                return NA;
            else if (Peter == WO || Paul == WO)
                return WO;
            else if (Peter == RO || Paul == RO)
                return RO;
            else
                return RW;
        }

        inline bool IsVisible(EVisibility Visibility, EVisibility MaxVisiblity)
        {
            return (Visibility <= MaxVisiblity);
        }

        inline EVisibility Combine(EVisibility Peter, EVisibility Paul)
        {
            assert(Peter != _UndefinedVisibility);
            assert(Paul != _UndefinedVisibility);

            if (Peter == Invisible || Paul == Invisible)
                return Invisible;
            else if (Peter == Guru || Paul == Guru)
                return Guru;
            else if (Peter == Expert || Paul == Expert)
                return Expert;
            else
                return Beginner;
        }

        inline bool IsCacheable(ECachingMode CachingMode)
        {
            return (CachingMode != NoCache);
        }

        inline ECachingMode Combine(ECachingMode Peter, ECachingMode Paul)
        {
            assert(Peter != _UndefinedCachingMode);
            assert(Paul != _UndefinedCachingMode);

            if (Peter == NoCache || Paul == NoCache)
                return NoCache;
            else if (Peter == WriteAround || Paul == WriteAround)
                return WriteAround;
            else
                return WriteThrough;
        }

    } // namespace GenApi
} // namespace Spinnaker

#ifdef _WIN32
#pragma warning(pop)
#endif

#endif