25#ifndef ODTRVISUNIQUEIDMAPPING
26#define ODTRVISUNIQUEIDMAPPING
42 typedef std::map<T, OdTrVisId> IdMap;
43 mutable struct IdMapEntry
52 IdMapEntry() : m_idMapCounter(101) { }
79 for (
OdUInt32 nType = nFrom; nType < nTo; nType++)
80 m_idMapEntry[nType].clear();
84 { IdMapEntry &entry = m_idMapEntry[genType(
type)];
85 OD_TYPENAME IdMap::const_iterator it = entry.m_idMap.find(uid);
86 if (it != entry.m_idMap.end())
88 entry.m_idMap[uid] = entry.m_idMapCounter;
89 return inc(entry.m_idMapCounter,
type);
93 { IdMapEntry &entry = m_idMapEntry[genType(
type)];
94 OD_TYPENAME IdMap::iterator it = entry.m_idMap.find(uid);
95 if (it != entry.m_idMap.end())
96 entry.m_idMap.erase(it);
100 {
const IdMapEntry &entry = m_idMapEntry[genType(
type)];
101 OD_TYPENAME IdMap::const_iterator it = entry.m_idMap.begin();
102 while (it != entry.m_idMap.end())
104 if (it->second ==
id)
112 {
const IdMapEntry &entry = m_idMapEntry[genType(
type)];
113 OD_TYPENAME IdMap::const_iterator it = entry.m_idMap.find(uid);
114 return it != entry.m_idMap.end();
119 m_idMapEntry[genType(
type)].m_idMap[uid] = id;
const OdTrVisId kTrVisNegativeId
OdTrVisUniqueIDMappingImpl< OdAnsiString > OdTrVisUniqueIDMappingStr
OdTrVisUniqueIDMappingImpl< OdTrVisUniqueID > OdTrVisUniqueIDMapping
OdTrVisUniqueID & untransform(const char *pStr, const UIDUnTransformer &untransformer=DefUIDUnTransformer())
const T * findUID(OdTrVisId id, OdTrVisRendition::DataType type) const
static OdAnsiString asString(const OdTrVisUniqueID &id)
void clean(OdTrVisRendition::DataType type=OdTrVisRendition::kNDataTypes)
OdTrVisId getTrVisId(const T &uid, OdTrVisRendition::DataType type) const
void killTrVisId(const T &uid, OdTrVisRendition::DataType type)
OdTrVisUniqueIDMappingImpl()
void setSpecialId(const T &uid, OdTrVisId id, OdTrVisRendition::DataType type)
static OdTrVisUniqueID asUID(const OdAnsiString &str)
OdTrVisId inc(OdTrVisId &counter, OdTrVisRendition::DataType type) const
bool hasUID(const T &uid, OdTrVisRendition::DataType type) const
GLuint GLsizei GLsizei GLint GLenum * type
static OdUInt32 toGenericDataType(DataType dt)