GenApi 3.5.1
ChunkAdapter.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// (c) 2006 by Basler Vision Technologies
3// Author: Fritz Dierks
4//
5// License: This file is published under the license of the EMVA GenICam Standard Group.
6// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
7// If for some reason you are missing this file please contact the EMVA or visit the website
8// (http://www.genicam.org) for a full copy.
9//
10// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
11// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
12// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
13// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD GROUP
14// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
15// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
17// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
18// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
19// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20// POSSIBILITY OF SUCH DAMAGE.
21//
22//-----------------------------------------------------------------------------
29#ifndef GENAPI_CHUNKADAPTER_H
30#define GENAPI_CHUNKADAPTER_H
31
32#include <GenApi/Types.h>
33#include <GenApi/INodeMap.h>
34#include <GenApi/ChunkPort.h>
35#include <vector>
36
37namespace GENAPI_NAMESPACE
38{
39
40
43 typedef struct AttachStatistics_t
44 {
48 } AttachStatistics_t;
49
50
55 class GENAPI_DECL CChunkAdapter
56 {
57
58 public:
60 virtual ~CChunkAdapter();
61 private:
62 CChunkAdapter(const CChunkAdapter&); // copy constructor is not implemented
63 CChunkAdapter& operator=(const CChunkAdapter&); // assignment operator is not implemented
64 public:
66 void AttachNodeMap(INodeMap* pNodeMap);
67
70
72
73 virtual bool CheckBufferLayout(uint8_t *pBuffer, int64_t BufferLength) = 0;
74
76
77 virtual void AttachBuffer(uint8_t *pBuffer, int64_t BufferLength, AttachStatistics_t *pAttachStatistics = NULL) = 0;
78
81
83 void UpdateBuffer(uint8_t *pBaseAddress);
84
87
88 protected:
89
91 CChunkAdapter(INodeMap* pNodeMap = NULL, int64_t MaxChunkCacheSize = -1);
92
94
95 std::vector<CChunkPort*> *m_ppChunkPorts;
96
98
100
101 };
102
103}
104
105#endif // GENAPI_CHUNKADAPTER_H
Declaration of the CChunkPort class.
virtual IBoolean & operator=(bool Value)
Set node value.
Definition IBoolean.h:62
Definition of interface INodeMap.
Common types used in the public GenApi interface.
Connects a chunked buffer to a node map.
Definition ChunkAdapter.h:56
void AttachNodeMap(INodeMap *pNodeMap)
Attaches to a node map and retrieves the chunk ports.
virtual void AttachBuffer(uint8_t *pBuffer, int64_t BufferLength, AttachStatistics_t *pAttachStatistics=NULL)=0
Attaches a buffer to the matching ChunkPort.
void ClearCaches()
Clears the chunk caches.
std::vector< CChunkPort * > * m_ppChunkPorts
An array of attached ChunkPorts.
Definition ChunkAdapter.h:95
virtual ~CChunkAdapter()
Destructor.
void DetachBuffer()
Detaches a buffer.
virtual bool CheckBufferLayout(uint8_t *pBuffer, int64_t BufferLength)=0
Checks if a buffer contains chunks in a known format.
void DetachNodeMap()
Detaches from the node map.
CChunkAdapter(INodeMap *pNodeMap=NULL, int64_t MaxChunkCacheSize=-1)
Serves as default constructor.
void UpdateBuffer(uint8_t *pBaseAddress)
Updates the base address of the buffer.
int64_t m_MaxChunkCacheSize
the maximum size of a chunk to be cached
Definition ChunkAdapter.h:99
Definition ChunkAdapter.h:44
int NumChunks
Number of chunks found in the buffer.
Definition ChunkAdapter.h:46
int NumChunkPorts
Number of chunk ports found in the node map.
Definition ChunkAdapter.h:45
int NumAttachedChunks
Number of chunks from the buffer attached to a chunk port.
Definition ChunkAdapter.h:47