All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
94  ref::m_Ptr->Read(pEntries, numEntries);
95  }
96 
98  virtual void Write(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries)
99  {
100  if(!ref::m_Ptr)
101  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
102  ref::m_Ptr->Write(pEntries, numEntries);
103  }
104 
105  };
106 
110 
111 #endif
112 
113 }
114 
115 #ifdef WIN32
116 # pragma warning ( pop )
117 #endif // #ifdef WIN32
118 
119 #endif // ifndef GENAPI_IPORT_STACKED_H
GENAPI_NAMESPACE::CPortRefT
Definition: IPort.h:75
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
GENAPI_NAMESPACE::CPortStackedRefT::Write
virtual void Write(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries)
Writes a chunk of bytes to the port.
Definition: IPortStacked.h:98
Types.h
Common types used in the public GenApi interface.
GENAPI_NAMESPACE::S_PORT_REGISTER_STACK_ENTRY::Size
size_t Size
Definition: IPortStacked.h:54
IBase.h
Definition of interface IBase.
GENAPI_NAMESPACE::S_PORT_REGISTER_STACK_ENTRY::pBuffer
void * pBuffer
Definition: IPortStacked.h:53
GENICAM_INTERFACE
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
GENAPI_NAMESPACE::Write
virtual void Write(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries)=0
Writes a chunk of bytes to the port.
GENAPI_NAMESPACE::S_PORT_REGISTER_STACK_ENTRY
Definition: IPortStacked.h:50
GENAPI_NAMESPACE::CPortStackedRefT::Read
virtual void Read(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries)
Reads a chunk of bytes from the port.
Definition: IPortStacked.h:90
GENAPI_NAMESPACE::CPortStackedRefT::ref
CPortRefT< T > ref
Definition: IPortStacked.h:82
GENAPI_NAMESPACE::S_PORT_REGISTER_STACK_ENTRY::Address
uint64_t Address
Definition: IPortStacked.h:52
GENAPI_NAMESPACE::Write
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)=0
Writes a chunk of bytes to the port.
GENAPI_NAMESPACE::CPortStackedRef
CPortStackedRefT< IPortStacked > CPortStackedRef
Reference to an IEnumEntry pointer.
Definition: IPortStacked.h:109
GENAPI_NAMESPACE::CPortStackedRefT
Definition: IPortStacked.h:80
GENAPI_NAMESPACE::IPortStacked
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortStacked
Interface for ports.
Definition: IPortStacked.h:63
IPort.h
Definition of interface IPort.
ACCESS_EXCEPTION
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:253
GENAPI_NAMESPACE::CReferenceT< T, T >::m_Ptr
T * m_Ptr
Pointer to the implementation the reference references to.
Definition: Reference.h:101
GENAPI_NAMESPACE::IPort
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
GCException.h
GENAPI_NAMESPACE::PORT_REGISTER_STACK_ENTRY
struct GENAPI_NAMESPACE::S_PORT_REGISTER_STACK_ENTRY PORT_REGISTER_STACK_ENTRY
GenApiDll.h
declspec's to be used for GenApi Windows dll


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11