VTK  9.3.0
vtkBufferedArchiver.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkBufferedArchiver_h
18 #define vtkBufferedArchiver_h
19 
20 #include "vtkCommonArchiveModule.h" // For export macro
21 
22 #include "vtkArchiver.h"
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class VTKCOMMONARCHIVE_EXPORT vtkBufferedArchiver : public vtkArchiver
26 {
27 public:
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
33 
36  void OpenArchive() override;
38 
40 
43  void CloseArchive() override;
45 
47 
51  const std::string& relativePath, const char* data, std::size_t size) override;
53 
55 
58  bool Contains(const std::string& relativePath) override;
60 
62 
65  const char* GetBuffer();
67 
69 
72  const void* GetBufferAddress();
74 
76 
79  void SetAllocatedSize(std::size_t);
80  std::size_t GetAllocatedSize();
82 
84 
87  std::size_t GetBufferSize();
89 
90 protected:
93 
94  struct Internal;
95  Internal* Internals;
96 
97 private:
99  void operator=(const vtkBufferedArchiver&) = delete;
100 };
101 
102 VTK_ABI_NAMESPACE_END
103 #endif
Writes an archive.
Definition: vtkArchiver.h:29
Writes an archive to a buffer for vtk-js datasets.
void SetAllocatedSize(std::size_t)
Set/Get the allocated buffer size.
static vtkBufferedArchiver * New()
~vtkBufferedArchiver() override
void OpenArchive() override
Open the archive for writing.
void InsertIntoArchive(const std::string &relativePath, const char *data, std::size_t size) override
Insert data of size size into the archive at relativePath.
std::size_t GetAllocatedSize()
Set/Get the allocated buffer size.
const void * GetBufferAddress()
Access the address of the buffer.
const char * GetBuffer()
Access the buffer.
std::size_t GetBufferSize()
Get the buffer used size.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CloseArchive() override
Close the archive.
bool Contains(const std::string &relativePath) override
Checks if relativePath represents an entry in the archive.
a simple class to control print indentation
Definition: vtkIndent.h:38
@ size
Definition: vtkX3D.h:253
@ data
Definition: vtkX3D.h:315
@ string
Definition: vtkX3D.h:490