Ejemplo n.º 1
0
Map< T >& Map< T >::operator = (const Map< T >& map) {
	deallocateMap();

	mapAllocator = map.mapAllocator;
	root = copyMapNode(map.root);
	keys = map.keys;
	values = map.values;
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
Map< T >::~Map() {
	deallocateMap();
}