VTK  9.0.20210507
vtkOutputStream.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOutputStream.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 =========================================================================*/
27 #ifndef vtkOutputStream_h
28 #define vtkOutputStream_h
29 
30 #include "vtkIOCoreModule.h" // For export macro
31 #include "vtkObject.h"
32 
33 class VTKIOCORE_EXPORT vtkOutputStream : public vtkObject
34 {
35 public:
36  vtkTypeMacro(vtkOutputStream, vtkObject);
37  static vtkOutputStream* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
44  vtkSetMacro(Stream, ostream*);
45  vtkGetMacro(Stream, ostream*);
47 
53  virtual int StartWriting();
54 
58  virtual int Write(void const* data, size_t length);
59 
66  virtual int EndWriting();
67 
68 protected:
70  ~vtkOutputStream() override;
71 
72  // The real output stream.
73  ostream* Stream;
74  int WriteStream(const char* data, size_t length);
75 
76 private:
77  vtkOutputStream(const vtkOutputStream&) = delete;
78  void operator=(const vtkOutputStream&) = delete;
79 };
80 
81 #endif
vtkOutputStream::vtkOutputStream
vtkOutputStream()
vtkX3D::data
@ data
Definition: vtkX3D.h:321
vtkOutputStream::StartWriting
virtual int StartWriting()
Called after the stream position has been set by the caller, but before any Write calls.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:63
vtkX3D::length
@ length
Definition: vtkX3D.h:399
vtkOutputStream::Write
virtual int Write(void const *data, size_t length)
Write output data of the given length.
vtkOutputStream::Stream
ostream * Stream
Definition: vtkOutputStream.h:73
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkOutputStream::New
static vtkOutputStream * New()
vtkObject.h
vtkOutputStream::EndWriting
virtual int EndWriting()
Called after all desired calls to Write have been made.
vtkOutputStream::WriteStream
int WriteStream(const char *data, size_t length)
vtkOutputStream
Wraps a binary output stream with a VTK interface.
Definition: vtkOutputStream.h:34
vtkOutputStream::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOutputStream::~vtkOutputStream
~vtkOutputStream() override