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  private:
55  CEventPort(const CEventPort&); // copy constructor not implemented
56  CEventPort& operator =(const CEventPort&); // assignment operator is not implemented
57  public:
58  //-------------------------------------------------------------
59  // IPortConstruct implementation
60  //-------------------------------------------------------------
61 
63  virtual EAccessMode GetAccessMode() const;
64 
67 
69  virtual void Read(void *pBuffer, int64_t Address, int64_t Length);
70 
72  virtual void Write(const void *pBuffer, int64_t Address, int64_t Length);
73 
75  virtual void SetPortImpl(GENAPI_NAMESPACE::IPort* pPort);
76 
78  virtual void SetPortImpl(GENAPI_NAMESPACE::IPortStacked* pPort);
79 
81  virtual EYesNo GetSwapEndianess();
82 
83  //---------------------------------------------------------------
84  // Implementation
85  //---------------------------------------------------------------
86 
87  // Invalidates the chunk port node
88  void InvalidateNode();
89 
90  //-------------------------------------------------------------
91  // Initializing
92  //-------------------------------------------------------------
93 
95  bool AttachNode(GENAPI_NAMESPACE::INode* pNode);
96 
98  void DetachNode();
99 
101  int GetEventIDLength();
102 
104  bool CheckEventID(uint8_t* pEventIDBuffer, int EventIDLength) const;
105 
107  bool CheckEventID(uint64_t EventID) const;
108 
110  void AttachEvent(uint8_t *pBaseAddress, int64_t Length);
111 
113  void DetachEvent();
114 
115  protected:
116 
117  CLock& GetLock() const;
118  private:
119  void ResetEventDataBuffer();
120 
121  //-------------------------------------------------------------
122  // Member variables
123  //-------------------------------------------------------------
124 
126  uint8_t *m_pEventData;
127 
130 
133 #ifdef _MSC_VER
134 # pragma warning( push )
135 # pragma warning( disable: 4251 )
136 #endif
137  CNodePtr m_ptrNode;
139 #ifdef _MSC_VER
140 # pragma warning( pop )
141 #endif
142 
145 
148 
151 
153  uint64_t m_EventIDNumber;
154 
157  };
158 
159 }
160 #endif // GENAPI_EVENTPORT_H
GENAPI_NAMESPACE
Lexical analyzer for CIntSwissKnife.
Definition: Destructible.h:30
GENAPI_NAMESPACE::EAccessMode
enum GENAPI_NAMESPACE::_EAccessMode EAccessMode
access mode of a node
Pointer.h
Definition of template CPointer.
GENAPI_NAMESPACE::CEventPort::m_IsAttachedToPortNode
bool m_IsAttachedToPortNode
indicates if the object is attached to a port node or another node type
Definition: EventPort.h:150
GENAPI_NAMESPACE::CEventPort::m_EventIDNumberValid
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:156
GENAPI_NAMESPACE::CEventPort::m_EventDataLength
int64_t m_EventDataLength
Length of the data.
Definition: EventPort.h:129
GENAPI_NAMESPACE::GetPrincipalInterfaceType
virtual EInterfaceType GetPrincipalInterfaceType() const =0
Get the type of the main interface of a node.
GENAPI_NAMESPACE::GetLock
virtual CLock & GetLock() const =0
Returns the lock which guards the node map.
GENAPI_DECL
#define GENAPI_DECL
Definition: GenApiDll.h:55
GENAPI_NAMESPACE::CEventPort::m_pEventData
uint8_t * m_pEventData
Pointer to the begin of the buffer.
Definition: EventPort.h:126
GENAPI_NAMESPACE::CEventPort::m_pEventIDBuffer
uint8_t * m_pEventIDBuffer
Binary version of the EventID.
Definition: EventPort.h:144
GENAPI_NAMESPACE::Write
virtual void Write(const void *pBuffer, int64_t Address, int64_t Length)=0
Writes a chunk of bytes to the port.
INodeMap.h
Definition of interface INodeMap.
GENAPI_NAMESPACE::EInterfaceType
enum GENAPI_NAMESPACE::_EInterfaceType EInterfaceType
typedef for interface type
GENAPI_NAMESPACE::IPortStacked
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortStacked
Interface for ports.
Definition: IPortStacked.h:63
GENAPI_NAMESPACE::CEventPort
Port attachable to an event.
Definition: EventPort.h:45
GENAPI_NAMESPACE::Address
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t Address
Definition: IPort.h:57
GENAPI_NAMESPACE::Length
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT int64_t int64_t Length
Definition: IPort.h:57
GENAPI_NAMESPACE::CLock
A lock class.
Definition: Synch.h:63
GENAPI_NAMESPACE::INode
GENICAM_INTERFACE INode
Interface common to all nodes.
Definition: ICategory.h:51
GENAPI_NAMESPACE::EYesNo
enum GENAPI_NAMESPACE::_EYesNo EYesNo
Defines the choices of a Yes/No alternatives.
GENAPI_NAMESPACE::CPointer< INode >
GENAPI_NAMESPACE::InvalidateNode
virtual void InvalidateNode()=0
Indicates that the node's value may have changed.
GENAPI_NAMESPACE::GetSwapEndianess
virtual EYesNo GetSwapEndianess()=0
Determines if the port adapter must perform an endianess swap.
IPortConstruct.h
Definition of interface IPortConstruct.
int64_t
__int64 int64_t
Definition: config-win32.h:21
GENAPI_NAMESPACE::IPort
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPort
Interface for ports.
Definition: IPort.h:57
GENAPI_NAMESPACE::CEventPort::m_EventIDLength
int m_EventIDLength
Length of the EventID buffer.
Definition: EventPort.h:147
GENAPI_NAMESPACE::CEventPort::m_EventDataAlloc
int64_t m_EventDataAlloc
Space allocated for the data.
Definition: EventPort.h:132
GENAPI_NAMESPACE::CEventPort::m_EventIDNumber
uint64_t m_EventIDNumber
Event ID stored as a number (for more straightforward access)
Definition: EventPort.h:153
GENAPI_NAMESPACE::operator=
virtual IBoolean & operator=(bool Value)
Set node value.
Definition: IBoolean.h:64
GENAPI_NAMESPACE::IPortConstruct
GENICAM_INTERFACE GENAPI_DECL_ABSTRACT IPortConstruct
Interface for ports.
Definition: IPortConstruct.h:52


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:11