//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //=========================================================================== 00015 #ifndef _OBJECTHEADER_H 00016 #define _OBJECTHEADER_H 00017 00018 00019 #include <vector> 00020 #include "GoTools/geometry/ClassType.h" 00021 #include "GoTools/geometry/Streamable.h" 00022 00023 namespace Go 00024 { 00025 00033 class GO_API ObjectHeader : public Streamable 00034 { 00035 public: 00037 ObjectHeader() 00038 : class_type_(Class_Unknown), 00039 major_version_(0), 00040 minor_version_(0) 00041 {} 00042 00049 ObjectHeader(ClassType t, int major, int minor) 00050 : class_type_(t), 00051 major_version_(major), 00052 minor_version_(minor) 00053 {} 00054 00063 ObjectHeader(ClassType t, int major, int minor, 00064 const std::vector<int>& auxdata) 00065 : class_type_(t), 00066 major_version_(major), 00067 minor_version_(minor), 00068 auxillary_data_(auxdata) 00069 {} 00070 00072 virtual ~ObjectHeader(); 00073 00076 virtual void read (std::istream& is); 00077 00080 virtual void write (std::ostream& os) const; 00081 00083 ClassType classType() { return class_type_; } 00084 00086 int majorVersion() { return major_version_; } 00087 00089 int minorVersion() { return minor_version_; } 00090 00093 int auxdataSize() { return auxillary_data_.size(); } 00094 00097 int auxdata(int i) { return auxillary_data_[i]; } 00098 00099 private: 00100 ClassType class_type_; 00101 int major_version_; 00102 int minor_version_; 00103 std::vector<int> auxillary_data_; 00104 }; 00105 00106 00107 } // namespace Go 00108 00109 00110 #endif // _OBJECTHEADER_H 00111