PortStackedImpl.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_PORTSTACKEDIMPL_H
31 #define GENAPI_PORTSTACKEDIMPL_H
32 
33 #include <Base/GCException.h>
34 #include <GenApi/GenApiDll.h>
35 #include <GenApi/Types.h>
36 #include <GenApi/IPortConstruct.h>
37 #include <GenApi/IPortRecorder.h>
38 #include <GenApi/Pointer.h>
39 
40 #pragma warning( push )
41 #pragma warning( disable: 4251 ) // enApi::CPortImpl::m_ptrPort' : class 'GenApi::CPointer<T>' needs to have dll-interface
42 #pragma warning ( disable : 4068 ) // unknown pragma; refers to BullsEyeCoverage
43 
44 namespace GENAPI_NAMESPACE
45 {
46 # pragma warning ( push )
47 # pragma warning ( disable : 4251 ) // DLL interface (this is a bug)
48 # pragma warning ( disable : 4275 ) // DLL interface (this is a bug)
49 
50  //*************************************************************
51  // CPortImpl class
52  //*************************************************************
53 
57 
59  {
60  public:
63  {
64  }
65 
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  // IPortStacked ==> You need to override these methods
91  /*---------------------------------------------------------------*/
92 
94  virtual void Write(PORT_REGISTER_STACK_ENTRY *pEntries, size_t numEntries) = 0;
95 
96  /*---------------------------------------------------------------*/
97  // IPortStackedConstruct implementation (without IPort & IBase)
98  /*---------------------------------------------------------------*/
99 
101  virtual void SetPortImpl(IPortStacked* pPort)
102  {
103  m_ptrPort = pPort;
104  assert(m_ptrPort.IsValid());
105  }
106 
109  {
110  return No;
111  }
112 
113 
114  //---------------------------------------------------------------
115  // IPortReplay implementation
116  //---------------------------------------------------------------
117 
119 
124  virtual void Replay( IPortWriteList *pPortRecorder, bool Invalidate = true )
125  {
126  if(pPortRecorder)
127  pPortRecorder->Replay(this);
128 
129  if(Invalidate)
130  InvalidateNode();
131  }
132 
133  // Invalidate the node
135  {
136  if(m_ptrPort.IsValid())
137  m_ptrPort->InvalidateNode();
138  }
139 
140  private:
143 
144  };
145 
146 # pragma warning ( pop )
147 }
148 
149 #pragma warning(pop)
150 #endif // ifndef GENAPI_PORTSTACKEDIMPL_H
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortStackedConstruct
Interface for ports.
Common types used in the public GenApi interface.
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)=0
Writes a chunk of bytes to the port.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortWriteList
Definition: IPortRecorder.h:45
virtual EYesNo GetSwapEndianess()
Determines if the port adapter must perform an endianess swap.
__int64 int64_t
Definition: config-win32.h:21
virtual ~CPortStackedImpl()
Destructor.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
CNodePtr m_ptrPort
Pointer to the node holding a reference to this implementation.
Definition: IPortStacked.h:50
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortStacked
Interface for ports.
Definition: IPortStacked.h:63
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.
virtual void SetPortImpl(IPortStacked *pPort)
Sets pointer the real port implementation; this function may called only once.
Standard implementation for a port !
Definition of interface IPort.
Definition of interface IPortConstruct.
virtual EAccessMode GetAccessMode() const =0
Get the access mode of the node.
Definition of template CPointer.
bool IsValid() const
true if the pointer is valid
Definition: Pointer.h:110
virtual void Replay(IPortWriteList *pPortRecorder, bool Invalidate=true)
sends the commands to the camera.
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
declspec&#39;s to be used for GenApi Windows dll
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT bool Invalidate
Definition: IPortRecorder.h:72
virtual void Read(void *pBuffer, int64_t Address, int64_t Length)=0
Reads a chunk of bytes from 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:41