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
36class VTKCOMMONARCHIVE_EXPORT vtkBufferedArchiver : public vtkArchiver
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
47 void OpenArchive() override;
49
51
54 void CloseArchive() override;
56
58
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
101protected:
104
105 struct Internal;
106 Internal* Internals;
107
108private:
110 void operator=(const vtkBufferedArchiver&) = delete;
111};
112
113#endif
Writes an archive.
Definition vtkArchiver.h:40
Writes an archive to a buffer for vtk-js datasets.
void SetAllocatedSize(std::size_t)
Set/Get the allocated buffer size.
const char * GetBuffer()
Access the buffer.
const void * GetBufferAddress()
Access the address of the buffer.
~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.
static vtkBufferedArchiver * New()
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:40