VTK  9.3.1
vtkInputStream.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 vtkInputStream_h
16 #define vtkInputStream_h
17 
18 #include "vtkIOCoreModule.h" // For export macro
19 #include "vtkObject.h"
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class VTKIOCORE_EXPORT vtkInputStream : public vtkObject
23 {
24 public:
25  vtkTypeMacro(vtkInputStream, vtkObject);
26  static vtkInputStream* New();
27  void PrintSelf(ostream& os, vtkIndent indent) override;
28 
30 
33  vtkSetMacro(Stream, istream*);
34  vtkGetMacro(Stream, istream*);
36 
42  virtual void StartReading();
43 
48  virtual int Seek(vtkTypeInt64 offset);
49 
54  virtual size_t Read(void* data, size_t length);
55 
62  virtual void EndReading();
63 
64 protected:
66  ~vtkInputStream() override;
67 
68  // The real input stream.
69  istream* Stream;
70  size_t ReadStream(char* data, size_t length);
71 
72  // The input stream's position when StartReading was called.
73  vtkTypeInt64 StreamStartPosition;
74 
75 private:
76  vtkInputStream(const vtkInputStream&) = delete;
77  void operator=(const vtkInputStream&) = delete;
78 };
79 
80 VTK_ABI_NAMESPACE_END
81 #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.
istream * Stream
Wraps a binary input stream with a VTK interface.
a simple class to control print indentation
Definition: vtkIndent.h:28
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkTypeInt64 StreamStartPosition