GenApi  3.5.1
ChunkAdapterGeneric.h
1 //-----------------------------------------------------------------------------
2 // (c) 2006 by Leutron Vision
3 // Author: Jan Becvar
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 //-----------------------------------------------------------------------------
28 #ifndef GENAPI_CHUNKADAPTERGENERIC_H
29 #define GENAPI_CHUNKADAPTERGENERIC_H
30 
31 #include <GenApi/ChunkAdapter.h>
32 
33 namespace GENAPI_NAMESPACE
34 {
35  /* ------------------------------------------- */
36  // Single chunk info
37 
38  // make sure everything is properly packed
39  #pragma pack(push, 1)
40 
41  typedef struct SingleChunkData_t
42  {
43  uint64_t ChunkID;
44  ptrdiff_t ChunkOffset;
45  size_t ChunkLength;
46  } SingleChunkData_t;
47 
48  // the extended version holding ChunkID as string should be used only in special cases
49  // when the ChunkID does not fit into a 64-bit integer
50  typedef struct SingleChunkDataStr_t
51  {
53  ptrdiff_t ChunkOffset;
54  size_t ChunkLength;
55  } SingleChunkDataStr_t;
56 
57  // restore the previous packing
58  #pragma pack(pop)
59  /* ------------------------------------------- */
60 
61 
63  class GENAPI_DECL CChunkAdapterGeneric : public CChunkAdapter
64  {
65 
66  public:
68  CChunkAdapterGeneric(INodeMap* pNodeMap = NULL, int64_t MaxChunkCacheSize = -1);
69 
71  virtual ~CChunkAdapterGeneric();
72 
73  // Does not have implementation, use the version with EventID
74  virtual bool CheckBufferLayout(uint8_t *pBuffer, int64_t BufferLength);
75 
76  // Does not have implementation, use the generic version
77  virtual void AttachBuffer(uint8_t *pBuffer, int64_t BufferLength, AttachStatistics_t *pAttachStatistics = NULL);
78 
79  virtual void AttachBuffer(uint8_t *pBuffer, SingleChunkData_t *ChunkData, int64_t NumChunks, AttachStatistics_t *pAttachStatistics = NULL);
80 
81  virtual void AttachBuffer(uint8_t *pBuffer, SingleChunkDataStr_t *ChunkData, int64_t NumChunks, AttachStatistics_t *pAttachStatistics = NULL);
82  };
83 
84 }
85 
86 #endif // GENAPI_CHUNKADAPTERGENERIC_H
Definition: ChunkAdapter.h:43
GENICAM_INTERFACE INodeMap
Interface to access the node map.
Definition: INode.h:50
A string class which is a clone of std::string.
Definition: GCString.h:50
Declaration of the CChunkAdapter class.
Connects a generic chunked buffer to a node map.
Definition: ChunkAdapterGeneric.h:63
Connects a chunked buffer to a node map.
Definition: ChunkAdapter.h:55
Definition: ChunkAdapter.h:37