Skip to content

File EventPort.h

File List > include > SpinGenApi > EventPort.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_EVENTPORT_H
#define SPINNAKER_GENAPI_EVENTPORT_H

#include "Types.h"
#include "INodeMap.h"
#include "INode.h"
#include "IPortConstruct.h"
#include "Pointer.h"

#ifdef _WIN32
#pragma warning(push)
#pragma warning(disable : 4068) // unknown pragma; refers to BullsEyeCoverage
#pragma warning(disable : 4251) // XXX needs to have dll-interface to be used by clients of class YYY
#endif

namespace Spinnaker
{
    namespace GenApi
    {

        class PortAdapter;

        class SPINNAKER_API CEventPort : public IPortConstruct
        {

          public:
            CEventPort(INode* pNode = NULL);

            ~CEventPort();

            //-------------------------------------------------------------
            // IPortConstruct implementation
            //-------------------------------------------------------------

            virtual EAccessMode GetAccessMode() const;

            virtual EInterfaceType GetPrincipalInterfaceType() const;

            virtual void Read(void* pBuffer, int64_t Address, int64_t Length);

            virtual void Write(const void* pBuffer, int64_t Address, int64_t Length);

            virtual void SetPortImpl(::Spinnaker::GenApi::IPort* pPort);

#ifdef _WIN32
#pragma BullseyeCoverage off
#endif
            virtual EYesNo GetSwapEndianess()
            {
                return No;
            }
#ifdef _WIN32
#pragma BullseyeCoverage on
#endif

            //---------------------------------------------------------------
            // Implementation
            //---------------------------------------------------------------

            // Invalidates the chunk port node
            void InvalidateNode();

            //-------------------------------------------------------------
            // Initializing
            //-------------------------------------------------------------

            bool AttachNode(::Spinnaker::GenApi::INode* pNode);

            void DetachNode();

            int GetEventIDLength();

            bool CheckEventID(uint8_t* pEventIDBuffer, int EventIDLength);

            bool CheckEventID(uint64_t EventID);

            void AttachEvent(uint8_t* pBaseAddress, int64_t Length);

            void DetachEvent();

          protected:
            CNodePtr m_pNode;

            std::shared_ptr<PortAdapter> m_pPortAdapter;

            void* m_pEventPort;
        };

    } // namespace GenApi
} // namespace Spinnaker

#ifdef _WIN32
#pragma warning(pop)
#endif

#endif // SPINNAKER_GENAPI_EVENTPORT_H