VTK  9.1.0
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
33class VTKCOMMONARCHIVE_EXPORT vtkBufferedArchiver : public vtkArchiver
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
41
44 void OpenArchive() override;
46
48
51 void CloseArchive() override;
53
55
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
98protected:
101
102 struct Internal;
103 Internal* Internals;
104
105private:
107 void operator=(const vtkBufferedArchiver&) = delete;
108};
109
110#endif
Writes an archive.
Definition: vtkArchiver.h:37
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 arhive 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 arhive.
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:113
@ size
Definition: vtkX3D.h:259
@ data
Definition: vtkX3D.h:321
@ string
Definition: vtkX3D.h:496