+ for(CollectionItemTypeBase *t: types)
+ delete t;
+}
+
+void Collection::add_var(const string &name, const CollectionItemTypeBase *type, const Variant &var)
+{
+ insert_unique(items, name, var);
+ try
+ {
+ if(type)
+ type->notify_item(name, var);
+ }
+ catch(...)
+ {
+ remove_existing(items, name);
+ throw;
+ }