comparison base/XmlExportable.h @ 1750:d0ef65d8dd89 by-id

Return id from add(), + comment
author Chris Cannam
date Thu, 04 Jul 2019 14:30:48 +0100
parents 4abc0f08adf9
children
comparison
equal deleted inserted replaced
1749:356be36b2391 1750:d0ef65d8dd89
28 enum { 28 enum {
29 // The value NO_ID (-1) is never allocated as an export id 29 // The value NO_ID (-1) is never allocated as an export id
30 NO_ID = -1 30 NO_ID = -1
31 }; 31 };
32 32
33 typedef int ExportId;
34
33 XmlExportable() : m_exportId(NO_ID) { } 35 XmlExportable() : m_exportId(NO_ID) { }
34 virtual ~XmlExportable() { } 36 virtual ~XmlExportable() { }
35 37
36 /** 38 /**
37 * Return the numerical export identifier for this object. It's 39 * Return the numerical export identifier for this object. It's
38 * allocated the first time this is called, so objects on which 40 * allocated the first time this is called, so objects on which
39 * this is never called do not get allocated one. 41 * this is never called do not get allocated one.
40 */ 42 */
41 int getExportId() const; 43 ExportId getExportId() const;
42 44
43 /** 45 /**
44 * Stream this exportable object out to XML on a text stream. 46 * Stream this exportable object out to XML on a text stream.
45 */ 47 */
46 virtual void toXml(QTextStream &stream, 48 virtual void toXml(QTextStream &stream,