00001 #ifndef SPIKETIMERECORDER_H_ 00002 #define SPIKETIMERECORDER_H_ 00003 00004 #include "SimObject.h" 00005 00006 #include <vector> 00007 00008 class SpikeTimeRecorder : public SimObject 00009 { 00010 00011 SIMOBJECT( SpikeTimeRecorder, AdvancePhase::None ) 00012 00013 public: 00014 00015 SpikeTimeRecorder(); 00016 00017 // virtual ~SpikeTimeRecorder(); 00018 virtual int reset( double dt ); 00019 00020 virtual int spikeHit( spikeport_t port, SpikeEvent const& spike ); 00021 00022 const std::vector<double> &getSpikeTimes(void) const; 00023 00024 const std::vector<double> &getRecordedValues(void) const 00025 { 00026 return getSpikeTimes(); 00027 } 00028 00029 00030 size_t spikeCount() const; 00031 00032 void printSpikeTimes(void); 00033 00034 // virtual double getLastSpikeTime() { return -1; }; 00035 // virtual bool firedQ() { return false; }; 00036 00037 virtual double getManagedDelay() const { return 0; } 00038 00039 virtual int nSpikeInputPorts() const { return 1; }; 00040 virtual int nAnalogInputPorts() const { return 0; }; 00041 virtual PortType inputPortType(port_t i) const { if( i==0) return spiking; else return undefined; }; 00042 00043 virtual int nSpikeOutputPorts() const { return 0; }; 00044 virtual int nAnalogOutputPorts() const { return 0; }; 00045 virtual PortType outputPortType(port_t o) const { return undefined; }; 00046 00047 private: 00048 friend class DistributedSingleThreadNetworkTest; 00049 friend class DistributedMultiThreadNetworkTest; 00050 friend class STandMTSpikeExchangeTest; 00051 friend class DistributedAnalogCommunicationFinalTest; 00052 std::vector<double> &spikeVec(void); 00053 00054 private: 00055 std::vector<double> spikes; 00056 }; 00057 00058 #endif /*SPIKETIMERECORDER_H_*/