VTK: Common/Archive/vtkBufferedArchiver.h Source File

| VTK 9.3.1

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:
28 static vtkBufferedArchiver* New();
29 vtkTypeMacro(vtkBufferedArchiver, vtkArchiver);
30 void PrintSelf(ostream& os, vtkIndent indent) override;
31
33
36 void OpenArchive() override;
38
40
43 void CloseArchive() override;
45
47
50 void InsertIntoArchive(
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:
91 vtkBufferedArchiver();
92 ~vtkBufferedArchiver() override;
93
94 struct Internal;
95 Internal* Internals;
96
97 private:
98 vtkBufferedArchiver(const vtkBufferedArchiver&) = delete;
99 void operator=(const vtkBufferedArchiver&) = delete;
100 };
101
102 VTK_ABI_NAMESPACE_END
103 #endif
vtkArchiver
Writes an archive.
Definition: vtkArchiver.h:29
vtkBufferedArchiver
Writes an archive to a buffer for vtk-js datasets.
Definition: vtkBufferedArchiver.h:26
vtkBufferedArchiver::SetAllocatedSize
void SetAllocatedSize(std::size_t)
Set/Get the allocated buffer size.
vtkBufferedArchiver::New
static vtkBufferedArchiver * New()
vtkBufferedArchiver::~vtkBufferedArchiver
~vtkBufferedArchiver() override
vtkBufferedArchiver::OpenArchive
void OpenArchive() override
Open the archive for writing.
vtkBufferedArchiver::InsertIntoArchive
void InsertIntoArchive(const std::string &relativePath, const char *data, std::size_t size) override
Insert data of size size into the archive at relativePath.
vtkBufferedArchiver::GetAllocatedSize
std::size_t GetAllocatedSize()
Set/Get the allocated buffer size.
vtkBufferedArchiver::GetBufferAddress
const void * GetBufferAddress()
Access the address of the buffer.
vtkBufferedArchiver::GetBuffer
const char * GetBuffer()
Access the buffer.
vtkBufferedArchiver::GetBufferSize
std::size_t GetBufferSize()
Get the buffer used size.
vtkBufferedArchiver::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBufferedArchiver::vtkBufferedArchiver
vtkBufferedArchiver()
vtkBufferedArchiver::CloseArchive
void CloseArchive() override
Close the archive.
vtkBufferedArchiver::Contains
bool Contains(const std::string &relativePath) override
Checks if relativePath represents an entry in the archive.
vtkBufferedArchiver::Internals
Internal * Internals
Definition: vtkBufferedArchiver.h:94
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkArchiver.h