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 _SIMPLESTIMULUS_HPP_
00031 #define _SIMPLESTIMULUS_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
00046 class SimpleStimulus : public AbstractStimulusFunction
00047 {
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 & mTimeOfStimulus;
00064 }
00065
00066 private:
00068 double mMagnitudeOfStimulus;
00070 double mDuration;
00072 double mTimeOfStimulus;
00073
00074 public:
00075
00083 SimpleStimulus(double magnitudeOfStimulus, double duration, double timeOfStimulus=0.0);
00084
00088 virtual ~SimpleStimulus();
00089
00095 double GetStimulus(double time);
00096 };
00097
00098
00099
00100 BOOST_CLASS_EXPORT(SimpleStimulus);
00101
00102 namespace boost
00103 {
00104 namespace serialization
00105 {
00110 template<class Archive>
00111 inline void load_construct_data(
00112 Archive & ar, SimpleStimulus * t, const unsigned int file_version)
00113 {
00120 ::new(t)SimpleStimulus(0.0, 0.0, 0.0);
00121 }
00122 }
00123 }
00124
00125 #endif //_SIMPLESTIMULUS_HPP_
00126