SpikeStream Library  0.2
ConnectionGroup.h
Go to the documentation of this file.
00001 #ifndef CONNECTIONGROUP_H
00002 #define CONNECTIONGROUP_H
00003 
00004 //SpikeStream includes
00005 #include "Connection.h"
00006 #include "ConnectionGroupInfo.h"
00007 using namespace spikestream;
00008 
00009 //Other includes
00010 #include <deque>
00011 using namespace std;
00012 
00014 typedef deque<Connection>::iterator ConnectionIterator;
00015 
00016 namespace spikestream {
00017 
00019     class ConnectionGroup {
00020                 public:
00021                         ConnectionGroup();
00022                         ConnectionGroup(const ConnectionGroupInfo& connGrpInfo);
00023                         ~ConnectionGroup();
00024                         unsigned addConnection(unsigned id, unsigned fromNeuronID, unsigned toNeuronID, float delay, float weight);
00025                         unsigned addConnection(unsigned int fromNeuronID, unsigned int toNeuronID, float delay, float weight);
00026                         ConnectionIterator begin();
00027                         void clearConnections();
00028                         ConnectionIterator end();
00029                         unsigned int getID() { return info.getID(); }
00030                         unsigned int getFromNeuronGroupID() { return info.getFromNeuronGroupID(); }
00031                         ConnectionGroupInfo getInfo() { return info; }
00032                         double getParameter(const QString& paramName);
00033                         QHash<QString, double> getParameters() { return parameterMap; }
00034                         unsigned getSynapseTypeID();
00035                         unsigned int getToNeuronGroupID() { return info.getToNeuronGroupID(); }
00036                         Connection& operator[] (unsigned index);
00037                         bool parametersSet();
00038                         void print(bool printConnections = false);
00039                         void setDescription(const QString& description);
00040                         void setFromNeuronGroupID(unsigned id);
00041                         void setID(unsigned int id) { info.setID(id); }
00042                         void setParameters(QHash<QString, double>& paramMap);
00043                         void setToNeuronGroupID(unsigned id);
00044                         int size() { return connectionDeque->size(); }
00045 
00046                 private:
00049                         ConnectionGroupInfo info;
00050 
00052                         deque<Connection>* connectionDeque;
00053 
00055                         QHash<QString, double> parameterMap;
00056 
00059                         static unsigned connectionIDCounter;
00060 
00061 
00062                    //====================  METHODS  ==========================
00063                    static unsigned getTemporaryID();
00064                    ConnectionGroup(const ConnectionGroup& connGrp);
00065                    ConnectionGroup& operator=(const ConnectionGroup& rhs);
00066                 };
00067 
00068 }
00069 
00070 #endif//CONNECTIONGROUP_H
00071 
 All Classes Files Functions Variables Typedefs Defines