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  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021  *****************************************************************************/
00022 
00023 #include <QString>
00024 #include <QDateTime>
00025 
00026 #include "../glc_config.h"
00027 
00028 #ifndef GLC_REP_H_
00029 #define GLC_REP_H_
00032 
00033 
00034 class GLC_LIB_EXPORT GLC_Rep
00035 {
00036 public:
00037         enum Type
00038         {
00039                 GLC_VBOGEOM= 1
00040         };
00042 
00044 
00045 public:
00047         GLC_Rep();
00048 
00050         GLC_Rep(const GLC_Rep&);
00051 
00053         virtual GLC_Rep &operator=(const GLC_Rep&);
00054 
00056         virtual GLC_Rep* clone() const = 0;
00057 
00059         virtual GLC_Rep* deepCopy() const = 0;
00060 
00062         virtual ~GLC_Rep();
00063 
00065 
00067 
00069 
00070 public:
00072         inline bool isTheLast() const
00073         {return 1 == (*m_pNumberOfRepresentation);}
00074 
00076         inline bool operator==(const GLC_Rep& rep)
00077         {
00078                 return (rep.m_pNumberOfRepresentation == m_pNumberOfRepresentation);
00079         }
00080 
00082         inline QString fileName() const
00083         {return (*m_pFileName);}
00084 
00086         virtual int type() const =0;
00087 
00089         inline QString name() const
00090         {return (*m_pName);}
00091 
00093         virtual bool isEmpty() const= 0;
00094 
00096         inline bool isLoaded() const
00097         {return *m_pIsLoaded;}
00098 
00100         inline QDateTime lastModified() const
00101         {return *m_pDateTime;}
00102 
00104 
00106 
00108 
00109 public:
00111         inline void setFileName(const QString& fileName)
00112         {(*m_pFileName)= fileName;}
00113 
00115         inline void setName(const QString& name)
00116         {(*m_pName)= name;}
00117 
00119         virtual bool load()= 0;
00120 
00122         virtual bool unload()= 0;
00123 
00125         virtual void replace(GLC_Rep*)= 0;
00126 
00128         inline void setLastModified(const QDateTime& dateTime)
00129         {*m_pDateTime= dateTime;}
00130 
00132 
00133 // private services functions
00135 private:
00137         void clear();
00139 // protected members
00141 protected:
00142 
00144         bool* m_pIsLoaded;
00145 
00147 // Private members
00149 private:
00150 
00152         int* m_pNumberOfRepresentation;
00153 
00155         QString* m_pFileName;
00156 
00158         QString* m_pName;
00159 
00161         QDateTime* m_pDateTime;
00162 
00163 };
00164 
00165 #endif /* GLC_REP_H_ */

SourceForge.net Logo

©2005-2011 Laurent Ribon