Mercurial > hg > svcore
diff base/XmlExportable.cpp @ 4:149bb02a41ba
* Session file save, and the skeleton of session file load.
author | Chris Cannam |
---|---|
date | Fri, 13 Jan 2006 18:05:07 +0000 |
parents | 581f67f370f3 |
children | 39ae3dee27b9 |
line wrap: on
line diff
--- a/base/XmlExportable.cpp Thu Jan 12 17:19:08 2006 +0000 +++ b/base/XmlExportable.cpp Fri Jan 13 18:05:07 2006 +0000 @@ -8,6 +8,7 @@ */ #include "XmlExportable.h" +#include <map> QString XmlExportable::encodeEntities(QString s) @@ -39,3 +40,17 @@ return "#" + r + g + b; } +int +XmlExportable::getObjectExportId(const void * object) +{ + static std::map<const void *, int> idMap; + static int maxId = 0; + + if (idMap.find(object) == idMap.end()) { + idMap[object] = maxId++; + } + + return idMap[object]; +} + +