Example #1
0
int CSchemaMapManager::getNumberOfComponents() const
{
    int nCount = 0;
    HashIterator iter(*(m_pElementPtrsMap.get()));

    ForEach(iter)
    {
        CElement *pElement = *(m_pElementPtrsMap->mapToValue(&iter.query()));
        if (pElement->isTopLevelElement() == true)
            nCount++;
    }
    return nCount;
}
Example #2
0
int CSchemaMapManager::getIndexOfElement(const CElement *pElem)
{
    int nCount = 0;
    HashIterator iter(*(m_pElementPtrsMap.get()));

    ForEach(iter)
    {
        CElement *pElement = *(m_pElementPtrsMap->mapToValue(&iter.query()));

        if (pElement == pElem)
            return nCount;
        if (pElement->isTopLevelElement() == true)
            nCount++;
    }
    assert(false);
    return -1;
}
Example #3
0
CElement* CSchemaMapManager::getComponent(int index)
{
    assert(index >= 0 && index < getNumberOfComponents());
    HashIterator iter(*(m_pElementPtrsMap.get()));

    int nCount = 0;

    ForEach(iter)
    {
        CElement *pElement = *(m_pElementPtrsMap->mapToValue(&iter.query()));
        if (pElement->isTopLevelElement() == true)
        {
            if (nCount == index)
                return pElement;
            nCount++;
        }        
    }
    return nullptr;
}