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 =========================================================================*/
26 #ifndef __vtkInputStream_h
27 #define __vtkInputStream_h
28 
29 #include "vtkObject.h"
30 
32 {
33 public:
34  vtkTypeMacro(vtkInputStream,vtkObject);
35  static vtkInputStream *New();
36  void PrintSelf(ostream& os, vtkIndent indent);
37 
38  //BTX
40 
41  vtkSetMacro(Stream, istream*);
42  vtkGetMacro(Stream, istream*);
43  //ETX
45 
49  virtual void StartReading();
50 
53  virtual int Seek(unsigned long offset);
54 
56 
57  virtual unsigned long Read(unsigned char* data, unsigned long length);
58  unsigned long Read(char* data, unsigned long length);
60 
65  virtual void EndReading();
66 
67 protected:
69  ~vtkInputStream();
70 
71  // The real input stream.
72  istream* Stream;
73 
74  // The input stream's position when StartReading was called.
75  unsigned long StreamStartPosition;
76 
77 private:
78  vtkInputStream(const vtkInputStream&); // Not implemented.
79  void operator=(const vtkInputStream&); // Not implemented.
80 };
81 
82 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:60
istream * Stream
Wraps a binary input stream with a VTK interface.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_IO_EXPORT
static vtkObject * New()
unsigned long StreamStartPosition