9 #include "CsNeuralModule.h"
11 #include "CsSpikeGeneratorGroup.h"
13 #include "CsSynapseOneToOne.h"
14 #include "CsSynapseFull.h"
15 #include "CsSynapseRandom.h"
16 #include "CsSynapseIndividual.h"
21 #include "CsClassFactory.h"
56 if(strType ==
"NEURONGROUP")
58 else if(strType ==
"SPIKEGENERATORGROUP")
64 THROW_PARAM_ERROR(Cs_Err_lInvalidNeuronType, Cs_Err_strInvalidNeuronType,
"NeuronType", strType);
69 catch(CStdErrorInfo oError)
71 if(lpNeuron)
delete lpNeuron;
77 if(lpNeuron)
delete lpNeuron;
78 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
98 if(strType ==
"ONETOONESYNAPSE")
100 else if(strType ==
"FULLSYNAPSE")
102 else if(strType ==
"RANDOMSYNAPSE")
104 else if(strType ==
"INDIVIDUALSYNAPSE")
106 else if(strType ==
"SPIKINGCURRENTSYNAPSE")
112 THROW_PARAM_ERROR(Cs_Err_lInvalidSynapseType, Cs_Err_strInvalidSynapseType,
"SynapseType", strType);
117 catch(CStdErrorInfo oError)
119 if(lpSynapse)
delete lpSynapse;
125 if(lpSynapse)
delete lpSynapse;
126 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
139 NeuralModule *lpModule=NULL;
145 if(strType ==
"CARLSIMNEURALMODULE")
151 THROW_PARAM_ERROR(Al_Err_lInvalidNeuralModuleType, Al_Err_strInvalidNeuralModuleType,
"NeuralModule", strType);
156 catch(CStdErrorInfo oError)
158 if(lpModule)
delete lpModule;
164 if(lpModule)
delete lpModule;
165 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
183 if(strType ==
"FIRINGRATE")
189 THROW_PARAM_ERROR(Al_Err_lInvalidExternalStimulusType, Al_Err_strInvalidExternalStimulusType,
"ExternalStimulusType", strType);
194 catch(CStdErrorInfo oError)
196 if(lpStimulus)
delete lpStimulus;
202 if(lpStimulus)
delete lpStimulus;
203 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
213 DataColumn *CsClassFactory::CreateDataColumn(std::string strType,
bool bThrowError)
215 DataColumn *lpColumn=NULL;
221 if(strType ==
"NEURONDATACOLUMN")
227 THROW_PARAM_ERROR(Al_Err_lInvalidDataColumnType, Al_Err_strInvalidDataColumnType,
"DataColumnType", strType);
232 catch(CStdErrorInfo oError)
234 if(lpColumn)
delete lpColumn;
240 if(lpColumn)
delete lpColumn;
241 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
251 Adapter *CsClassFactory::CreateAdapter(std::string strType,
bool bThrowError)
253 Adapter *lpAdapter=NULL;
259 if(strType ==
"NODETONODE")
261 else if(strType ==
"PHYSICALTONODE")
267 THROW_PARAM_ERROR(Al_Err_lInvalidAdapterType, Al_Err_strInvalidAdapterType,
"AdapterType", strType);
272 catch(CStdErrorInfo oError)
274 if(lpAdapter)
delete lpAdapter;
280 if(lpAdapter)
delete lpAdapter;
281 THROW_ERROR(Std_Err_lUnspecifiedError, Std_Err_strUnspecifiedError);
292 CStdSerialize *CsClassFactory::CreateObject(std::string strClassType, std::string strObjectType,
bool bThrowError)
298 if(strClassType ==
"NEURON")
300 else if(strClassType ==
"SYNAPSE")
302 else if(strClassType ==
"NEURALMODULE")
304 else if(strClassType ==
"EXTERNALSTIMULUS")
306 else if(strClassType ==
"DATACOLUMN")
307 lpObject = CreateDataColumn(strObjectType, bThrowError);
308 else if(strClassType ==
"ADAPTER")
309 lpObject = CreateAdapter(strObjectType, bThrowError);
314 THROW_PARAM_ERROR(Std_Err_lInvalidClassType, Std_Err_strInvalidClassType,
"ClassType", strClassType);
325 extern "C" __declspec(dllexport)
IStdClassFactory* __cdecl GetStdClassFactory()
Contains the classes for a firing rate neural model.
virtual ExternalStimulus * CreateExternalStimulus(std::string strType, bool bThrowError=true)
Creates an external stimuli.
Declares the CsNeuronGroup class.
virtual ~CsClassFactory()
Destructor.
Firing rate synapse model.
Firing rate synapse model.
std::string Std_Trim(std::string strVal)
Trims a string.
Firing rate neural module.
Base class for all link type objects. This is typically used for synapses.
virtual Node * CreateNeuron(std::string strType, bool bThrowError=true)
Creates a neuron.
Declares the current stimulus class.
Declares the synapse class.
Current stimulus for neural items.
Firing Rate Neuron model.
Declares the synapse class.
Firing rate synapse model.
Declares the current stimulus class.
Firing rate synapse model.
Firing rate neural module class factory.
Carlsim Data column class.
virtual NeuralModule * CreateNeuralModule(std::string strType, bool bThrowError=true)
Creates a neural module.
Firing rate synapse model.
CsClassFactory()
Default constructor.
std::string Std_ToUpper(std::string strVal)
Converts a string to upper case.
virtual AnimatSim::Link * CreateSynapse(std::string strType, bool bThrowError=true)
Creates a synapse.
Declares the data column class.
Current stimulus for neural items.
Firing Rate Neuron model.