NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Private Attributes | List of all members
nest::MusicEventHandler Class Reference

Event handler for all events of a MUSIC port received on this process. More...

#include <music_event_handler.h>

Inheritance diagram for nest::MusicEventHandler:

Public Member Functions

 MusicEventHandler ()
 
 MusicEventHandler (std::string portname, double acceptable_latency, int max_buffered, Network *net)
 
virtual ~MusicEventHandler ()
 
void register_channel (int channel, nest::Node *mp)
 Register a new node to a specific channel on this port. More...
 
void publish_port ()
 Publish the MUSIC port. More...
 
void operator() (double t, MUSIC::GlobalIndex channel)
 Called by MUSIC from within tick() to deliver events to NEST. More...
 
void update (Time const &, const long_t, const long_t)
 This function is called by the scheduler and delivers the queued events to the target music_in_proxies. More...
 

Private Attributes

MUSIC::EventInputPort * music_port_
 
MUSIC::PermutationIndex * music_perm_ind_
 
bool published_
 
std::string portname_
 
std::vector< nest::Node * > channelmap_
 Maps channel number to music_event_in_proxy. More...
 
std::vector< MUSIC::GlobalIndex > indexmap_
 Maps local index to global MUSIC index (channel) More...
 
double acceptable_latency_
 The acceptable latency of the port in ms. More...
 
int max_buffered_
 
Networknet_
 Pointer to global network driver. More...
 
std::vector
< std::priority_queue< double,
std::vector< double >
, std::greater< double > > > 
eventqueue_
 Buffers incoming spike events until they are due. More...
 

Detailed Description

Event handler for all events of a MUSIC port received on this process.

Constructor & Destructor Documentation

nest::MusicEventHandler::MusicEventHandler ( )
nest::MusicEventHandler::MusicEventHandler ( std::string  portname,
double  acceptable_latency,
int  max_buffered,
Network net 
)
nest::MusicEventHandler::~MusicEventHandler ( )
virtual

Member Function Documentation

void nest::MusicEventHandler::operator() ( double  t,
MUSIC::GlobalIndex  channel 
)

Called by MUSIC from within tick() to deliver events to NEST.

This function only queues the events. Delivery to the targets takes place in update().

References assert(), channelmap_, and eventqueue_.

void nest::MusicEventHandler::publish_port ( )

Publish the MUSIC port.

This method has to be called once before the first simulation to tell MUSIC which channels lie on which processor.

References acceptable_latency_, channelmap_, nest::Communicator::get_music_setup(), indexmap_, SLIInterpreter::M_INFO, max_buffered_, nest::Network::message(), music_perm_ind_, music_port_, net_, portname_, and published_.

void nest::MusicEventHandler::register_channel ( int  channel,
nest::Node mp 
)

Register a new node to a specific channel on this port.

References channelmap_, eventqueue_, indexmap_, and portname_.

Referenced by nest::Network::register_music_event_in_proxy().

void nest::MusicEventHandler::update ( Time const &  origin,
const long_t  from,
const long_t  to 
)

This function is called by the scheduler and delivers the queued events to the target music_in_proxies.

References acceptable_latency_, channelmap_, eventqueue_, nest::Time::get_ms(), nest::Time::get_steps(), nest::Time::ms, nest::Event::set_offset(), and nest::Event::set_stamp().

Member Data Documentation

double nest::MusicEventHandler::acceptable_latency_
private

The acceptable latency of the port in ms.

Referenced by publish_port(), and update().

std::vector<nest::Node*> nest::MusicEventHandler::channelmap_
private

Maps channel number to music_event_in_proxy.

Referenced by operator()(), publish_port(), register_channel(), and update().

std::vector< std::priority_queue< double, std::vector<double>, std::greater<double> > > nest::MusicEventHandler::eventqueue_
private

Buffers incoming spike events until they are due.

The vector has one entry per channel. The priority queues used within the vector implement min-heaps stored in vectors.

Referenced by operator()(), register_channel(), and update().

std::vector<MUSIC::GlobalIndex> nest::MusicEventHandler::indexmap_
private

Maps local index to global MUSIC index (channel)

Referenced by publish_port(), and register_channel().

int nest::MusicEventHandler::max_buffered_
private

Referenced by publish_port().

MUSIC::PermutationIndex* nest::MusicEventHandler::music_perm_ind_
private

Referenced by publish_port(), and ~MusicEventHandler().

MUSIC::EventInputPort* nest::MusicEventHandler::music_port_
private

Referenced by publish_port(), and ~MusicEventHandler().

Network* nest::MusicEventHandler::net_
private

Pointer to global network driver.

Referenced by publish_port().

std::string nest::MusicEventHandler::portname_
private

Referenced by publish_port(), and register_channel().

bool nest::MusicEventHandler::published_
private

Referenced by publish_port(), and ~MusicEventHandler().


The documentation for this class was generated from the following files: