TAPs 0.7.7.3
TAPsSimClock.cpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsSimClock.cpp
00003 ******************************************************************************/
00007 /******************************************************************************
00008 SUKITTI PUNAK   (07/10/2005)
00009 UPDATE          (09/16/2010)
00010 ******************************************************************************/
00011 #include "TAPsSimClock.hpp"
00012 // Using Inclusion Model (i.e. definitions are included in declarations)
00013 //                       (this name.cpp is included in name.hpp)
00014 // Each friend is defined directly inside its declaration.
00015 
00016 
00017 BEGIN_NAMESPACE_TAPs__Simulation
00018 //=============================================================================
00019 //-----------------------------------------------------------------------------
00020 // Class SimClock
00021 //-------------------------------------------------------------------
00022 template <typename T>
00023 SimClock<T>::SimClock ()
00024     : Start(0), End(1), Current(0), Step(0.01)
00025 {}
00026 //-------------------------------------------------------------------
00027 template <typename T>
00028 SimClock<T>::SimClock ( T _start, T _end, T _current, T _step )
00029     : Start( _start ), End( _end ), Current( _current ), Step( _step )
00030 {}
00031 //-------------------------------------------------------------------
00032 template <typename T>
00033 void SimClock<T>::AdvanceTime ()
00034 {
00035     Current < End ? Current += Step : Current;
00036 }
00037 //-------------------------------------------------------------------
00038 template <typename T>
00039 void SimClock<T>::AdvanceTime ( T dt )
00040 {
00041     Step = dt;
00042     Current < End ? Current += Step : Current;
00043 }
00044 //-----------------------------------------------------------------------------
00045 //=============================================================================
00046 END_NAMESPACE_TAPs__Simulation
00047 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00048 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines