00001 //----------------------------------------------------------------------------- 00002 // (c) 2006 by Basler Vision Technologies 00003 // Section: Vision Components 00004 // Project: GenApi 00005 // Author: Fritz Dierks 00006 // $Header$ 00007 // 00008 // License: This file is published under the license of the EMVA GenICam Standard Group. 00009 // A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'. 00010 // If for some reason you are missing this file please contact the EMVA or visit the website 00011 // (http://www.genicam.org) for a full copy. 00012 // 00013 // THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS" 00014 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00015 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00016 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP 00017 // OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00018 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00019 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00020 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00021 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00022 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00023 // POSSIBILITY OF SUCH DAMAGE. 00024 //----------------------------------------------------------------------------- 00031 #ifndef GENAPI_EVENTPORT_H 00032 #define GENAPI_EVENTPORT_H 00033 00034 #include <GenApi/Pointer.h> 00035 #include <GenApi/IPortConstruct.h> 00036 #include <GenApi/INodeMap.h> 00037 00038 namespace GENAPI_NAMESPACE 00039 { 00040 00045 class GENAPI_DECL CEventPort : public IPortConstruct 00046 { 00047 00048 public: 00050 CEventPort(INode* pNode = NULL); 00051 00053 ~CEventPort(); 00054 00055 //------------------------------------------------------------- 00056 // IPortConstruct implementation 00057 //------------------------------------------------------------- 00058 00060 virtual EAccessMode GetAccessMode() const; 00061 00063 virtual EInterfaceType GetPrincipalInterfaceType() const; 00064 00066 virtual void Read(void *pBuffer, int64_t Address, int64_t Length); 00067 00069 virtual void Write(const void *pBuffer, int64_t Address, int64_t Length); 00070 00072 virtual void SetPortImpl(GENAPI_NAMESPACE::IPort* pPort); 00073 00075 virtual EYesNo GetSwapEndianess(); 00076 00077 //--------------------------------------------------------------- 00078 // Implementation 00079 //--------------------------------------------------------------- 00080 00081 // Invalidates the chunk port node 00082 void InvalidateNode(); 00083 00084 //------------------------------------------------------------- 00085 // Initializing 00086 //------------------------------------------------------------- 00087 00089 bool AttachNode(GENAPI_NAMESPACE::INode* pNode); 00090 00092 void DetachNode(); 00093 00095 int GetEventIDLength(); 00096 00098 bool CheckEventID(uint8_t* pEventIDBuffer, int EventIDLength) const; 00099 00101 bool CheckEventID(uint64_t EventID) const; 00102 00104 void AttachEvent(uint8_t *pBaseAddress, int64_t Length); 00105 00107 void DetachEvent(); 00108 00109 protected: 00110 00111 CLock& GetLock() const; 00112 private: 00113 void ResetEventDataBuffer(); 00114 00115 //------------------------------------------------------------- 00116 // Member variables 00117 //------------------------------------------------------------- 00118 00120 uint8_t *m_pEventData; 00121 00123 int64_t m_EventDataLength; 00124 00126 int64_t m_EventDataAlloc; 00127 #ifdef _MSC_VER 00128 # pragma warning( push ) 00129 # pragma warning( disable: 4251 ) 00130 #endif 00131 00132 CNodePtr m_ptrNode; 00133 #ifdef _MSC_VER 00134 # pragma warning( pop ) 00135 #endif 00136 00138 uint8_t *m_pEventIDBuffer; 00139 00141 int m_EventIDLength; 00142 00144 bool m_IsAttachedToPortNode; 00145 00147 uint64_t m_EventIDNumber; 00148 00150 bool m_EventIDNumberValid; 00151 }; 00152 00153 } 00154 #endif // GENAPI_EVENTPORT_H