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 EYesNo GetSwapEndianess();
76 
77  //---------------------------------------------------------------
78  // Implementation
79  //---------------------------------------------------------------
80 
81  // Invalidates the chunk port node
82  void InvalidateNode();
83 
84  //-------------------------------------------------------------
85  // Initializing
86  //-------------------------------------------------------------
87 
89  bool AttachNode(GENAPI_NAMESPACE::INode* pNode);
90 
92  void DetachNode();
93 
95  int GetEventIDLength();
96 
98  bool CheckEventID(uint8_t* pEventIDBuffer, int EventIDLength) const;
99 
101  bool CheckEventID(uint64_t EventID) const;
102 
104  void AttachEvent(uint8_t *pBaseAddress, int64_t Length);
105 
107  void DetachEvent();
108 
109  protected:
110 
111  CLock& GetLock() const;
112  private:
113  void ResetEventDataBuffer();
114 
115  //-------------------------------------------------------------
116  // Member variables
117  //-------------------------------------------------------------
118 
120  uint8_t *m_pEventData;
121 
124 
127 #ifdef _MSC_VER
128 # pragma warning( push )
129 # pragma warning( disable: 4251 )
130 #endif
131  CNodePtr m_ptrNode;
133 #ifdef _MSC_VER
134 # pragma warning( pop )
135 #endif
136 
139 
142 
145 
147  uint64_t m_EventIDNumber;
148 
151  };
152 
153 }
154 #endif // GENAPI_EVENTPORT_H
uint8_t * m_pEventIDBuffer
Binary version of the EventID.
Definition: EventPort.h:138
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:144
interface GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
__int64 int64_t
Definition: config-win32.h:21
int64_t m_EventDataLength
Length of the data.
Definition: EventPort.h:123
int m_EventIDLength
Length of the EventID buffer.
Definition: EventPort.h:141
#define GENAPI_DECL
Definition: GenApiDll.h:55
uint8_t * m_pEventData
Pointer to the begin of the buffer.
Definition: EventPort.h:120
interface GENAPI_DECL_ABSTRACT int64_t Address
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:150
Definition of interface INodeMap.
uint64_t m_EventIDNumber
Event ID stored as a number (for more straightforward access)
Definition: EventPort.h:147
Definition of interface IPortConstruct.
interface GENAPI_DECL_ABSTRACT int64_t int64_t Length
Definition: IPort.h:57
Port attachable to an event.
Definition: EventPort.h:45
Definition of template CPointer.
interface GENAPI_DECL_ABSTRACT IPortConstruct
Interface for ports.
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
virtual EYesNo GetSwapEndianess()=0
Determines if the port adapter must perform an endianess swap.
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)=0
Writes a chunk of bytes to the port.
interface GENAPI_DECL_ABSTRACT INode
Interface common to all nodes.
Definition: INode.h:60
int64_t m_EventDataAlloc
Space allocated for the data.
Definition: EventPort.h:126
Part of the generic device API.
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 Thu Jun 6 2019 19:10:54