Port.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_PORT_H
32 #define GENAPI_PORT_H
33 
34 #include "../Types.h"
35 #include "../IPortConstruct.h"
36 #include "../IChunkPort.h"
37 #include "../IPortRecorder.h"
38 #include "../IString.h"
39 #include "Node.h"
40 #include "NodeT.h"
41 #include "BaseT.h"
42 
43 namespace GENAPI_NAMESPACE
44 {
45 
46  class CValueCache;
47 
48  //*************************************************************
49  // CPort class
50  //*************************************************************
51 
53 
56  public IPortConstruct,
57  public IChunkPort,
58  public IPortRecorder,
59  public CNodeImpl
60  {
61  public:
63  //constructor
65 
67  virtual ~CPortImplIntern();
68 
69  //-------------------------------------------------------------
70  // IBase implementation
71  //-------------------------------------------------------------
72 
73  protected:
75  virtual EAccessMode InternalGetAccessMode() const;
76 
79  {
80  return intfIPort;
81  }
82 
83  //-------------------------------------------------------------
84  // IPort implementation
85  //-------------------------------------------------------------
86 
87  public:
89  virtual void Read(void *pBuffer, int64_t Address, int64_t Length);
90 
92  virtual void Write(const void *pBuffer, int64_t Address, int64_t Length);
93 
94  //-------------------------------------------------------------
95  // IPortConstruct implementation
96  //-------------------------------------------------------------
97 
99  void SetPortImpl(IPort* pPort);
100 
101  //-------------------------------------------------------------
102  // IChunkPort implementation
103  //-------------------------------------------------------------
104 
106  virtual GENICAM_NAMESPACE::gcstring GetChunkID() const;
107 
109  virtual EYesNo GetSwapEndianess();
110 
112  virtual EYesNo CacheChunkData() const;
113 
114  //-------------------------------------------------------------
115  // IPortRecorder implementation
116  //-------------------------------------------------------------
117 
119  virtual void StartRecording( IPortWriteList *pPortRecorder );
120 
122  virtual void StopRecording();
123 
124  //-------------------------------------------------------------
125  // IPortReplay implementation
126  //-------------------------------------------------------------
127 
129 
134  virtual void Replay( IPortWriteList *pPortRecorder, bool Invalidate = true );
135 
136  //-------------------------------------------------------------
137  // Initializing
138  //-------------------------------------------------------------
139 
140 
141  virtual void SetProperty(CProperty &Property);
142  virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
143 
145  virtual CValueCache* GetValueCache() const;
146 
147 
148  protected:
149  //-------------------------------------------------------------
150  // Member variables
151  //-------------------------------------------------------------
152 
155 
158 
161 
164 
167 
170  };
171 
172  class CPort : public BaseT< NodeT< CPortImplIntern > >
173  {
174  };
175 
176 }
177 
178 #endif // ifndef GENAPI_PORT_H
virtual void StartRecording(IPortWriteList *pPortRecorder)
Starts logging all WriteRegister commands to a list.
EYesNo m_SwapEndianess
Determines if the port adapter must perform an endianess swap.
Definition: Port.h:166
IPort interface.
Definition: Types.h:202
CStringPolyRef m_ChunkID
The ChunkID.
Definition: Port.h:160
virtual void Replay(IPortWriteList *pPortRecorder, bool Invalidate=true)
Sends the commands to the camera.
interface GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
EYesNo m_CacheChunkData
Determines if the port adapter must cache the chunk data.
Definition: Port.h:169
CPortImplIntern()
Default constructor.
__int64 int64_t
Definition: config-win32.h:21
virtual EYesNo GetSwapEndianess()
Determines if the port adapter must perform an endianess swap.
virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const
virtual void SetProperty(CProperty &Property)
Implementation of the IBase interface.
Definition: BaseT.h:48
interface GENAPI_DECL_ABSTRACT bool Invalidate
Definition: IPortRecorder.h:72
Definition of the NodeT class template.
virtual ~CPortImplIntern()
Destructor.
IPort * m_pPort
Pointer to node giving access to the real port implementation.
Definition: Port.h:154
virtual CValueCache * GetValueCache() const
Returns the value cache.
interface GENAPI_DECL_ABSTRACT IPortRecorder
Interface for recording write commands on a port.
Definition: IPortRecorder.h:73
interface GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
enum GENAPI_NAMESPACE::_EYesNo EYesNo
Defines the choices of a Yes/No alternatives.
IPortWriteList * m_pPortWriteList
Pointer to node giving access to the real port implementation.
Definition: Port.h:157
Definition of the BaseT class template.
interface GENAPI_DECL_ABSTRACT int64_t int64_t Length
Definition: IPort.h:57
Standard IPort implementation.
Definition: Port.h:55
Standard implementation for the INode and the ISelector interface.
Definition: Node.h:85
virtual EInterfaceType InternalGetPrincipalInterfaceType() const
Implementation of IBase::GetPrincipalInterfaceType()
Definition: Port.h:78
virtual EAccessMode InternalGetAccessMode() const
Get the access mode of the node.
virtual EYesNo CacheChunkData() const
Indicates if the chunk a adapter must hold a cached version of the chunk data.
interface GENAPI_DECL_ABSTRACT IChunkPort
Interface for ports attached to a chunk.
Definition: IChunkPort.h:69
A string class which is a clone of std::string.
Definition: GCString.h:52
interface GENAPI_DECL_ABSTRACT IPortConstruct
Interface for ports.
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
GENAPI_NAMESPACE::CValueCache * m_pValueCache
Pointer the value cache.
Definition: Port.h:163
interface GENAPI_DECL_ABSTRACT IPortWriteList
Definition: IPortRecorder.h:45
Cache for Registervalues.
Definition: ValueCache.h:46
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)
Writes a chunk of bytes to the port.
virtual GENICAM_NAMESPACE::gcstring GetChunkID() const
Get the Id of the chunk the port should be attached to.
virtual void Read(void *pBuffer, int64_t Address, int64_t Length)
Reads a chunk of bytes from the port.
Part of the generic device API.
Definition: Autovector.h:48
virtual void StopRecording()
Stops recording.
void SetPortImpl(IPort *pPort)
Sets pointer the real port implementation; this function may called only once.
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
A reference to a gcstring which can be either a gcstring variable, or a pointer to an IString...


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