/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * Notification.cpp * * Created on: Dec 1, 2011 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "MemDebug.hpp" #include "Notification.hpp" #include "Observer.hpp" Notification::Notification(size_t _channelno) : channelno(_channelno) {} Notification::~Notification(){} void Notification::addObserver(Observer *target) { targets.insert(target); } void Notification::removeObserver(Observer *target) { targets.erase(target); } void Notification::notifyAll(Observable * const publisher) { for(std::set::iterator it=targets.begin(); it!=targets.end();++it){ (*it)->recieveNotification(publisher,this); } }