CMinimalVersionInfo.h
Go to the documentation of this file.
1 #ifndef iser_CMinimalVersionInfo_included
2 #define iser_CMinimalVersionInfo_included
3 
4 
5 // Qt includes
6 #include <QtCore/QMap>
7 
8 // ACF includes
9 #include <iser/IVersionInfo.h>
10 
11 
12 namespace iser
13 {
14 
15 
16 class ISerializable;
17 
18 
27 class CMinimalVersionInfo: virtual public IVersionInfo
28 {
29 public:
35  CMinimalVersionInfo(const ISerializable* serializablePtr, bool addStandardIds = true);
36 
43  bool AddId(int versionId, const QString& description = "");
44 
45  // reimplemented (iser::IVersionInfo)
46  virtual bool GetVersionNumber(int versionId, quint32& result) const;
47  virtual QString GetVersionIdDescription(int versionId) const;
48  virtual VersionIds GetVersionIds() const;
49  virtual QString GetEncodedVersionName(int versionId, quint32 versionNumber) const;
50 
51 private:
52  struct Info
53  {
54  mutable quint32 version;
55  QString description;
56  };
57 
58  typedef QMap<int, Info> Versions;
59 
60  Versions m_versions;
61 
62  const ISerializable& m_serializable;
63 };
64 
65 
66 } // namespace iser
67 
68 
69 #endif // !iser_CMinimalVersionInfo_included
70 
71 
QSet< int > VersionIds
Definition: IVersionInfo.h:45
Provides access to version information.
Definition: IVersionInfo.h:22
virtual bool GetVersionNumber(int versionId, quint32 &result) const
Get version of archived stream for specific versioning type.
Common class for all classes which objects can be archived or restored from archive.
Definition: ISerializable.h:23
CMinimalVersionInfo(const ISerializable *serializablePtr, bool addStandardIds=true)
Constructor with initialization of reference to iser::ISerializable and registring of standard ID's...
virtual VersionIds GetVersionIds() const
Get list of version ID's.
bool AddId(int versionId, const QString &description="")
Add new version ID.
virtual QString GetEncodedVersionName(int versionId, quint32 versionNumber) const
Encode version number to human readable form.
Implementation of interface iser::IVersionInfo using information about minimal needed version from in...
virtual QString GetVersionIdDescription(int versionId) const
Get description of version ID.

© 2007-2017 Witold Gantzke and Kirill Lepskiy