VTK  9.2.6
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 =========================================================================*/
29 #ifndef vtkBufferedArchiver_h
30 #define vtkBufferedArchiver_h
31 
32 #include "vtkCommonArchiveModule.h" // For export macro
33 
34 #include "vtkArchiver.h"
35 
36 class VTKCOMMONARCHIVE_EXPORT vtkBufferedArchiver : public vtkArchiver
37 {
38 public:
39  static vtkBufferedArchiver* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  void OpenArchive() override;
49 
51 
54  void CloseArchive() override;
56 
58 
61  void InsertIntoArchive(
62  const std::string& relativePath, const char* data, std::size_t size) override;
64 
66 
69  bool Contains(const std::string& relativePath) override;
71 
73 
76  const char* GetBuffer();
78 
80 
83  const void* GetBufferAddress();
85 
87 
90  void SetAllocatedSize(std::size_t);
91  std::size_t GetAllocatedSize();
93 
95 
98  std::size_t GetBufferSize();
100 
101 protected:
103  ~vtkBufferedArchiver() override;
104 
105  struct Internal;
106  Internal* Internals;
107 
108 private:
109  vtkBufferedArchiver(const vtkBufferedArchiver&) = delete;
110  void operator=(const vtkBufferedArchiver&) = delete;
111 };
112 
113 #endif
virtual void CloseArchive()
Close the archive.
Writes an archive to a buffer for vtk-js datasets.
a simple class to control print indentation
Definition: vtkIndent.h:39
Writes an archive.
Definition: vtkArchiver.h:39
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 archive 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.