ObjectReader.h

Go to the documentation of this file.
00001 /****************** <VPR heading BEGIN do not edit this line> *****************
00002  *
00003  * VR Juggler Portable Runtime
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum, Patrick Hartling, Kevin Meinert, Carolina Cruz-Neira
00007  *
00008  * -----------------------------------------------------------------
00009  * File:          $RCSfile$
00010  * Date modified: $Date: 2005-08-25 20:40:48 -0500 (Thu, 25 Aug 2005) $
00011  * Version:       $Revision: 18027 $
00012  * -----------------------------------------------------------------
00013  *
00014  ****************** <VPR heading END do not edit this line> ******************/
00015 
00016 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00017  *
00018  * VR Juggler is (C) Copyright 1998-2005 by Iowa State University
00019  *
00020  * Original Authors:
00021  *   Allen Bierbaum, Christopher Just,
00022  *   Patrick Hartling, Kevin Meinert,
00023  *   Carolina Cruz-Neira, Albert Baker
00024  *
00025  * This library is free software; you can redistribute it and/or
00026  * modify it under the terms of the GNU Library General Public
00027  * License as published by the Free Software Foundation; either
00028  * version 2 of the License, or (at your option) any later version.
00029  *
00030  * This library is distributed in the hope that it will be useful,
00031  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00032  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00033  * Library General Public License for more details.
00034  *
00035  * You should have received a copy of the GNU Library General Public
00036  * License along with this library; if not, write to the
00037  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00038  * Boston, MA 02111-1307, USA.
00039  *
00040  *************** <auto-copyright.pl END do not edit this line> ***************/
00041 
00042 #ifndef _VPR_OBJECT_READER_H
00043 #define _VPR_OBJECT_READER_H
00044 
00045 #include <vpr/vprConfig.h>
00046 
00047 #include <vpr/Util/AttributeMapBase.h>
00048 #include <vpr/Util/ReturnStatus.h>
00049 #include <vpr/vprTypes.h>
00050 
00051 namespace vpr
00052 {
00053 
00058 class VPR_CLASS_API ObjectReader : public AttributeMapBase
00059 {
00060 protected:
00061    ObjectReader();
00062 
00063    ObjectReader(const ObjectReader& o);
00064 
00065 public:
00066    virtual ~ObjectReader();
00067 
00073    bool isBinary()
00074    {
00075       return mIsBinary;
00076    }
00077 
00101    virtual vpr::ReturnStatus beginTag(const std::string& tagName) = 0;
00102 
00104    virtual vpr::ReturnStatus endTag() = 0;
00105 
00107    virtual vpr::ReturnStatus beginAttribute(const std::string& attributeName) = 0;
00108 
00110    virtual vpr::ReturnStatus endAttribute() = 0;
00112 
00118    virtual void resetReading() = 0;
00119 
00125    virtual void pushState() = 0;
00126    virtual void popState() = 0;
00127 
00128    virtual vpr::Uint8 readUint8() = 0;
00129    virtual vpr::Uint16 readUint16() = 0;
00130    virtual vpr::Uint32 readUint32() = 0;
00131    virtual vpr::Uint64 readUint64() = 0;
00132    virtual float readFloat() = 0;
00133    virtual double readDouble() = 0;
00134    virtual std::string readString() = 0;
00135    virtual bool readBool() = 0;
00136 
00139    virtual void readUint8(vpr::Uint8& val)
00140    {
00141       val = this->readUint8();
00142    }
00143 
00144    virtual void readUint16(vpr::Uint16& val)
00145    {
00146       val = this->readUint16();
00147    }
00148 
00149    virtual void readUint32(vpr::Uint32& val)
00150    {
00151       val = this->readUint32();
00152    }
00153 
00154    virtual void readUint64(vpr::Uint64& val)
00155    {
00156       val = this->readUint64();
00157    }
00158 
00159    virtual void readFloat(float& val)
00160    {
00161       val = this->readFloat();
00162    }
00163 
00164    virtual void readDouble(double& val)
00165    {
00166       val = this->readDouble();
00167    }
00168 
00169    virtual void readString(std::string& str)
00170    {
00171       str = this->readString();
00172    }
00173 
00174    virtual void readBool(bool& val)
00175    {
00176       val = this->readBool();
00177    }
00179 
00180 protected:
00181    bool mIsBinary;   
00182 };
00183 
00184 } // namespace vpr
00185 
00186 #endif

Generated on Thu Jan 4 10:52:10 2007 for VR Juggler Portable Runtime by  doxygen 1.5.1