Skip to content

File RegisterPortImpl.h

File List > include > SpinGenApi > RegisterPortImpl.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_REGISTERPORTIMPL_H
#define SPINNAKER_GENAPI_REGISTERPORTIMPL_H

#include "PortImpl.h"
#include "Log.h"
#include "Compatibility.h"

namespace Spinnaker
{
    namespace GenApi
    {
        //*************************************************************
        // CRegisterPortImpl class
        //*************************************************************

        class CRegisterPortImpl : public CPortImpl
        {
          public:
            CRegisterPortImpl(int MaxNumQuadlets = 1, bool TransportLayerSwapsEndianess = false){};

            virtual ~CRegisterPortImpl(){};

            //---------------------------------------------------------------
            // IBase ==> You need to override this method
            //---------------------------------------------------------------

            virtual EAccessMode GetAccessMode() const = 0;

            //---------------------------------------------------------------
            // IRegisterPort ==> You need to override these methods
            //---------------------------------------------------------------

            virtual void ReadRegister(uint32_t* pRegisters, int64_t Address, int64_t Length) = 0;

            virtual void WriteRegister(const uint32_t* pRegisters, int64_t Address, int64_t Length) = 0;

            //---------------------------------------------------------------
            // IPort
            //---------------------------------------------------------------

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

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

            //---------------------------------------------------------------
            // IPortConstruct implementation (without IPort & IBase)
            //---------------------------------------------------------------

            virtual void SetPortImpl(IPort* pPort)
            {
                m_ptrPort = pPort;
                assert(m_ptrPort.IsValid());
            };
        };

    } // namespace GenApi
} // namespace Spinnaker

#endif // ifndef SPINNAKER_GENAPI_REGISTERPORTIMPL_H