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 "vtkIOCoreModule.h" // For export macro
30 #include "vtkObject.h"
31 
33 {
34 public:
36  static vtkInputStream *New();
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
39  //BTX
41 
42  vtkSetMacro(Stream, istream*);
43  vtkGetMacro(Stream, istream*);
44  //ETX
46 
50  virtual void StartReading();
51 
54  virtual int Seek(vtkTypeInt64 offset);
55 
57  virtual size_t Read(void* data, size_t length);
58 
63  virtual void EndReading();
64 
65 protected:
68 
69  // The real input stream.
70  istream* Stream;
71  size_t ReadStream(char* data, size_t length);
72 
73  // The input stream's position when StartReading was called.
74  vtkTypeInt64 StreamStartPosition;
75 
76 private:
77  vtkInputStream(const vtkInputStream&); // Not implemented.
78  void operator=(const vtkInputStream&); // Not implemented.
79 };
80 
81 #endif
vtkInputStream::vtkInputStream
vtkInputStream()
VTKIOCORE_EXPORT
#define VTKIOCORE_EXPORT
Definition: vtkIOCoreModule.h:15
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkIOCoreModule.h
vtkInputStream::Seek
virtual int Seek(vtkTypeInt64 offset)
vtkInputStream::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkgl::length
GLuint GLsizei GLsizei * length
Definition: vtkgl.h:11992
vtkInputStream::StartReading
virtual void StartReading()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkInputStream::New
static vtkInputStream * New()
vtkgl::offset
GLintptr offset
Definition: vtkgl.h:11844
vtkInputStream::Read
virtual size_t Read(void *data, size_t length)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkObject.h
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkInputStream::~vtkInputStream
~vtkInputStream()
vtkInputStream::ReadStream
size_t ReadStream(char *data, size_t length)
vtkInputStream::StreamStartPosition
vtkTypeInt64 StreamStartPosition
Definition: vtkInputStream.h:74
vtkInputStream
Wraps a binary input stream with a VTK interface.
Definition: vtkInputStream.h:33
vtkInputStream::Stream
istream * Stream
Definition: vtkInputStream.h:70
vtkInputStream::EndReading
virtual void EndReading()