00001 #ifndef SPIKEOUTPUTPORT_H_ 00002 #define SPIKEOUTPUTPORT_H_ 00003 00004 #include "globaldefinitions.h" 00005 00006 class AdvanceInfo; 00007 00008 class SpikeOutputPort 00009 { 00010 public: 00011 SpikeOutputPort(void) : _hasSpike(false), _spikeTime(-1), _id( INVALID_SPIKE_PORT_ID ) {}; 00012 00013 void setSpike( AdvanceInfo const &ai ); 00014 void setSpike( AdvanceInfo const &ai, double t ); 00015 void setSpikeByOffset( AdvanceInfo const &ai, double delta, bool calcSpikeTime=true ); 00016 void setSpikeByOffsetFraction( AdvanceInfo const &ai, float k, bool calcSpikeTime=true ); 00017 00018 inline void clearSpike() { _hasSpike = false; _spikeTime=-1; }; 00019 inline bool hasSpike() { return _hasSpike; }; 00020 inline double spikeTime() { return _spikeTime; }; 00021 inline spike_port_id_t ID() { return _id; }; 00022 00023 protected: 00024 friend class SingleThreadSimEngine; 00025 inline void setID( spike_port_id_t id ) { _id = id; }; 00026 00027 private: 00028 bool _hasSpike; 00029 double _spikeTime; 00030 spike_port_id_t _id; 00031 00032 }; 00033 00034 #endif /*SPIKEOUTPUTPORT_H_*/