VTK
vtkInputStream.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkInputStream.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 vtkInputStream_h
28 #define vtkInputStream_h
29 
30 #include "vtkIOCoreModule.h" // For export macro
31 #include "vtkObject.h"
32 
33 class VTKIOCORE_EXPORT vtkInputStream : public vtkObject
34 {
35 public:
36  vtkTypeMacro(vtkInputStream,vtkObject);
37  static vtkInputStream *New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
44  vtkSetMacro(Stream, istream*);
45  vtkGetMacro(Stream, istream*);
47 
53  virtual void StartReading();
54 
59  virtual int Seek(vtkTypeInt64 offset);
60 
65  virtual size_t Read(void* data, size_t length);
66 
73  virtual void EndReading();
74 
75 protected:
77  ~vtkInputStream() override;
78 
79  // The real input stream.
80  istream* Stream;
81  size_t ReadStream(char* data, size_t length);
82 
83  // The input stream's position when StartReading was called.
84  vtkTypeInt64 StreamStartPosition;
85 
86 private:
87  vtkInputStream(const vtkInputStream&) = delete;
88  void operator=(const vtkInputStream&) = delete;
89 };
90 
91 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:39
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkTypeInt64 StreamStartPosition