VTK
dox/IO/Core/vtkInputStream.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkInputStream.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00026 #ifndef __vtkInputStream_h
00027 #define __vtkInputStream_h
00028 
00029 #include "vtkIOCoreModule.h" // For export macro
00030 #include "vtkObject.h"
00031 
00032 class VTKIOCORE_EXPORT vtkInputStream : public vtkObject
00033 {
00034 public:
00035   vtkTypeMacro(vtkInputStream,vtkObject);
00036   static vtkInputStream *New();
00037   void PrintSelf(ostream& os, vtkIndent indent);
00038 
00039   //BTX
00041 
00042   vtkSetMacro(Stream, istream*);
00043   vtkGetMacro(Stream, istream*);
00044   //ETX
00046 
00050   virtual void StartReading();
00051 
00054   virtual int Seek(vtkTypeInt64 offset);
00055 
00057   virtual size_t Read(void* data, size_t length);
00058 
00063   virtual void EndReading();
00064 
00065 protected:
00066   vtkInputStream();
00067   ~vtkInputStream();
00068 
00069   // The real input stream.
00070   istream* Stream;
00071   size_t ReadStream(char* data, size_t length);
00072 
00073   // The input stream's position when StartReading was called.
00074   vtkTypeInt64 StreamStartPosition;
00075 
00076 private:
00077   vtkInputStream(const vtkInputStream&);  // Not implemented.
00078   void operator=(const vtkInputStream&);  // Not implemented.
00079 };
00080 
00081 #endif