RegularStimulus.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _REGULARSTIMULUS_HPP_
00038 #define _REGULARSTIMULUS_HPP_
00039
00040 #include "ChasteSerialization.hpp"
00041 #include <boost/serialization/base_object.hpp>
00042
00043 #include "AbstractStimulusFunction.hpp"
00044
00048 class RegularStimulus : public AbstractStimulusFunction
00049 {
00050 private:
00052 friend class boost::serialization::access;
00059 template<class Archive>
00060 void serialize(Archive & archive, const unsigned int version)
00061 {
00062
00063 archive & boost::serialization::base_object<AbstractStimulusFunction>(*this);
00064 archive & mMagnitudeOfStimulus;
00065 archive & mDuration;
00066 archive & mPeriod;
00067 archive & mStartTime;
00068 archive & mStopTime;
00069 }
00070
00071 protected:
00072
00074 double mMagnitudeOfStimulus;
00076 double mDuration;
00078 double mPeriod;
00080 double mStartTime;
00082 double mStopTime;
00083
00084 public:
00094 RegularStimulus(double magnitudeOfStimulus, double duration, double period, double startTime, double stopTime=DBL_MAX);
00095
00102 double GetStimulus(double time);
00103
00107 double GetPeriod();
00108
00112 double GetMagnitude();
00113
00117 double GetDuration();
00118
00122 double GetStartTime();
00123
00133 void SetMagnitude(double magnitude);
00134
00140 void SetPeriod(double period);
00141
00147 void SetDuration(double duration);
00148
00154 void SetStartTime(double startTime);
00155
00161 void SetStopTime(double stopTime);
00162 };
00163
00164 #include "SerializationExportWrapper.hpp"
00165
00166 CHASTE_CLASS_EXPORT(RegularStimulus)
00167
00168 namespace boost
00169 {
00170 namespace serialization
00171 {
00176 template<class Archive>
00177 inline void load_construct_data(
00178 Archive & ar, RegularStimulus * t, const unsigned int file_version)
00179 {
00186 ::new(t)RegularStimulus(0.0, 0.0, 0.1, 0.0, 1.0);
00187 }
00188 }
00189 }
00190
00191 #endif //_REGULARSTIMULUS_HPP_