GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_rep.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  *****************************************************************************/
22 
23 #include <QString>
24 #include <QDateTime>
25 
26 #include "../glc_config.h"
27 
28 #ifndef GLC_REP_H_
29 #define GLC_REP_H_
30 
31 
32 
33 
35 {
36 public:
37  enum Type
38  {
39  GLC_VBOGEOM= 1
40  };
42 
44 
45 public:
47  GLC_Rep();
48 
50  GLC_Rep(const GLC_Rep&);
51 
53  virtual GLC_Rep &operator=(const GLC_Rep&);
54 
56  virtual GLC_Rep* clone() const = 0;
57 
59  virtual GLC_Rep* deepCopy() const = 0;
60 
62  virtual ~GLC_Rep();
63 
65 
67 
69 
70 public:
72  inline bool isTheLast() const
73  {return 1 == (*m_pNumberOfRepresentation);}
74 
76  inline bool operator==(const GLC_Rep& rep)
77  {
78  return (rep.m_pNumberOfRepresentation == m_pNumberOfRepresentation);
79  }
80 
82  inline QString fileName() const
83  {return (*m_pFileName);}
84 
86  virtual int type() const =0;
87 
89  inline QString name() const
90  {return (*m_pName);}
91 
93  virtual bool isEmpty() const= 0;
94 
96  inline bool isLoaded() const
97  {return *m_pIsLoaded;}
98 
100  inline QDateTime lastModified() const
101  {return *m_pDateTime;}
102 
104 
106 
108 
109 public:
111  inline void setFileName(const QString& fileName)
112  {(*m_pFileName)= fileName;}
113 
115  inline void setName(const QString& name)
116  {(*m_pName)= name;}
117 
119  virtual bool load()= 0;
120 
122  virtual bool unload()= 0;
123 
125  virtual void replace(GLC_Rep*)= 0;
126 
128  inline void setLastModified(const QDateTime& dateTime)
129  {*m_pDateTime= dateTime;}
130 
132 
133 // private services functions
135 private:
137  void clear();
139 // protected members
141 protected:
142 
144  bool* m_pIsLoaded;
145 
147 // Private members
149 private:
150 
153 
155  QString* m_pFileName;
156 
158  QString* m_pName;
159 
161  QDateTime* m_pDateTime;
162 
163 };
164 
165 #endif /* GLC_REP_H_ */

©2005-2013 Laurent Ribon