00001 #include "SpikeSender.h" 00002 00003 #include <utility> 00004 00005 using std::make_pair; 00006 00007 MultipleOutputSpikeSender::MultipleOutputSpikeSender( void ) 00008 { 00009 out_ports.resize(0); 00010 } 00011 00012 MultipleOutputSpikeSender::~MultipleOutputSpikeSender( void ) 00013 { 00014 00015 for (out_ports_t::iterator i = out_ports.begin(); i != out_ports.end(); i++) 00016 delete i->second; 00017 } 00018 00019 00020 SpikeOutputPort *MultipleOutputSpikeSender::getSpikePort(size_t p) 00021 { 00022 if( out_ports.find(p) != out_ports.end() ) 00023 return out_ports[p]; 00024 else 00025 return NULL; 00026 } 00027 00028 void MultipleOutputSpikeSender::defineSpikeOutputPort( size_t n ) 00029 { 00030 out_ports.insert(make_pair(n, new SpikeOutputPort )); 00031 } 00032 00033 void MultipleOutputSpikeSender::reset() 00034 { 00035 for (out_ports_t::iterator i= out_ports.begin(); i != out_ports.end(); i++) 00036 i->second->clearSpike(); 00037 }