PortImpl.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: Fritz Dierks
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_PORTIMPL_H
32 #define GENAPI_PORTIMPL_H
33 
34 #include <Base/GCException.h>
35 #include <GenApi/GenApiDll.h>
36 #include <GenApi/Types.h>
37 #include <GenApi/IPortConstruct.h>
38 #include <GenApi/IPortRecorder.h>
39 #include <GenApi/Pointer.h>
40 
41 #ifdef _MSC_VER
42 # pragma warning( push )
43 # pragma warning( disable : 4251 ) // enApi::CPortImpl::m_ptrPort' : class 'GenApi::CPointer<T>' needs to have dll-interface
44 # pragma warning( disable : 4275 ) // DLL interface (this is a bug)
45 # pragma warning( disable : 4068 ) // unknown pragma; refers to BullsEyeCoverage
46 #endif
47 
48 namespace GENAPI_NAMESPACE
49 {
50  //*************************************************************
51  // CPortImpl class
52  //*************************************************************
53 
57 
58  class CPortImpl : public IPortConstruct, public IPortReplay
59  {
60  public:
63  {
64  }
65 
67  virtual ~CPortImpl()
68  {
69  }
70 
71  /*---------------------------------------------------------------*/
72  // IBase ==> You need to override this method
73  /*---------------------------------------------------------------*/
74 
76 
77  virtual EAccessMode GetAccessMode() const = 0;
78 
79  /*---------------------------------------------------------------*/
80  // IPort ==> You need to override these methods
81  /*---------------------------------------------------------------*/
82 
84  virtual void Read(void *pBuffer, int64_t Address, int64_t Length) = 0;
85 
87  virtual void Write(const void *pBuffer, int64_t Address, int64_t Length) = 0;
88 
89  /*---------------------------------------------------------------*/
90  // IPortConstruct implementation (without IPort & IBase)
91  /*---------------------------------------------------------------*/
92 
94  virtual void SetPortImpl(IPort* pPort)
95  {
96  m_ptrPort = pPort;
97  assert(m_ptrPort.IsValid());
98  }
99 
102  {
103  return No;
104  }
105 
106 
107  //---------------------------------------------------------------
108  // IPortReplay implementation
109  //---------------------------------------------------------------
110 
112 
117  virtual void Replay( IPortWriteList *pPortRecorder, bool Invalidate = true )
118  {
119  if(pPortRecorder)
120  pPortRecorder->Replay(this);
121 
122  if(Invalidate)
123  InvalidateNode();
124  }
125 
126  // Invalidate the node
128  {
129  if(m_ptrPort.IsValid())
130  m_ptrPort->InvalidateNode();
131  }
132 
133  private:
136 
137  };
138 }
139 
140 #ifdef _MSC_VER
141 # pragma warning(pop)
142 #endif
143 #endif // ifndef GENAPI_PORTIMPL_H
virtual EAccessMode GetAccessMode() const =0
Get the access mode of the node.
Common types used in the public GenApi interface.
virtual void Read(void *pBuffer, int64_t Address, int64_t Length)=0
Reads a chunk of bytes from the port.
virtual void Replay(IPortWriteList *pPortRecorder, bool Invalidate=true)
sends the commands to the camera.
Definition: PortImpl.h:117
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortWriteList
Definition: IPortRecorder.h:45
CNodePtr m_ptrPort
Pointer to the node holding a reference to this implementation.
Definition: PortImpl.h:135
virtual ~CPortImpl()
Destructor.
Definition: PortImpl.h:67
__int64 int64_t
Definition: config-win32.h:21
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
CPortImpl()
Constructor.
Definition: PortImpl.h:62
virtual EYesNo GetSwapEndianess()
Determines if the port adapter must perform an endianess swap.
Definition: PortImpl.h:101
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortReplay
Interface for replaying write commands on a port.
Definition: IPortRecorder.h:58
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t int64_t Length
Definition: IPort.h:57
enum GENAPI_NAMESPACE::_EYesNo EYesNo
Defines the choices of a Yes/No alternatives.
Definition of interface IPort.
Definition of interface IPortConstruct.
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)=0
Writes a chunk of bytes to the port.
Definition of template CPointer.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
virtual void SetPortImpl(IPort *pPort)
Sets pointer the real port implementation; this function may called only once.
Definition: PortImpl.h:94
bool IsValid() const
true if the pointer is valid
Definition: Pointer.h:110
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
declspec&#39;s to be used for GenApi Windows dll
Standard implementation for a port !
Definition: PortImpl.h:58
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortConstruct
Interface for ports.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Invalidate
Definition: IPortRecorder.h:72
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48


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