IPort.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Basler Vision Technologies
3 // Section: Vision Components
4 // Project: GenApi
5 // Author: Margret Albrecht
6 // $Header$
7 //
8 // License: This file is published under the license of the EMVA GenICam Standard Group.
9 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
10 // If for some reason you are missing this file please contact the EMVA or visit the website
11 // (http://www.genicam.org) for a full copy.
12 //
13 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
14 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
17 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23 // POSSIBILITY OF SUCH DAMAGE.
24 //-----------------------------------------------------------------------------
31 #ifndef GENAPI_IPORT_H
32 #define GENAPI_IPORT_H
33 
34 #include <Base/GCException.h>
35 #include <GenApi/GenApiDll.h>
36 #include <GenApi/Types.h>
37 #include <GenApi/IBase.h>
38 
39 #ifdef _MSC_VER
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
43 
44 namespace GENAPI_NAMESPACE
45 {
46  //*************************************************************
47  // IPort interface
48  //*************************************************************
49 
54  interface GENAPI_DECL_ABSTRACT IPort : virtual public IBase
55  {
57  virtual void Read(void *pBuffer, int64_t Address, int64_t Length) = 0;
58 
60  virtual void Write(const void *pBuffer, int64_t Address, int64_t Length) = 0;
61  };
62 
63  //*************************************************************
64  // CPortRef class
65  //*************************************************************
66 
67 #ifndef DOXYGEN_IGNORE
68 
74  template <class T>
75  class CPortRefT : public CBaseRefT<T>
76  {
77  typedef CBaseRefT<T> ref;
78 
79  public:
80  /*--------------------------------------------------------*/
81  // IPort
82  /*--------------------------------------------------------*/
83 
85  virtual void Read(void *pBuffer, int64_t Address, int64_t Length)
86  {
87  if(ref::m_Ptr)
88  return ref::m_Ptr->Read(pBuffer, Address, Length);
89  else
90  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
91  }
92 
94  virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)
95  {
96  if(ref::m_Ptr)
97  return ref::m_Ptr->Write(pBuffer, Address, Length);
98  else
99  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
100  }
101 
102  };
103 
107 
108 #endif
109 
110 }
111 
112 #ifdef _MSC_VER
113 # pragma warning ( pop )
114 #endif
115 
116 #endif // ifndef GENAPI_IPORT_H
Definition of interface IBase.
Common types used in the public GenApi interface.
interface GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
CPortRefT< IPort > CPortRef
Reference to an IEnumEntry pointer.
Definition: IPort.h:106
__int64 int64_t
Definition: config-win32.h:21
interface GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
Definition: IBase.h:55
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:252
CBaseRefT< T > ref
Definition: IPort.h:77
interface GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)
Writes a chunk of bytes to the port.
Definition: IPort.h:94
interface GENAPI_DECL_ABSTRACT int64_t int64_t Length
Definition: IPort.h:57
virtual void Read(void *pBuffer, int64_t Address, int64_t Length)
Reads a chunk of bytes from the port.
Definition: IPort.h:85
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.
Part of the generic device API.
Definition: Autovector.h:48


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:54