IPortStacked.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2017 by Teledyne DALSA
3 // Section: Digital Imaging
4 // Project: GenAPI
5 // Author: Eric Bourbonnais
6 //
7 // License: This file is published under the license of the EMVA GenICam Standard Group.
8 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
9 // If for some reason you are missing this file please contact the EMVA or visit the website
10 // (http://www.genicam.org) for a full copy.
11 //
12 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
13 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
14 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
16 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
18 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
19 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22 // POSSIBILITY OF SUCH DAMAGE.
23 //-----------------------------------------------------------------------------
30 #ifndef GENAPI_IPORT_STACKED_H
31 #define GENAPI_IPORT_STACKED_H
32 
33 #include <Base/GCException.h>
34 #include <GenApi/GenApiDll.h>
35 #include <GenApi/Types.h>
36 #include <GenApi/IBase.h>
37 #include <GenApi/IPort.h>
38 
39 #ifdef WIN32
40 # pragma warning ( push )
41 # pragma warning ( disable : 4251 ) // XXX needs to have dll-interface to be used by clients of class YYY
42 #endif // #ifdef WIN32
43 
44 namespace GENAPI_NAMESPACE
45 {
46  //*************************************************************
47  // IPort interface
48  //*************************************************************
49 
51  {
52  uint64_t Address; /* Address of the register. */
53  void* pBuffer; /* Pointer to the buffer containing the data. */
54  size_t Size; /* Number of bytes to read write. */
56 
61  GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortStacked : virtual public IPort
62  {
63  using IPort::Write; // tell the compiler we want both Write functions (the one from the base class and the next one)
65  virtual void Write(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries) = 0;
66  };
67 
68  //*************************************************************
69  // CPortRef class
70  //*************************************************************
71 
72 #ifndef DOXYGEN_IGNORE
73 
79  template <class T>
80  class CPortStackedRefT : public CPortRefT<T>
81  {
82  typedef CPortRefT<T> ref;
83 
84  public:
85  /*--------------------------------------------------------*/
86  // IPort
87  /*--------------------------------------------------------*/
88 
90  virtual void Read(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries)
91  {
92  if(ref::m_Ptr)
93  return ref::m_Ptr->Read(pEntries, numEntries);
94  else
95  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
96  }
97 
99  virtual void Write(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries)
100  {
101  if(ref::m_Ptr)
102  return ref::m_Ptr->Write(pEntries, numEntries);
103  else
104  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
105  }
106 
107  };
108 
112 
113 #endif
114 
115 }
116 
117 #ifdef WIN32
118 # pragma warning ( pop )
119 #endif // #ifdef WIN32
120 
121 #endif // ifndef GENAPI_IPORT_H
Definition of interface IBase.
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
void * pBuffer
Definition: IPortStacked.h:53
Common types used in the public GenApi interface.
struct GENAPI_NAMESPACE::S_PORT_REGISTER_STACK_ENTRY PORT_REGISTER_STACK_ENTRY
virtual void Write(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries)=0
Writes a chunk of bytes to the port.
size_t Size
Definition: IPortStacked.h:54
uint64_t Address
Definition: IPortStacked.h:52
CPortStackedRefT< IPortStacked > CPortStackedRef
Reference to an IEnumEntry pointer.
Definition: IPortStacked.h:111
Definition: IPortStacked.h:50
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortStacked
Interface for ports.
Definition: IPortStacked.h:63
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:253
virtual void Write(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries)
Writes a chunk of bytes to the port.
Definition: IPortStacked.h:99
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
Definition of interface IPort.
virtual void Read(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries)
Reads a chunk of bytes from the port.
Definition: IPortStacked.h:90
declspec&#39;s to be used for GenApi Windows dll
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)=0
Writes a chunk of bytes to the port.
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Mar 17 2021 02:48:40