VTK  9.3.1
vtkOutputStream.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
15 #ifndef vtkOutputStream_h
16 #define vtkOutputStream_h
17 
18 #include "vtkIOCoreModule.h" // For export macro
19 #include "vtkObject.h"
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class VTKIOCORE_EXPORT vtkOutputStream : public vtkObject
23 {
24 public:
25  vtkTypeMacro(vtkOutputStream, vtkObject);
26  static vtkOutputStream* New();
27  void PrintSelf(ostream& os, vtkIndent indent) override;
28 
30 
33  vtkSetMacro(Stream, ostream*);
34  vtkGetMacro(Stream, ostream*);
36 
42  virtual int StartWriting();
43 
47  virtual int Write(void const* data, size_t length);
48 
55  virtual int EndWriting();
56 
57 protected:
59  ~vtkOutputStream() override;
60 
61  // The real output stream.
62  ostream* Stream;
63  int WriteStream(const char* data, size_t length);
64 
65 private:
66  vtkOutputStream(const vtkOutputStream&) = delete;
67  void operator=(const vtkOutputStream&) = delete;
68 };
69 
70 VTK_ABI_NAMESPACE_END
71 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
Wraps a binary output stream with a VTK interface.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...