VTK  9.0.1
vtkBufferedArchiver.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBufferedArchiver.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkBufferedArchiver_h
27 #define vtkBufferedArchiver_h
28 
29 #include "vtkCommonArchiveModule.h" // For export macro
30 
31 #include "vtkArchiver.h"
32 
33 class VTKCOMMONARCHIVE_EXPORT vtkBufferedArchiver : public vtkArchiver
34 {
35 public:
36  static vtkBufferedArchiver* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
44  void OpenArchive() override;
46 
48 
51  void CloseArchive() override;
53 
55 
58  void InsertIntoArchive(
59  const std::string& relativePath, const char* data, std::size_t size) override;
61 
63 
66  bool Contains(const std::string& relativePath) override;
68 
70 
73  const char* GetBuffer();
75 
77 
80  const void* GetBufferAddress();
82 
84 
87  void SetAllocatedSize(std::size_t);
88  std::size_t GetAllocatedSize();
90 
92 
95  std::size_t GetBufferSize();
97 
98 protected:
100  ~vtkBufferedArchiver() override;
101 
102  struct Internal;
103  Internal* Internals;
104 
105 private:
106  vtkBufferedArchiver(const vtkBufferedArchiver&) = delete;
107  void operator=(const vtkBufferedArchiver&) = delete;
108 };
109 
110 #endif
virtual void CloseArchive()
Close the arhive.
Writes an archive to a buffer for vtk-js datasets.
a simple class to control print indentation
Definition: vtkIndent.h:33
Writes an archive.
Definition: vtkArchiver.h:36
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool Contains(const std::string &relativePath)
Checks if relativePath represents an entry in the archive.
virtual void OpenArchive()
Open the arhive for writing.
static vtkArchiver * New()
virtual void InsertIntoArchive(const std::string &relativePath, const char *data, std::size_t size)
Insert data of size size into the archive at relativePath.