Exemple #1
0
    public void erase(const_iterator iterator)
    {
        if (m_indexesFile == null)
        {
            throw new System.Exception("SwappedMap::erase");
        }

        Dictionary <Key, Descriptor> .Enumerator descriptorsIterator = iterator.innerIterator();
//C++ TO C# CONVERTER TODO TASK: Iterators are only converted within the context of 'while' and 'for' loops:
        m_indexesFile.seekp(sizeof(ulong) + (sizeof(bool) + sizeof(Key) + sizeof(uint)) * descriptorsIterator.second.index);
        bool valid = false;

//C++ TO C# CONVERTER TODO TASK: There is no equivalent to 'reinterpret_cast' in C#:
        m_indexesFile.write(reinterpret_cast <char>(valid), sizeof(bool));
        if (m_indexesFile == null)
        {
            throw new System.Exception("SwappedMap::erase");
        }

        m_descriptors.Remove(descriptorsIterator);
//C++ TO C# CONVERTER TODO TASK: Iterators are only converted within the context of 'while' and 'for' loops:
        var cacheIteratorsIterator = m_cacheIterators.find(descriptorsIterator.first);

//C++ TO C# CONVERTER TODO TASK: Iterators are only converted within the context of 'while' and 'for' loops:
        if (cacheIteratorsIterator != m_cacheIterators.end())
        {
//C++ TO C# CONVERTER TODO TASK: Iterators are only converted within the context of 'while' and 'for' loops:
            m_items.Remove(descriptorsIterator.first);
//C++ TO C# CONVERTER TODO TASK: There is no direct equivalent to the STL list 'erase' method in C#:
//C++ TO C# CONVERTER TODO TASK: Iterators are only converted within the context of 'while' and 'for' loops:
            m_cache.erase(cacheIteratorsIterator.second);
            m_cacheIterators.Remove(cacheIteratorsIterator);
        }
    }