McDbGroup类表示由一个名称标识的一个实体集,McDbGroup存放于McDbDatabase里的组字典中, McDbDatabase::getGroupDictionary函数组字典对象
class McDbGroup : public McDbObject;
McDbGroup.h
例如: 得到实体所在组
McDbObjectId getGroup(IN McDbObjectId entId) { McDbDatabase* pDatabase = NULL; { McDbObjectPointer<McDbEntity> spEnt(entId,McDb::kForRead); if(spEnt.openStatus() != Mcad::eOk) return McDbObjectId::kNull; pDatabase = spEnt->database(); } McDbObjectPointer<McDbDictionary> spDict; McDbDictionary * pDict = NULL; if(pDatabase->getGroupDictionary(pDict,McDb::kForWrite) != Mcad::eOk) { return McDbObjectId::kNull; } spDict.acquire(pDict); McDbDictionaryIterator* pIter = spDict->newIterator(); std::auto_ptr<McDbDictionaryIterator> spIter(pIter); for(;!pIter->done();pIter->next()) { McDbObjectPointer<McDbGroup> spGroup(pIter->objectId(),McDb::kForRead); if(spGroup.openStatus() != Mcad::eOk) { continue;; } if(spGroup->has(entId) ) { return pIter->objectId(); } } return McDbObjectId::kNull; }