glc_rep.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00135 private:
00137 void clear();
00139
00141 protected:
00142
00144 bool* m_pIsLoaded;
00145
00147
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