Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

timeframe.h

00001 /***************************************************************************
00002                           timeframe.h  -  description
00003                              -------------------
00004     begin                : Tue May 9 2000
00005     copyright            : (C) 2000 by Michael Peeters
00006     email                : Michael.Peeters@vub.ac.be
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef TIMEFRAME_H
00019 #define TIMEFRAME_H
00020 
00021 #include "numerictypes.h"
00022 #include "cowner.h"
00023 #include "utility.h"
00024 #include <slist.h>
00025 
00026 namespace MODEL {
00027 
00036   class TickTock;
00037 
00038   class TimeFrame : public COwner
00039   {
00040         friend class TickTock;
00041   public:
00043         static const    time    default_dt=1.E-3; 
00044         
00045         TimeFrame(time resolution=default_dt, time t_init=0.);
00046         
00047         void    reset(void);
00048         
00049         time    get_time(void) {return t;}
00050         void    set_time(time newt) {t=newt;}
00051                 
00052         time    get_dt(void) {return dt;}
00053         void    set_dt(time newdt) {dt=newdt;}
00054                 
00061         const time&     step();
00062 
00064         const time&     operator++() {return step();}
00065 
00068         operator time() {return t;}
00069 
00071         void stop(Cycler& t){remove(t);}
00072 
00074         NO_COPY(TimeFrame);
00075 
00076   protected:
00077         time    t;
00078         time    dt;
00079 
00080   };
00081 
00083   extern TimeFrame      Universal;      
00084 
00085 } // MODEL
00086 #endif
00087 
00088 /*********************************************************************
00089 $Id: timeframe.h,v 1.1 2001/05/22 10:54:55 mpeeters Exp $
00090 **********************************************************************
00091 
00092 $Log: timeframe.h,v $
00093 Revision 1.1  2001/05/22 10:54:55  mpeeters
00094 Moved sources and headers for libModel to model/ subdirectory, in an attempt to rationalize the source tree. This should make things "netter".
00095 
00096 Revision 1.3  2001/05/21 11:53:16  mpeeters
00097 Removed Makefile.in, which is automatically generated anyway.
00098 
00099 Revision 1.2  2000/09/15 10:26:31  mpeeters
00100 Cleaned out header and added CVS tails to files, removed superfuous
00101 @author comments, inserted dates
00102 
00103 *********************************************************************/

To get the sources or tarballs, please go to SourceForge or you can use the CVS repository.

More Info? Michael Peeters. Also, check our research website: www.alna.vub.ac.be

Last update: June 2002.


Looking for Open Source? Check out SourceForge Logo !