Commit f73c649f authored by Pierre Kraemer's avatar Pierre Kraemer

correction clear markers dart et cell apres suppression

parent 658baf8f
......@@ -290,7 +290,7 @@ public:
* Decremente le compteur de reference de la ligne
* @param eltIdx iterator sur cette ligne
*/
void unrefLine(unsigned int eltIdx);
bool unrefLine(unsigned int eltIdx);
void setRefLine(unsigned int eltIdx, unsigned int nb);
......
......@@ -222,9 +222,14 @@ inline void AttribContainer::refLine(unsigned int eltIdx)
m_holesBlocks[eltIdx / _BLOCKSIZE_]->ref(eltIdx % _BLOCKSIZE_);
}
inline void AttribContainer::unrefLine(unsigned int eltIdx)
inline bool AttribContainer::unrefLine(unsigned int eltIdx)
{
if (m_holesBlocks[eltIdx / _BLOCKSIZE_]->unref(eltIdx % _BLOCKSIZE_)) m_size--;
if (m_holesBlocks[eltIdx / _BLOCKSIZE_]->unref(eltIdx % _BLOCKSIZE_))
{
m_size--;
return true;
}
return false;
}
inline void AttribContainer::setRefLine(unsigned int eltIdx, unsigned int nb)
......
......@@ -54,6 +54,7 @@ inline void GenericMap::deleteDart(Dart d)
if(emb != EMBNULL)
m_attribs[orbit].unrefLine(emb) ;
}
m_markerTables[DART_ORBIT]->operator[](d.index).clear() ;
}
}
......
......@@ -56,7 +56,7 @@ public:
//! Constructor
Mark() : m_bits(0) {};
Mark(unsigned a) : m_bits(a) {};
Mark(unsigned int a) : m_bits(a) {};
//! Copy constructor
Mark(const Mark& m) : m_bits(m.m_bits) {};
......@@ -71,11 +71,16 @@ public:
return n;
}
inline void clear()
{
m_bits = 0;
}
//! Test if all marks are set to NO (0)
inline bool isClear()
{
return (m_bits == 0);
};
}
//! Set given marks to YES
/*! @param m the marks to set
......
......@@ -100,7 +100,10 @@ void GenericMap::setDartEmbedding(unsigned int orbit, Dart d, unsigned int emb)
return;
// if different then unref the old emb
if (old != EMBNULL)
m_attribs[orbit].unrefLine(old);
{
if(m_attribs[orbit].unrefLine(old))
m_markerTables[orbit]->operator[](old).clear();
}
// ref the new emb
if (emb != EMBNULL)
m_attribs[orbit].refLine(emb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment