MathTL
|
00001 // -*- c++ -*- 00002 00003 // +--------------------------------------------------------------------+ 00004 // | This file is part of MathTL - the Mathematical Template Library | 00005 // | | 00006 // | Copyright (c) 2002-2009 | 00007 // | Thorsten Raasch, Manuel Werner | 00008 // +--------------------------------------------------------------------+ 00009 00010 #ifndef _MATHTL_FUNCTION_TIME_H 00011 #define _MATHTL_FUNCTION_TIME_H 00012 00013 namespace MathTL 00014 { 00020 class FunctionTime 00021 { 00022 public: 00026 FunctionTime(const double initial_time = 0.0) 00027 : time(initial_time) {} 00028 00032 virtual ~FunctionTime() {} 00033 00037 inline double get_time() const { return time; } 00038 00044 virtual void set_time(const double new_time) { time = new_time; } 00045 00049 virtual void advance_time(const double delta_t) { set_time(time + delta_t); } 00050 00051 private: 00055 double time; 00056 }; 00057 } 00058 00059 #endif