EventPort.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_EVENTPORT_H
32 #define GENAPI_EVENTPORT_H
33 
34 #include <GenApi/Pointer.h>
35 #include <GenApi/IPortConstruct.h>
36 #include <GenApi/INodeMap.h>
37 
38 namespace GENAPI_NAMESPACE
39 {
40 
46  {
47 
48  public:
50  CEventPort(INode* pNode = NULL);
51 
53  ~CEventPort();
54 
55  //-------------------------------------------------------------
56  // IPortConstruct implementation
57  //-------------------------------------------------------------
58 
60  virtual EAccessMode GetAccessMode() const;
61 
64 
66  virtual void Read(void *pBuffer, int64_t Address, int64_t Length);
67 
69  virtual void Write(const void *pBuffer, int64_t Address, int64_t Length);
70 
72  virtual void SetPortImpl(GENAPI_NAMESPACE::IPort* pPort);
73 
75  virtual void SetPortImpl(GENAPI_NAMESPACE::IPortStacked* pPort);
76 
78  virtual EYesNo GetSwapEndianess();
79 
80  //---------------------------------------------------------------
81  // Implementation
82  //---------------------------------------------------------------
83 
84  // Invalidates the chunk port node
85  void InvalidateNode();
86 
87  //-------------------------------------------------------------
88  // Initializing
89  //-------------------------------------------------------------
90 
92  bool AttachNode(GENAPI_NAMESPACE::INode* pNode);
93 
95  void DetachNode();
96 
98  int GetEventIDLength();
99 
101  bool CheckEventID(uint8_t* pEventIDBuffer, int EventIDLength) const;
102 
104  bool CheckEventID(uint64_t EventID) const;
105 
107  void AttachEvent(uint8_t *pBaseAddress, int64_t Length);
108 
110  void DetachEvent();
111 
112  protected:
113 
114  CLock& GetLock() const;
115  private:
116  void ResetEventDataBuffer();
117 
118  //-------------------------------------------------------------
119  // Member variables
120  //-------------------------------------------------------------
121 
123  uint8_t *m_pEventData;
124 
127 
130 #ifdef _MSC_VER
131 # pragma warning( push )
132 # pragma warning( disable: 4251 )
133 #endif
134  CNodePtr m_ptrNode;
136 #ifdef _MSC_VER
137 # pragma warning( pop )
138 #endif
139 
142 
145 
148 
150  uint64_t m_EventIDNumber;
151 
154  };
155 
156 }
157 #endif // GENAPI_EVENTPORT_H
uint8_t * m_pEventIDBuffer
Binary version of the EventID.
Definition: EventPort.h:141
virtual void InvalidateNode()=0
Indicates that the node&#39;s value may have changed.
bool m_IsAttachedToPortNode
indicates if the object is attached to a port node or another node type
Definition: EventPort.h:147
virtual EYesNo GetSwapEndianess()=0
Determines if the port adapter must perform an endianess swap.
__int64 int64_t
Definition: config-win32.h:21
int64_t m_EventDataLength
Length of the data.
Definition: EventPort.h:126
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
int m_EventIDLength
Length of the EventID buffer.
Definition: EventPort.h:144
#define GENAPI_DECL
Definition: GenApiDll.h:55
uint8_t * m_pEventData
Pointer to the begin of the buffer.
Definition: EventPort.h:123
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortStacked
Interface for ports.
Definition: IPortStacked.h:63
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.
bool m_EventIDNumberValid
indicates if the m_EventIDNumber is valid (could be invalid eg. if the ID does not fit in 64-bit rang...
Definition: EventPort.h:153
Definition of interface INodeMap.
uint64_t m_EventIDNumber
Event ID stored as a number (for more straightforward access)
Definition: EventPort.h:150
Definition of interface IPortConstruct.
Port attachable to an event.
Definition: EventPort.h:45
Definition of template CPointer.
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
virtual EInterfaceType GetPrincipalInterfaceType() const =0
Get the type of the main interface of a node.
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
GENICAM_INTERFACE INode
Interface common to all nodes.
Definition: ICategory.h:51
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 IPortConstruct
Interface for ports.
int64_t m_EventDataAlloc
Space allocated for the data.
Definition: EventPort.h:129
Lexical analyzer for CIntSwissKnife.
Definition: Autovector.h:48
A lock class.
Definition: Synch.h:63
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
virtual CLock & GetLock() const =0
Returns the lock which guards the node map.


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