void FCDParameterListAnimatableT<TYPE, QUALIFIERS>::resize(size_t count, const TYPE& value)
{
	if (count > values.size()) OnInsertion(values.size(), count - values.size());
	else if (count < values.size()) OnRemoval(count - values.size(), values.size());
	values.resize(count, value);
	OnPotentialSizeChange();
}
void FCDParameterListAnimatableT<TYPE, QUALIFIERS>::erase(size_t index)
{
	values.erase(index);
	GetParent()->SetStructureChangedFlag();
	GetParent()->SetDirtyFlag(); 
	OnRemoval(index, 1);
	OnPotentialSizeChange();
}
void FCDParameterListAnimatableT<TYPE, QUALIFIERS>::pop_front() 
{
	values.pop_front(); 
	GetParent()->SetStructureChangedFlag();
	GetParent()->SetDirtyFlag(); 
	OnRemoval(0, 1);
	OnPotentialSizeChange();
}
void FCDParameterListAnimatableT<TYPE, QUALIFIERS>::clear()
{
	OnRemoval(0, values.size());
	values.clear();
	GetParent()->SetStructureChangedFlag();
	GetParent()->SetDirtyFlag(); 
	OnPotentialSizeChange();
}
void FCDParameterListAnimatableT<TYPE, QUALIFIERS>::erase(size_t start, size_t end)
{
	values.erase(values.begin() + start, values.begin() + end);
	GetParent()->SetStructureChangedFlag();
	GetParent()->SetDirtyFlag(); 
	OnRemoval(start, end - start);
	OnPotentialSizeChange();
}
  VPtr lookup_or_create(const K &key, const A &arg) {
    Mutex::Locker l(lock);
    while (1) {
      if (contents.count(key)) {
	VPtr retval = contents[key].lock();
	if (retval)
	  return retval;
      } else {
	break;
      }
      cond.Wait(lock);
    }
    VPtr retval(new V(arg), OnRemoval(this, key));
    contents[key] = retval;
    return retval;
  }
  VPtr lookup_or_create(const K &key, const A &arg) {
    Mutex::Locker l(lock);
    waiting++;
    while (1) {
      typename map<K, pair<WeakVPtr, V*> >::iterator i =
	contents.find(key);
      if (i != contents.end()) {
	VPtr retval = i->second.first.lock();
	if (retval) {
	  waiting--;
	  return retval;
	}
      } else {
	break;
      }
      cond.Wait(lock);
    }
    V *ptr = new V(arg);
    VPtr retval(ptr, OnRemoval(this, key));
    contents.insert(make_pair(key, make_pair(retval, ptr)));
    waiting--;
    return retval;
  }