Map< T >& Map< T >::operator = (const Map< T >& map) { deallocateMap(); mapAllocator = map.mapAllocator; root = copyMapNode(map.root); keys = map.keys; values = map.values; }
Map< T >& Map< T >::operator = (Map< T >&& map) { deallocateMap(); /* Clean up old data. */ mapAllocator = map.mapAllocator; root = map.root; map.root = NULL; keys = std::move(map.keys); values = std::move(map.values); }
void CDeviceTypeDirectory::deleteAt(POSITION pos) { TypeStruct* listTypeStruct = getAt(pos); if (m_deviceTypeMap != NULL) { TypeStruct* mapTypeStruct = getDeviceTypeMap().getAt(listTypeStruct->getName()); // If the map contains a different TypeStruct, no need to deallocate map. // If the map contains this TypeStruct, deallocate it so that when it is rebuilt, another TypeStruct with the same name // will be put into the map. if (mapTypeStruct == listTypeStruct) { deallocateMap(); } } m_deviceTypeList.deleteAt(pos); }
Map< T >::~Map() { deallocateMap(); }