All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  GENICAM_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  {
89  ref::m_Ptr->Read(pBuffer, Address, Length);
90  }
91  else
92  {
93  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
94  }
95  }
96 
98  virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)
99  {
100  if (ref::m_Ptr)
101  {
102  ref::m_Ptr->Write(pBuffer, Address, Length);
103  }
104  else
105  {
106  throw ACCESS_EXCEPTION("Feature not present (reference not valid)");
107  }
108  }
109  };
110 
114 
115 #endif
116 
117 }
118 
119 #ifdef _MSC_VER
120 # pragma warning ( pop )
121 #endif
122 
123 #endif // ifndef GENAPI_IPORT_H
GENAPI_NAMESPACE::CPortRefT
Definition: IPort.h:75
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
GENAPI_NAMESPACE::CPortRefT::Read
virtual void Read(void *pBuffer, int64_t Address, int64_t Length)
Reads a chunk of bytes from the port.
Definition: IPort.h:85
Types.h
Common types used in the public GenApi interface.
GENAPI_NAMESPACE::CPortRefT::Write
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)
Writes a chunk of bytes to the port.
Definition: IPort.h:98
IBase.h
Definition of interface IBase.
GENAPI_NAMESPACE::CPortRef
CPortRefT< IPort > CPortRef
Reference to an IEnumEntry pointer.
Definition: IPort.h:113
GENICAM_INTERFACE
#define GENICAM_INTERFACE
Definition: GenICamFwd.h:33
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::Address
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
GENAPI_NAMESPACE::Length
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t int64_t Length
Definition: IPort.h:57
GENAPI_NAMESPACE::CPortRefT::ref
CBaseRefT< T > ref
Definition: IPort.h:77
ACCESS_EXCEPTION
#define ACCESS_EXCEPTION
Fires a access exception, e.g. throw ACCESS_EXCEPTION("Not everybody")
Definition: GCException.h:253
int64_t
__int64 int64_t
Definition: config-win32.h:21
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
GENAPI_NAMESPACE::CBaseRefT
Definition: IBase.h:84
GCException.h
GenApiDll.h
declspec's to be used for GenApi Windows dll
GENAPI_NAMESPACE::IBase
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IBase
Base interface common to all nodes.
Definition: IBase.h:55


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