Skip to content

GenApi/INode.h#

Definition of interface INode and types NodeList_t and CallbackHandleType:

Namespaces#

Name
GenApi
Contains definitions of the types of GenICam GenApi modules.

Classes#

Name
struct GenApi::INode
Interface common to all nodes.

Source code#

//-----------------------------------------------------------------------------
//  (c) 2006 by Basler Vision Technologies
//  Section: Vision Components
//  Project: GenApi
//  Author:  Fritz Dierks
//  $Header$
//
//  License: This file is published under the license of the EMVA GenICam  Standard Group.
//  A text file describing the legal terms is included in  your installation as 'GenICam_license.pdf'.
//  If for some reason you are missing  this file please contact the EMVA or visit the website
//  (http://www.genicam.org) for a full copy.
//
//  THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
//  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
//  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD  GROUP
//  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,
//  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  LIMITED TO,
//  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  DATA, OR PROFITS;
//  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  THEORY OF LIABILITY,
//  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE)
//  ARISING IN ANY WAY OUT OF THE USE  OF THIS SOFTWARE, EVEN IF ADVISED OF THE
//  POSSIBILITY OF SUCH DAMAGE.
//-----------------------------------------------------------------------------
#ifndef GENAPI_INODE_H
#define GENAPI_INODE_H

#include <Base/GCString.h>
#include <GenApi/GenApiDll.h>
#include <GenApi/Types.h>
#include <GenApi/IBase.h>
#include <GenApi/Container.h>

#include <assert.h>

#ifdef _MSC_VER
#   pragma warning ( push )
#   pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
#endif

namespace GENAPI_NAMESPACE
{

    interface INode;
    interface INodeMap;

    typedef node_vector NodeList_t;

    typedef intptr_t CallbackHandleType;

    class CNodeCallback;

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

    interface GENAPI_DECL_ABSTRACT INode : virtual public IBase
    {
        virtual GENICAM_NAMESPACE::gcstring GetName(bool FullQualified=false) const =  0;

        virtual GENAPI_NAMESPACE::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_NAMESPACE::gcstring GetToolTip() const = 0;

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

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

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

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

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


        virtual CallbackHandleType RegisterCallback( CNodeCallback *pCallback ) = 0;


        virtual bool DeregisterCallback( CallbackHandleType hCallback ) = 0;

        virtual INodeMap* GetNodeMap() const = 0;

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

        virtual bool IsStreamable() const =  0;

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


        virtual bool GetProperty(const GENICAM_NAMESPACE::gcstring& PropertyName, GENICAM_NAMESPACE::gcstring& ValueStr, GENICAM_NAMESPACE::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_NAMESPACE::gcstring GetDocuURL() const =  0;

        virtual bool IsDeprecated() const =  0;

        virtual EInterfaceType GetPrincipalInterfaceType() const = 0;

        virtual bool IsFeature() 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;
    }


}

#ifdef _MSC_VER
#   pragma warning ( pop )
#endif

#endif // ifndef GENAPI_INODE_H

Updated on 5 July 2022 at 15:30:01