Supply::Supply(const RWCString &name, Exchange *exchange) throw (cwException) : // base classes Root(), // members _name(name), _nameAndLinks(name), _role(ExchangeInput), _type(SupplyDemandType_t::ST_InOut), // default //_type is meaningless for exchanges -- use default _releaseType(NULL), _destinationType(NULL), _supplyAccount(NULL), _demandAccount(NULL), _exchange(exchange), // don't initialize the payback _supplySlot(supplySlot, FLOW, VOLUME, "", Slot::AttributeBits(Slot::SupplySlotBit| Slot::LinkableSlotBit)) { const Supply *old = AccountMgrObj->insertSupplyName(name, this); ... ... ... } ================== const Supply * AccountMgr::insertSupplyName( const RWCString &newname, const Supply *who ) { IFDEBUG(dbm) { dbm.os() << "AccountMgr::insertSupplyName " << newname << endl; } const Supply * old = getSupply(newname); if(old != NULL) { IFDEBUG(dbm) { dbm.os() << "AccountMgr::insertSupplyName " << newname << " found existing entry." << old->getName() << endl; } return NULL; } _supplies.insert(newname, who); IFDEBUG(dbm) { dbm.os() << "AccountMgr::insertSupplyName returns " << who->getName() << endl; } return who; } ================== const Supply * AccountMgr::removeSupplyName( const RWCString &oldname, const Supply *who, bool force // false: had better match ) { IFDEBUG(dbm) { dbm.os() << "AccountMgr::removeSupplyName " << oldname << endl; } cwIterator d = _supplies.locate (oldname); if(d==NULL) return NULL; const Supply* old = _supplies.to(d); if (force || (old == who)) _supplies.remove(d); IFDEBUG(dbm) { dbm.os() << "AccountMgr::removeSupplyName returns " << old->getName() << endl; } return old; } ==================