Mercurial > hg > svcore
comparison data/model/Model.h @ 933:d03b3d956358 warnfix_no_size_t
Merge from branch tony_integration
author | Chris Cannam |
---|---|
date | Wed, 18 Jun 2014 08:34:46 +0100 |
parents | df82da55e86a defbe5bc47b7 |
children | cc27f35aa75c |
comparison
equal
deleted
inserted
replaced
932:e06f03013f46 | 933:d03b3d956358 |
---|---|
103 * to copy at all. | 103 * to copy at all. |
104 * | 104 * |
105 * Caller owns the returned value. | 105 * Caller owns the returned value. |
106 */ | 106 */ |
107 virtual Model *clone() const = 0; | 107 virtual Model *clone() const = 0; |
108 | 108 |
109 /** | |
110 * Mark the model as abandoning. This means that the application | |
111 * no longer needs it, so it can stop doing any background | |
112 * calculations it may be involved in. Note that as far as the | |
113 * model API is concerned, this does nothing more than tell the | |
114 * model to return true from isAbandoning(). The actual response | |
115 * to this will depend on the model's context -- it's possible | |
116 * nothing at all will change. | |
117 */ | |
118 virtual void abandon() { | |
119 m_abandoning = true; | |
120 } | |
121 | |
122 /** | |
123 * Query whether the model has been marked as abandoning. | |
124 */ | |
125 virtual bool isAbandoning() const { | |
126 return m_abandoning; | |
127 } | |
128 | |
109 /** | 129 /** |
110 * Return true if the model has finished loading or calculating | 130 * Return true if the model has finished loading or calculating |
111 * all its data, for a model that is capable of calculating in a | 131 * all its data, for a model that is capable of calculating in a |
112 * background thread. The default implementation is appropriate | 132 * background thread. The default implementation is appropriate |
113 * for a thread that does not background any work but carries out | 133 * for a thread that does not background any work but carries out |
266 * will be emitted before the actual deletion. | 286 * will be emitted before the actual deletion. |
267 */ | 287 */ |
268 void aboutToBeDeleted(); | 288 void aboutToBeDeleted(); |
269 | 289 |
270 protected: | 290 protected: |
271 Model() : m_sourceModel(0), m_alignment(0), m_aboutToDelete(false) { } | 291 Model() : |
292 m_sourceModel(0), | |
293 m_alignment(0), | |
294 m_abandoning(false), | |
295 m_aboutToDelete(false) { } | |
272 | 296 |
273 // Not provided. | 297 // Not provided. |
274 Model(const Model &); | 298 Model(const Model &); |
275 Model &operator=(const Model &); | 299 Model &operator=(const Model &); |
276 | 300 |
277 Model *m_sourceModel; | 301 Model *m_sourceModel; |
278 AlignmentModel *m_alignment; | 302 AlignmentModel *m_alignment; |
279 QString m_typeUri; | 303 QString m_typeUri; |
304 bool m_abandoning; | |
280 bool m_aboutToDelete; | 305 bool m_aboutToDelete; |
281 }; | 306 }; |
282 | 307 |
283 #endif | 308 #endif |