Main Page | Namespace List | Alphabetical List | Class List | Directories | File List | Class Members | File Members

TaskHolder Class Reference

#include <TaskHolder.h>

List of all members.

Public Member Functions

 TaskHolder (int thisTaskID, int primaryDestTaskID)
 ~TaskHolder ()
void addReceivingTask (int)
void printBuffers ()
void removeReceivingTask (int)
bool sendSpikeMessages ()
void setMaxBufferSize (int maxSize)

Private Member Functions

 TaskHolder (const TaskHolder &)
TaskHolder operator= (const TaskHolder &)

Private Attributes

int thisTaskID
int primaryDestinationID
vector< ConnectionHolder * > spikeMessageBuffer [NUMBER_OF_DELAY_VALUES]
unsigned int messageSpikeCount [NUMBER_OF_DELAY_VALUES]
unsigned int maxBufferSize
unsigned int bufferCounter
int * destinationTaskIDs
int numberOfTasks

Friends

class Neuron


Detailed Description

Used to send a list of spikes to a specific task or number of tasks Mainly created to send a list of spikes to a specific task. However it can also send spike lists to several tasks to support monitoring and recording functions.

Definition at line 42 of file TaskHolder.h.


Constructor & Destructor Documentation

TaskHolder::TaskHolder int  thisTID,
int  destTID
 

Constructor.

Definition at line 37 of file TaskHolder.cpp.

References bufferCounter, destinationTaskIDs, messageSpikeCount, numberOfTasks, primaryDestinationID, and thisTaskID.

TaskHolder::~TaskHolder  ) 
 

Destructor.

Definition at line 60 of file TaskHolder.cpp.

References destinationTaskIDs, numberOfTasks, and thisTaskID.

TaskHolder::TaskHolder const TaskHolder  )  [private]
 

Declare copy constructor private so it cannot be used inadvertently.


Member Function Documentation

void TaskHolder::addReceivingTask int  newTaskID  ) 
 

Adds a receiving task to the task array. Done in this clunky way because the broadcast message function in pvm needs an integer array, not a vector, as one of its arguments.

Definition at line 78 of file TaskHolder.cpp.

References destinationTaskIDs, and numberOfTasks.

TaskHolder TaskHolder::operator= const TaskHolder  )  [private]
 

Declare assignment private so it cannot be used.

void TaskHolder::printBuffers  ) 
 

Debug method that prints out the contents of the spike message buffer.

Definition at line 108 of file TaskHolder.cpp.

References bufferCounter, messageSpikeCount, spikeMessageBuffer, and thisTaskID.

void TaskHolder::removeReceivingTask int  taskID  ) 
 

Removes a receiving task from the task holder.

Definition at line 127 of file TaskHolder.cpp.

References destinationTaskIDs, numberOfTasks, primaryDestinationID, and thisTaskID.

bool TaskHolder::sendSpikeMessages  ) 
 

Sends spike messages to other tasks and this task.

Definition at line 167 of file TaskHolder.cpp.

References bufferCounter, destinationTaskIDs, SimulationClock::getTimeStep(), messageSpikeCount, numberOfTasks, primaryDestinationID, SpikeStreamSimulation::simulationClock, spikeMessageBuffer, and thisTaskID.

void TaskHolder::setMaxBufferSize int  maxBSize  ) 
 

Allocates memory for all the spike vectors to save incrementally increasing their size This maximum number is likely to be close to the number of neurons in the task since each of these could add a connection holder for any point in time.

Definition at line 272 of file TaskHolder.cpp.

References maxBufferSize, and spikeMessageBuffer.


Friends And Related Function Documentation

friend class Neuron [friend]
 

Neuron class needs access to some of the private data members so that it can copy its connection holders into this class when it fires.

Definition at line 56 of file TaskHolder.h.


Member Data Documentation

unsigned int TaskHolder::bufferCounter [private]
 

Controls which is the current spike array. This is the spike array that will be sent when sendSpikes() is called.

Definition at line 84 of file TaskHolder.h.

Referenced by Neuron::fireNeuron(), printBuffers(), sendSpikeMessages(), and TaskHolder().

int* TaskHolder::destinationTaskIDs [private]
 

Array of task IDs of the tasks that will be sent the spike lists held in this task holder. There will be a main task id containing the other neuron groups that need to receive the spike list and there may also be tasks that need to receive the spike list for monitoring or archiving. This is stored as an integer array to make it simpler to send using pvm_mcast. Vector would have to be converted.

Definition at line 91 of file TaskHolder.h.

Referenced by addReceivingTask(), removeReceivingTask(), sendSpikeMessages(), TaskHolder(), and ~TaskHolder().

unsigned int TaskHolder::maxBufferSize [private]
 

The maximum size of the arrays held in spikeArrays. This will be the number of neurons in the other task that the neurons in this task are connected to.

Definition at line 80 of file TaskHolder.h.

Referenced by setMaxBufferSize().

unsigned int TaskHolder::messageSpikeCount[NUMBER_OF_DELAY_VALUES] [private]
 

Records how many spikes are in each message buffer. This is different from the message buffer length, which holds how many Connection holders are in the message buffer. Each connection holder can hold many spikes so the spike count needs to be done separately.

Definition at line 75 of file TaskHolder.h.

Referenced by Neuron::fireNeuron(), printBuffers(), sendSpikeMessages(), and TaskHolder().

int TaskHolder::numberOfTasks [private]
 

Size of the destination task id array.

Definition at line 94 of file TaskHolder.h.

Referenced by addReceivingTask(), removeReceivingTask(), sendSpikeMessages(), TaskHolder(), and ~TaskHolder().

int TaskHolder::primaryDestinationID [private]
 

The taskID of the primary destination for spike lists from this task. This should be another task processing neurons.

Definition at line 66 of file TaskHolder.h.

Referenced by Neuron::fireNeuron(), removeReceivingTask(), sendSpikeMessages(), and TaskHolder().

vector<ConnectionHolder*> TaskHolder::spikeMessageBuffer[NUMBER_OF_DELAY_VALUES] [private]
 

Array of vectors containing pointers to connection holders that hold the spike data that is to be sent.

Definition at line 70 of file TaskHolder.h.

Referenced by Neuron::fireNeuron(), printBuffers(), sendSpikeMessages(), and setMaxBufferSize().

int TaskHolder::thisTaskID [private]
 

Keep a record of this task here for error messages.

Definition at line 62 of file TaskHolder.h.

Referenced by printBuffers(), removeReceivingTask(), sendSpikeMessages(), TaskHolder(), and ~TaskHolder().


The documentation for this class was generated from the following files:
Generated on Mon Sep 3 22:24:34 2007 for SpikeStream Simulation by  doxygen 1.4.4