glc_rep.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  Version 2.0.0 Beta 1, packaged on April 2010.
00006 
00007  http://glc-lib.sourceforge.net
00008 
00009  GLC-lib is free software; you can redistribute it and/or modify
00010  it under the terms of the GNU General Public License as published by
00011  the Free Software Foundation; either version 2 of the License, or
00012  (at your option) any later version.
00013 
00014  GLC-lib is distributed in the hope that it will be useful,
00015  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with GLC-lib; if not, write to the Free Software
00021  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023  *****************************************************************************/
00024 
00025 #include <QString>
00026 #include <QDateTime>
00027 
00028 #include "../glc_config.h"
00029 
00030 #ifndef GLC_REP_H_
00031 #define GLC_REP_H_
00034 
00035 
00036 class GLC_LIB_EXPORT GLC_Rep
00037 {
00038 public:
00039         enum Type
00040         {
00041                 GLC_VBOGEOM= 1
00042         };
00044 
00046 
00047 public:
00049         GLC_Rep();
00050 
00052         GLC_Rep(const GLC_Rep&);
00053 
00055         virtual GLC_Rep &operator=(const GLC_Rep&);
00056 
00058         virtual GLC_Rep* clone() const = 0;
00059 
00061         virtual GLC_Rep* deepCopy() const = 0;
00062 
00064         virtual ~GLC_Rep();
00065 
00067 
00069 
00071 
00072 public:
00074         inline bool isTheLast() const
00075         {return 1 == (*m_pNumberOfRepresentation);}
00076 
00078         inline bool operator==(const GLC_Rep& rep)
00079         {
00080                 return (rep.m_pNumberOfRepresentation == m_pNumberOfRepresentation);
00081         }
00082 
00084         inline QString fileName() const
00085         {return (*m_pFileName);}
00086 
00088         virtual int type() const =0;
00089 
00091         inline QString name() const
00092         {return (*m_pName);}
00093 
00095         virtual bool isEmpty() const= 0;
00096 
00098         inline bool isLoaded() const
00099         {return *m_pIsLoaded;}
00100 
00102         inline QDateTime lastModified() const
00103         {return *m_pDateTime;}
00104 
00106 
00108 
00110 
00111 public:
00113         inline void setFileName(const QString& fileName)
00114         {(*m_pFileName)= fileName;}
00115 
00117         inline void setName(const QString& name)
00118         {(*m_pName)= name;}
00119 
00121         virtual bool load()= 0;
00122 
00124         virtual bool unload()= 0;
00125 
00127         virtual void replace(GLC_Rep*)= 0;
00128 
00130         inline void setLastModified(const QDateTime& dateTime)
00131         {*m_pDateTime= dateTime;}
00132 
00134 
00135 // private services functions
00137 private:
00139         void clear();
00141 // protected members
00143 protected:
00144 
00146         bool* m_pIsLoaded;
00147 
00149 // Private members
00151 private:
00152 
00154         int* m_pNumberOfRepresentation;
00155 
00157         QString* m_pFileName;
00158 
00160         QString* m_pName;
00161 
00163         QDateTime* m_pDateTime;
00164 
00165 };
00166 
00167 #endif /* GLC_REP_H_ */

SourceForge.net Logo

©2005 Laurent Ribon