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
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
00137 private:
00139 void clear();
00141
00143 protected:
00144
00146 bool* m_pIsLoaded;
00147
00149
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