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 #ifndef _REGULARSTIMULUS_HPP_
00031 #define _REGULARSTIMULUS_HPP_
00032
00033 #include <new>
00034 #include <boost/serialization/access.hpp>
00035 #include <boost/serialization/base_object.hpp>
00036
00037 #include "AbstractStimulusFunction.hpp"
00038
00039
00040 #include <boost/serialization/export.hpp>
00041
00045 class RegularStimulus : public AbstractStimulusFunction
00046 {
00047 private:
00049 friend class boost::serialization::access;
00056 template<class Archive>
00057 void serialize(Archive & archive, const unsigned int version)
00058 {
00059
00060 archive & boost::serialization::base_object<AbstractStimulusFunction>(*this);
00061 archive & mMagnitudeOfStimulus;
00062 archive & mDuration;
00063 archive & mPeriod;
00064 archive & mStartTime;
00065 archive & mStopTime;
00066 }
00067
00069 double mMagnitudeOfStimulus;
00071 double mDuration;
00073 double mPeriod;
00075 double mStartTime;
00077 double mStopTime;
00078
00079 public:
00080 RegularStimulus(double magnitudeOfStimulus, double duration, double period, double startTime, double stopTime=DBL_MAX);
00081 ~RegularStimulus();
00082 double GetStimulus(double time);
00083
00084 };
00085
00086
00087 BOOST_CLASS_EXPORT(RegularStimulus);
00088
00089 namespace boost
00090 {
00091 namespace serialization
00092 {
00097 template<class Archive>
00098 inline void load_construct_data(
00099 Archive & ar, RegularStimulus * t, const unsigned int file_version)
00100 {
00107 ::new(t)RegularStimulus(0.0, 0.0, 0.1, 0.0, 1.0);
00108 }
00109 }
00110 }
00111
00112 #endif //_REGULARSTIMULUS_HPP_