Skip to content

File Port.h

File List > GenApiNet > Port.h

Go to the documentation of this file

//-----------------------------------------------------------------------------
//  (c) 2007 by STEMMER IMAGING
//  Author:  Sascha Dorenbeck
//  $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.
//-----------------------------------------------------------------------------

#pragma once

#include "Node.h"

namespace Spinnaker
{
    namespace GenApi
    {
        interface IPort;
    }
}

namespace SpinnakerNET
{
    namespace GenApi
    {
#pragma region IPort Interface
        public interface class IPort
            : public SpinnakerNET::GenApi::IBase
        {
            void Read(System::IntPtr buffer, __int64 address, __int64 length);

            void Write(System::IntPtr buffer, __int64 address, __int64 length);

            void Read(__int64 address, array<System::Byte> ^buffer);

            void Write(__int64 address, array<System::Byte> ^buffer);
        };
#pragma endregion

        public ref class Port abstract
            : public SpinnakerNET::GenApi::IPort
        {
#pragma region Ctor/Dtor
            protected:
                __clrcall Port(void);

                __clrcall Port(System::IntPtr handle);

                virtual __clrcall ~Port(void);
            public:
                __clrcall !Port(void);
#pragma endregion

#pragma region Properties
            public:
                virtual property SpinnakerNET::GenApi::AccessMode AccessMode
                {
                    SpinnakerNET::GenApi::AccessMode __clrcall get(void);
                }

                virtual property System::IntPtr Handle
                {
                    System::IntPtr __clrcall get(void) sealed;
                    protected:
                    void __clrcall set(System::IntPtr handle) sealed;
                }
#pragma endregion

#pragma region Static Methods
            public:
                static Port ^ __clrcall FromHandle              (System::IntPtr handle );
#pragma endregion

#pragma region Abstract Methods
            public:
                virtual void Read(System::IntPtr buffer, __int64 address, __int64 length) abstract;

                virtual void Write(System::IntPtr buffer, __int64 address, __int64 length) abstract;

                virtual void Read(__int64 address, array<System::Byte> ^buffer) abstract;

                virtual void Write(__int64 address, array<System::Byte> ^buffer ) abstract;
#pragma endregion

#pragma region Member
            private:
                ::Spinnaker::GenApi::IPort * portHandle;

                bool managed;
#pragma endregion
        };

        public ref class IntPtrPort abstract
            : public SpinnakerNET::GenApi::Port
        {
#pragma region Overwritten Methods
            public:

                virtual void Read(__int64 address, array<System::Byte> ^buffer) override sealed;

                virtual void Write(__int64 address, array<System::Byte> ^buffer) override sealed;

#pragma endregion
        };

        public ref class ArrayPort abstract
            : public SpinnakerNET::GenApi::Port
        {
#pragma region Overwritten Methods
            public:

                virtual void Read(System::IntPtr buffer, __int64 address, __int64 length) override sealed;

                virtual void Write(System::IntPtr buffer, __int64 address, __int64 length) override sealed;

#pragma endregion
        };

        public ref class PortNode
            : public SpinnakerNET::GenApi::Node
              , public SpinnakerNET::GenApi::IPort
        {
#pragma region Ctor/Dtor
            public:
                __clrcall PortNode(SpinnakerNET::GenApi::NodeMap ^map, System::IntPtr handle);

                __clrcall PortNode(SpinnakerNET::GenApi::INode ^obj);

                __clrcall !PortNode(void);

                virtual __clrcall ~PortNode(void);
#pragma endregion

#pragma region Node Methods
            public:
                virtual void __clrcall FromString(System::String ^ value);

                virtual System::String^ __clrcall ToString(void) override;
#pragma endregion

#pragma region Port Methods
            public:
                virtual void __clrcall Read(System::IntPtr buffer, __int64 address, __int64 length) sealed;

                virtual void __clrcall Write(System::IntPtr buffer, __int64 address, __int64 length) sealed;

                virtual void __clrcall Read(__int64 address, array<System::Byte> ^buffer) sealed;

                virtual void __clrcall Write(__int64 address, array<System::Byte> ^buffer) sealed;

#pragma endregion

#pragma region Member
            private:
                ::Spinnaker::GenApi::IPort * portHandle;
#pragma endregion
        };
    }
}