00001 /***************************************************************************
00002 cowner.cpp
00003 -----------
00004
00005 begin : Fri Sep 15 12:22:12 CEST 2000
00006 author : (C) 2000 by Michael Peeters
00007 email : Michael.Peeters@vub.ac.be
00008 ***************************************************************************/
00009
00010 /***************************************************************************
00011 * *
00012 * This program is free software; you can redistribute it and/or modify *
00013 * it under the terms of the GNU General Public License as published by *
00014 * the Free Software Foundation; either version 2 of the License, or *
00015 * (at your option) any later version. *
00016 * *
00017 ***************************************************************************/
00018
00019 #include "cowner.h"
00020
00021 namespace MODEL
00022 {
00023 void
00024 COwner::execute_list(void)
00025 {
00026 slist<Cycler*>::iterator runner(c_list.begin()),stop(c_list.end());
00027 for(;runner!=stop;++runner) cycle(**runner);
00028 }
00029
00030 void
00031 COwner::add_to_list(Cycler& c)
00032 {
00033 c_list.push_front(&c);
00034 }
00035
00036 void
00037 COwner::remove(Cycler& c)
00038 {
00039 slist<Cycler*>::iterator deadboy=find(c_list.begin(),c_list.end(),&c);
00040 if(deadboy!=c_list.end()) c_list.erase(deadboy);
00041 else throw(std::logic_error("Tried to remove a cycler that wasn't there in ther first place"));
00042 }
00043
00044 } // end namespace
00045
00046 /*********************************************************************
00047 $Id: cowner.cpp,v 1.1 2001/05/22 10:54:55 mpeeters Exp $
00048 **********************************************************************
00049
00050 $Log: cowner.cpp,v $
00051 Revision 1.1 2001/05/22 10:54:55 mpeeters
00052 Moved sources and headers for libModel to model/ subdirectory, in an attempt to rationalize the source tree. This should make things "netter".
00053
00054 Revision 1.2 2000/09/15 10:26:31 mpeeters
00055 Cleaned out header and added CVS tails to files, removed superfuous
00056 @author comments, inserted dates
00057
00058 *********************************************************************/
More Info? Michael Peeters. Also, check our research website: www.alna.vub.ac.be
Last update: June 2002.