HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfMultiPartInputFile.h
Go to the documentation of this file.
1 //
2 // SPDX-License-Identifier: BSD-3-Clause
3 // Copyright (c) Contributors to the OpenEXR Project.
4 //
5 
6 #ifndef IMFMULTIPARTINPUTFILE_H_
7 #define IMFMULTIPARTINPUTFILE_H_
8 
9 #include "ImfForward.h"
10 
11 #include "ImfGenericInputFile.h"
12 #include "ImfThreading.h"
13 
15 
16 
18 {
19  public:
21  MultiPartInputFile(const char fileName[],
22  int numThreads = globalThreadCount(),
23  bool reconstructChunkOffsetTable = true);
24 
27  int numThreads = globalThreadCount(),
28  bool reconstructChunkOffsetTable = true);
29 
31  virtual ~MultiPartInputFile();
32 
33  // ----------------------
34  // Count of number of parts in file
35  // ---------------------
37  int parts() const;
38 
39 
40  //----------------------
41  // Access to the headers
42  //----------------------
43 
45  const Header & header(int n) const;
46 
47 
48  //----------------------------------
49  // Access to the file format version
50  //----------------------------------
51 
53  int version () const;
54 
55 
56  // =----------------------------------------
57  // Check whether the entire chunk offset
58  // table for the part is written correctly
59  // -----------------------------------------
61  bool partComplete(int part) const;
62 
63 
64  // ----------------------------------------
65  // Flush internal part cache
66  // Invalidates all 'Part' types previously
67  // constructed from this file
68  // Intended for test purposes, but can be
69  // used to temporarily reduce memory overhead,
70  // or to switch between types (e.g. TiledInputPart
71  // or DeepScanLineInputPart to InputPart)
72  // ----------------------------------------
73 
75  void flushPartCache();
76  struct IMF_HIDDEN Data;
77 
78 
79  private:
80  Data* _data;
81 
82  MultiPartInputFile(const MultiPartInputFile &) = delete;
83  MultiPartInputFile& operator = (const MultiPartInputFile &) = delete;
84  MultiPartInputFile(MultiPartInputFile &&) = delete;
85  MultiPartInputFile& operator = (MultiPartInputFile &&) = delete;
86 
87 
88  //
89  // used internally by 'Part' types to access individual parts of the multipart file
90  //
91  template<class T> IMF_HIDDEN T* getInputPart(int partNumber);
92  IMF_HIDDEN InputPartData* getPart(int);
93 
94  IMF_HIDDEN void initialize();
95 
96 
97 
98 
99  friend class InputPart;
100  friend class ScanLineInputPart;
101  friend class TiledInputPart;
102  friend class DeepScanLineInputPart;
103  friend class DeepTiledInputPart;
104 
105  //
106  // For backward compatibility.
107  //
108 
109  friend class InputFile;
110  friend class TiledInputFile;
111  friend class ScanLineInputFile;
112  friend class DeepScanLineInputFile;
113  friend class DeepTiledInputFile;
114 };
115 
116 
118 
119 #endif /* IMFMULTIPARTINPUTFILE_H_ */
Definition: ImfIO.h:26
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:80
class IMF_EXPORT_TYPE MultiPartInputFile
Definition: ImfForward.h:52
#define IMF_HIDDEN
Definition: ImfExport.h:55
GLdouble n
Definition: glcorearb.h:2008
#define IMF_EXPORT
Definition: ImfExport.h:54
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
Definition: logging.h:294
GT_API const UT_StringHolder version
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMF_EXPORT int globalThreadCount()
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:79
class IMF_EXPORT_TYPE ScanLineInputFile
Definition: ImfForward.h:36
#define IMF_EXPORT_TYPE
Definition: ImfExport.h:57