/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010-2012 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * atom_observable.cpp * * Created on: Sep 1, 2011 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include "CodePatterns/Assert.hpp" #include "atom_observable.hpp" /** Constructor for class AtomObservable. * */ AtomObservable::AtomObservable() : Observable("Atom") { Channels *OurChannel = new Channels; NotificationChannels.insert( std::make_pair(this, OurChannel) ); // add instance for each notification type for (size_t type = 0; type < NotificationType_MAX; ++type) OurChannel->addChannel(type); } AtomObservable::~AtomObservable() { std::map::iterator iter = NotificationChannels.find(this); ASSERT(iter != NotificationChannels.end(), "~AtomObservable() - cannot find myself in NotificationChannels."); delete iter->second; NotificationChannels.erase(iter); }