void CDeviceTypeDirectory::removeUnusedDeviceTypes() { for (POSITION pos = getHeadPosition();pos != NULL;) { POSITION oldPos = pos; TypeStruct* typeStruct = getNext(pos); if (typeStruct->getBlockNumber() < 0) { deleteAt(oldPos); } } }
// does not copy the CTypePinList TypeStruct::TypeStruct(const TypeStruct& other,int entityNumber) : m_parentList(other.m_parentList) , m_attributes(NULL) , m_blockNumber(other.getBlockNumber()) , m_entityNumber(entityNumber) , m_name(other.getName()) , m_typePinList(*this) { if (m_entityNumber < 0) { m_entityNumber = getCamCadData().allocateEntityNumber(); } if (other.getAttributes() != NULL) { attributes() = *(other.getAttributes()); } }