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);
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:
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&) VTK_DELETE_FUNCTION;
88  void operator=(const vtkInputStream&) VTK_DELETE_FUNCTION;
89 };
90 
91 #endif
vtkInputStream::vtkInputStream
vtkInputStream()
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkInputStream::Seek
virtual int Seek(vtkTypeInt64 offset)
Seek to the given offset in the input data.
vtkInputStream::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkX3D::length
@ length
Definition: vtkX3D.h:393
vtkX3D::offset
@ offset
Definition: vtkX3D.h:438
vtkInputStream::StartReading
virtual void StartReading()
Called after the stream position has been set by the caller, but before any Seek or Read calls.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkInputStream::New
static vtkInputStream * New()
vtkInputStream::Read
virtual size_t Read(void *data, size_t length)
Read input data of the given length.
vtkObject.h
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInputStream::~vtkInputStream
~vtkInputStream()
vtkInputStream::ReadStream
size_t ReadStream(char *data, size_t length)
vtkInputStream::StreamStartPosition
vtkTypeInt64 StreamStartPosition
Definition: vtkInputStream.h:84
vtkInputStream
Wraps a binary input stream with a VTK interface.
Definition: vtkInputStream.h:34
vtkInputStream::Stream
istream * Stream
Definition: vtkInputStream.h:80
vtkInputStream::EndReading
virtual void EndReading()
Called after all desired calls to Seek and Read have been made.