-
Notifications
You must be signed in to change notification settings - Fork 7
/
CL_classes.h
733 lines (674 loc) · 23.5 KB
/
CL_classes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
/***************************************************************************
** **
** This file is part of SpineCreator, an easy to use GUI for **
** describing spiking neural network models. **
** Copyright (C) 2013-2014 Alex Cope, Paul Richmond, Seb James **
** **
** This program is free software: you can redistribute it and/or modify **
** it under the terms of the GNU General Public License as published by **
** the Free Software Foundation, either version 3 of the License, or **
** (at your option) any later version. **
** **
** This program is distributed in the hope that it will be useful, **
** but WITHOUT ANY WARRANTY; without even the implied warranty of **
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
** GNU General Public License for more details. **
** **
** You should have received a copy of the GNU General Public License **
** along with this program. If not, see http://www.gnu.org/licenses/. **
** **
****************************************************************************
** Author: Alex Cope, Paul Richmond **
** Website/Contact: http://bimpa.group.shef.ac.uk/ **
****************************************************************************/
#ifndef NINEML_STRUCTS_H
#define NINEML_STRUCTS_H
#include "globalHeader.h"
#include "NL_systemobject.h"
// This is the number of connections there has to be for the system to
// start writing these connections into a binary file. If there are
// fewer connections than this number, the connections will be written
// inline into the XML.
#define MIN_CONNS_TO_FORCE_BINARY 30
using namespace std;
typedef enum
{
AnalogSendPort,
AnalogRecvPort,
AnalogReducePort
} AnalogPortMode;
typedef enum
{
EventSendPort,
EventRecvPort
} EventPortMode;
typedef enum
{
ImpulseSendPort,
ImpulseRecvPort
} ImpulsePortMode;
typedef enum
{
ReduceOperationAddition,
ReduceOperationNone
} ReduceOperation;
typedef enum
{
NineMLComponentType,
NineMLLayoutType
} NineMLType;
typedef enum
{
ComponentTypeNeuronBody,
ComponentTypeSynapse,
ComponentTypePostsynapse,
ComponentTypeGeneral
} ComponentType;
typedef enum
{
PREFIX_NONE,
PREFIX_G,
PREFIX_M,
PREFIX_k,
PREFIX_c,
PREFIX_m,
PREFIX_u,
PREFIX_n,
PREFIX_p,
PREFIX_f
} Prefix;
typedef enum
{
UNIT_NONE,
UNIT_V,
UNIT_Ohm,
UNIT_g,
UNIT_m,
UNIT_S,
UNIT_A,
UNIT_cd,
UNIT_mol,
UNIT_degC,
UNIT_s,
UNIT_F,
UNIT_Hz
} Unit;
class dim
{
public:
dim(QString str);
~dim(){}
int m;
int l;
int t;
int I;
int Cd;
int mol;
int temp;
int scale;
QString toString();
void fromString(QString);
void setPrefix(QString p);
void setUnit(QString u);
QString getPrefixString();
QString getUnitString();
Prefix getPrefix();
Unit getUnit();
void reset();
friend bool operator==(dim &dim1, dim &dim2);
};
/**************************** Linked items *****************************/
class Regime;
class Component;
class StateVariable;
typedef enum
{
COMPONENT_PARAMETER,
COMPONENT_ANALOG_PORT,
COMPONENT_EVENT_PORT,
COMPONENT_IMPULSE_PORT,
COMPONENT_MATHINLINE,
COMPONENT_TRIGGER,
COMPONENT_STATE_VARIABLE,
COMPONENT_ALIAS,
COMPONENT_TIME_DERIVATIVE,
COMPONENT_STATE_ASSIGNMENT,
COMPONENT_EVENT_OUT,
COMPONENT_IMPULSE_OUT,
COMPONENT_ON_CONDITION,
COMPONENT_ON_EVENT,
COMPONENT_ON_IMPULSE,
COMPONENT_REGIME,
COMPONENT
} ComponentObjectType;
/*!
* \brief The ComponentObject class is the top level object which all component type objects inherit. The type can be
* querieid from the virtual Type function which will return a ComponentObjectType. This allows objects to be re-cast
* from ComponentObjects to the correct type.
*/
class ComponentModelObject
{
public:
ComponentModelObject(){}
~ComponentModelObject(){}
virtual ComponentObjectType Type() = 0;
/*!
* A user-provided annotation about the Component.
*/
QString annotation;
/*!
* A dictionary of SpineCreator annotation texts, which live
* inside the Annotation element. The key refers to the parameter
* or state variable to which the annotation refers, the value is
* the annotation text itself.
*/
QMap<QString, QString> annotationTexts;
};
/*!
* \brief The ComponentRootObject class represents a component layer object which used to be used to hold the location
* of the original compoenent model file. It is inhereted by the ComponentLayout as is mostly defunct now that projects
* are used.
*
* TODO: Candidiate for removal
*/
class ComponentRootObject
{
public:
ComponentRootObject(){path="temp"; filePath="";}
~ComponentRootObject(){}
QString path;
QString filePath;
};
/*!
* \brief The Parameter class represent a paramater model object in the compenent layer schema. Signals are availabel for
* when the name changes so that any visual objects (graphics item type objects) can detect changes and update their
* visual representation. Functions exist for reading and writing from component XML file.
*/
class Parameter: public QObject, public ComponentModelObject {
Q_OBJECT
public:
QString getName();
void setName(QString name);
QString name;
dim * dims;
Parameter(Parameter *data);
Parameter(){dims = new dim("?");}
virtual ~Parameter(){delete dims;}
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_PARAMETER;}
/*!
* The file_name, if the data are saved as explicit binary data.
*/
QString filename;
signals:
void nameChanged();
};
/*!
* \brief The ParameterInstance class represents an instance of the data that is described by a parameter componenet.
* Put another way when the properties of a parameter are read from the network layer this is the data that is used to
* instanciate the instances which match the description of the underlying parameter object. Reading and writing functions
* are avilaable for XML and binary data formats.
*
*/
class ParameterInstance
{
public:
QString name;
dim * dims;
// value and indices might be better as a QMap
QVector < double > value;
QVector < int > indices;
ParameterType currType;
int seed;
/*!
* The file_name, if the data are saved as explicit binary data.
*/
QString filename;
ParameterInstance(Parameter *data);
ParameterInstance(ParameterInstance *data);
ParameterInstance(QString dimString){dims = new dim(dimString);}
~ParameterInstance(){delete dims;}
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
/*!
* \brief writeExplicitListNodeData
* \param xmlOut
*
* Function called to write the data for the explicit list Parameters
* and State Variables, either as XML or as binary data
*/
void writeExplicitListNodeData(QXmlStreamWriter &xmlOut);
/*!
* \brief readExplicitListNodeData
* \param n
*
* Function called to read the data for explicit list Parameters
* and State Variables, either as XML lists or binary data
*/
void readExplicitListNodeData(QDomNode &n);
};
/*!
* \brief The Port class represent a port model object in the compenent layer schema. Signals are availabel for
* when the name changes so that any visual objects (graphics item type objects) can detect changes and update their
* visual representation. Functions exist for reading and writing from component XML file.
* TODO: This should probably be a virtual class as ports are either analogue, impule or event.
*/
class Port: public QObject, public ComponentModelObject
{
Q_OBJECT
public:
QString name;
dim * dims;
Port(Port *data);
QString getName();
void setName(QString name);
Port(){dims = new dim("?"); isPost = false;}
virtual ~Port(){delete dims;}
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual bool isAnalog();
bool isPost;
signals:
void nameChanged();
};
/*!
* \brief The AnalogPort class represent an AnalogPort model object in the compenent layer schema.
*/
class AnalogPort: public Port
{
public:
AnalogPortMode mode;
ReduceOperation op;
StateVariable *variable;
AnalogPort(AnalogPort *data);
AnalogPort() : Port() {variable=NULL; op = ReduceOperationAddition; isPerConn = false;}
virtual ~AnalogPort(){}
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
bool isAnalog();
virtual ComponentObjectType Type(){return COMPONENT_ANALOG_PORT;}
int validateAnalogPort(Component *component, QStringList *);
bool isPerConn;
};
/*!
* \brief The EventPort class represent an EventPort model object in the compenent layer schema.
*/
class EventPort: public Port
{
public:
EventPortMode mode;
EventPort(EventPort *data);
EventPort() : Port() {mode=EventSendPort;}
virtual ~EventPort(){}
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
bool isAnalog();
virtual ComponentObjectType Type(){return COMPONENT_EVENT_PORT;}
};
/*!
* \brief The ImpulsePort class represent an ImpulsePort model object in the compenent layer schema.
*/
class ImpulsePort: public Port
{
public:
ImpulsePortMode mode;
Parameter *parameter;
ImpulsePort(ImpulsePort *data);
ImpulsePort() : Port() {parameter=NULL; mode=ImpulseSendPort;}
virtual ~ImpulsePort(){}
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
bool isAnalog();
virtual ComponentObjectType Type(){return COMPONENT_IMPULSE_PORT;}
int validateImpulsePort(Component *component, QStringList *);
};
/*!
* \brief The MathInLine class is a mathematical expression using terms defined in the compenent layer. It is used to
* represent the mathematics in in model objects such as Alias, OnCondition, TimeDerivative, etc.
*/
class MathInLine: public ComponentModelObject
{
public:
QString equation;
MathInLine(MathInLine *data);
MathInLine(){}
virtual ~MathInLine(){}
QString getHTMLSafeEquation();
int validateMathInLine(Component *component, QStringList * errs);
int validateMathInLine(NineMLLayout * component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_MATHINLINE;}
private:
/*!
* Remove an approved list of operators from the testequation,
* then set up a function list of allowed functions. If what
* remains in testequation is only FuncList, then the testequation
* will validate.
*/
void validateMathSetup(QString& testequation, QStringList& FuncList);
};
/*!
* \brief The Trigger class is used by OnConditions to hold some mathematic expressesions which evauluate to a conditional.
*/
class Trigger: public ComponentModelObject
{
public:
MathInLine *maths;
Trigger(Trigger *data);
Trigger(){maths=new MathInLine;}
virtual ~Trigger();
int validateTrigger(Component *component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_TRIGGER;}
};
/*!
* \brief The StateVariable class represent a StateVariable model object in the compenent layer schema. It
* is a type of parameter and can be used as such in mathmatic expressions.
*/
class StateVariable: public Parameter
{
public:
StateVariable(StateVariable *data);
StateVariable() : Parameter() {}
virtual ~StateVariable();
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_STATE_VARIABLE;}
};
/*!
* \brief The StateVariableInstance class represents an instance of the data that is described by a StateVariable componenet.
* Put another way when the properties of a state variable are read from the network layer this is the data that is used to
* instanciate the instances which match the description of the underlying state variable object. Reading and writing functions
* are avilaable for XML and binary data formats.
*/
class StateVariableInstance: public ParameterInstance
{
public:
StateVariableInstance(StateVariable *data);
StateVariableInstance(StateVariableInstance *data);
//StateVariableData(){}
virtual ~StateVariableInstance(){}
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
};
/*!
* \brief The Alias class represents an mathmatic expression which can then be used a state variable in expressions.
*/
class Alias: public StateVariable
{
public:
//QString name;
//dim * dims;
MathInLine* maths;
Alias(Alias *data);
Alias(): StateVariable() {maths=new MathInLine();}
virtual ~Alias();
int validateAlias(Component *component, QStringList * errs);
int validateAlias(NineMLLayout *component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_ALIAS;}
};
/*!
* \brief The TimeDerivative class is an object for holding data of a time derivative defined in the component layer schema.
* Usual component layer functiosn exist for file reading/writing.
*/
class TimeDerivative: public ComponentModelObject
{
public:
// temp name
QString variable_name;
StateVariable *variable;
MathInLine* maths;
TimeDerivative(TimeDerivative *data);
TimeDerivative(){variable=NULL; maths=new MathInLine;}
virtual ~TimeDerivative();
int validateTimeDerivative(Component *component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_TIME_DERIVATIVE;}
};
/*!
* \brief The StateAssignment class is an object for holding data of a state assignment defined in the component layer schema.
* Usual component layer functiosn exist for file reading/writing.
*/
class StateAssignment: public ComponentModelObject
{
public:
// temp name
QString name;
StateVariable *variable;
MathInLine *maths;
StateAssignment(StateAssignment *data);
StateAssignment(){variable=NULL; maths=new MathInLine;}
virtual ~StateAssignment();
int validateStateAssignment(Component *component, QStringList *);
int validateStateAssignment(NineMLLayout *component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_STATE_ASSIGNMENT;}
};
/*!
* \brief The EventOut class is an object for holding data of a EventOutt defined in the component layer schema.
* Usual component layer functions exist for file reading/writing.
*/
class EventOut: public ComponentModelObject
{
public:
// temp name
QString port_name;
EventPort *port;
EventOut(EventOut *);
EventOut(){port=NULL;}
virtual ~EventOut(){}
int validateEventOut(Component *component, QStringList *);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_EVENT_OUT;}
};
/*!
* \brief The ImpulseOut class is an object for holding data of a ImpulseOut defined in the component layer schema.
* Usual component layer functions exist for file reading/writing.
*/
class ImpulseOut: public ComponentModelObject
{
public:
// temp name
QString port_name;
ImpulsePort *port;
ImpulseOut(ImpulseOut *);
ImpulseOut(){port=NULL;}
virtual ~ImpulseOut(){}
int validateImpulseOut(Component *component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_IMPULSE_OUT;}
};
/*!
* \brief The OnCondition class is an obect for holding data of a OnCondition defined in the component layer schema. I.e a
* transition between regimes. It therefore needs to have a target regime and will be owned by another regime.
* Usual component layer functions exist for file reading/writing.
*/
class OnCondition: public ComponentModelObject
{
public:
// temp name
QString target_regime_name;
Regime *target_regime;
QVector <StateAssignment*> StateAssignList;
Trigger *trigger;
QVector <EventOut*> eventOutList;
QVector <ImpulseOut*> impulseOutList;
OnCondition(OnCondition *data);
OnCondition(){target_regime=NULL; trigger=new Trigger;}
virtual ~OnCondition();
int validateOnCondition(Component *component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_ON_CONDITION;}
};
/*!
* \brief The OnEvent class is an object for holding data of a OnEvent defined in the component layer schema. I.e a
* transition between regimes. It therefore needs to have a target regime and will be owned by another regime.
* Usual component layer functions exist for file reading/writing.
*/
class OnEvent: public ComponentModelObject
{
public:
// temp name
QString target_regime_name;
QString src_port_name;
Regime *target_regime;
EventPort *src_port;
QVector <StateAssignment*> StateAssignList;
QVector <EventOut*> eventOutList;
QVector <ImpulseOut*> impulseOutList;
OnEvent(OnEvent *data);
OnEvent(){target_regime=NULL; src_port=NULL;}
virtual ~OnEvent();
int validateOnEvent(Component *component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_ON_EVENT;}
};
/*!
* \brief The OnImpulse class is an object for holding data of a OnImpulse defined in the component layer schema. I.e a
* transition between regimes. It therefore needs to have a target regime and will be owned by another regime.
* Usual component layer functions exist for file reading/writing.
*/
class OnImpulse: public ComponentModelObject
{
public:
// temp name
QString target_regime_name;
QString src_port_name;
Regime *target_regime;
ImpulsePort *src_port;
QVector <StateAssignment*> StateAssignList;
QVector <EventOut*> eventOutList;
QVector <ImpulseOut*> impulseOutList;
OnImpulse(OnImpulse *data);
OnImpulse(){target_regime=NULL; src_port=NULL;}
virtual ~OnImpulse();
int validateOnImpulse(Component *component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_ON_IMPULSE;}
};
/*!
* \brief The Regime class is an object for holding data of a Regime defined in the component layer schema.
*/
class Regime: public ComponentModelObject
{
public:
QString name;
QVector <TimeDerivative*> TimeDerivativeList;
QVector <OnCondition* > OnConditionList;
QVector <OnEvent*> OnEventList;
QVector <OnImpulse*> OnImpulseList;
Regime(Regime *data);
Regime(){}
virtual ~Regime();
int validateRegime(Component *component, QStringList * errs);
void readIn(QDomElement e);
void writeOut(QDomDocument *doc, QDomElement &parent);
virtual ComponentObjectType Type(){return COMPONENT_REGIME;}
};
/*!
* \brief The Component class is the data object which holds all data representing a component. I.e. all the regimes,
* ports, paramaters, state variables etc. It is the root holder of these objects and stores many of them in vectors.
* It is responsible for ownership.
*/
class Component: public ComponentModelObject, public ComponentRootObject
{
public:
//temp name
QString initial_regime_name;
QString name;
QString type;
bool islearning;
Regime *initial_regime;
QVector <Regime*> RegimeList;
QVector <StateVariable*> StateVariableList;
QVector <Parameter*> ParameterList;
QVector <Alias*> AliasList;
QVector <AnalogPort*> AnalogPortList;
QVector <EventPort*> EventPortList;
QVector <ImpulsePort*> ImpulsePortList;
Component(QSharedPointer<Component>data);
Component& operator=(const Component& data);
Component();
virtual ~Component();
void updateFrom(QSharedPointer<Component>data);
QStringList validateComponent();
void load(QDomDocument *doc);
void write(QDomDocument *doc);
virtual ComponentObjectType Type(){return COMPONENT;}
QUndoStack undoStack;
QSharedPointer<Component> editedVersion;
QString getXMLName();
};
/*!
* \brief The ComponentRootInstance class is a virtual class that represents an instance of the data that is described by a
* whole component or layout.
* Put another way when the properties of a whole component are read from the network layer this is the data that is used to
* instanciate the instances which match the description of the underlying parameter and state variable objects.
*
*/
class ComponentRootInstance
{
public:
NineMLType type;
QVector <StateVariableInstance*> StateVariableList;
QVector <ParameterInstance*> ParameterList;
void write_node_xml(QXmlStreamWriter &);
ComponentRootInstance(){}
virtual ~ComponentRootInstance(){}
/*!
* The annotation. Read with
* ComponentInstance::import_parameters_from_xml, which may be
* passed an option NOT to read annotation information.
*/
QString annotation;
};
/*!
* \brief The ComponentInstance class derives from the ComponentRootInstance class but is specific for SpineML Components and not Layouts.
*/
class ComponentInstance: public ComponentRootInstance
{
public:
QVector < QSharedPointer<genericInput> > inputs;
QVector < QSharedPointer<genericInput> > outputs;
QSharedPointer<Component> component;
ComponentInstance(QSharedPointer<Component>data);
ComponentInstance(QSharedPointer <ComponentInstance>data, bool copy_io = false);
void remapPointers(QMap <systemObject *, QSharedPointer <systemObject> > pointerMap);
void copyFrom(QSharedPointer <ComponentInstance>, QSharedPointer<Component>, QSharedPointer<ComponentInstance> thisSharedPointer);
ComponentInstance& operator=(const ComponentInstance& data);
ComponentInstance(){}
virtual ~ComponentInstance();
QString getXMLName();
int getSize();
void matchPorts();
QStringList getPortMatches(int index, bool isOutput);
void removeReferences();
QSharedPointer<systemObject> owner;
void import_parameters_from_xml(QDomNode &e);
void migrateComponent(QSharedPointer<Component> newComponent);
void addInput(QSharedPointer <ComponentInstance>, bool = false);
void copyParsFrom(QSharedPointer <ComponentInstance> data);
/*!
* This function first tests if this ComponentInstance is an
* instance of a LL:WeightUpdate or WeightUpdate component. If
* not, it returns a null pointer.
*
* If SO, then it then finds the Property "w" (or the first
* Property if there is none called "w") and returns its
* ParameterInstance*
*/
ParameterInstance* getWeightsParameter (void);
};
#endif // NINEML_STRUCTS_H