#define XERR
#include "cluster.ih"

void Cluster::activate(MapIter const &iter, VectConstIter const &elementIter)
{
    Prefix &prefix = iter->second;          // the data associated with this 
                                            // prefix

    bool isActive = prefix.active;          // remember the current activity

    for (MapValue &value: d_map)
        value.second.active = false;        // deactivate all active settings

    prefix.active = true;                   // activate the current element

    if (not isActive)                       // new activity: 
        ++prefix.count;                     // increment its count

    prefix.vect.emplace_back(elementIter);  // entry belongs to this prefix
}
