Skip to content

Commit 6594cac

Browse files
authored
Merge pull request #469 from sbmlteam/only-call-loadPlugins-once
Only call loadPlugins once in constructors.
2 parents d7c1324 + 0d5f604 commit 6594cac

36 files changed

+392
-562
lines changed

src/sbml/packages/distrib/sbml/DistribBase.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ DistribBase::DistribBase(DistribPkgNamespaces *distribns)
8080
, mElementName("distribBase")
8181
{
8282
setElementNamespace(distribns->getURI());
83+
connectToChild();
8384
loadPlugins(distribns);
8485
}
8586

src/sbml/packages/distrib/sbml/UncertParameter.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,12 @@ UncertParameter::UncertParameter(DistribPkgNamespaces *distribns)
9595
, mUncertParameters (new ListOfUncertParameters (distribns))
9696
, mMath (NULL)
9797
{
98-
setElementNamespace(distribns->getURI());
9998
connectToChild();
100-
loadPlugins(distribns);
99+
//
100+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
101+
// in this constuctor because the functions are properly invoked in the constructor of the
102+
// base class (DistribBase).
103+
//
101104
}
102105

103106

src/sbml/packages/distrib/sbml/UncertSpan.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,12 @@ UncertSpan::UncertSpan(DistribPkgNamespaces *distribns)
8787
, mValueUpper (util_NaN())
8888
, mIsSetValueUpper (false)
8989
{
90-
setElementNamespace(distribns->getURI());
91-
loadPlugins(distribns);
90+
connectToChild();
91+
//
92+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
93+
// in this constuctor because the functions are properly invoked in the constructor of the
94+
// base class (UncertParameter).
95+
//
9296
}
9397

9498

src/sbml/packages/distrib/sbml/Uncertainty.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ Uncertainty::Uncertainty(DistribPkgNamespaces *distribns)
8080
: DistribBase(distribns)
8181
, mUncertParameters (distribns)
8282
{
83-
setElementNamespace(distribns->getURI());
8483
connectToChild();
85-
loadPlugins(distribns);
84+
//
85+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
86+
// in this constuctor because the functions are properly invoked in the constructor of the
87+
// base class (DistribBase).
88+
//
8689
}
8790

8891

src/sbml/packages/fbc/sbml/FbcAnd.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,12 @@ FbcAnd::FbcAnd (FbcPkgNamespaces* fbcns)
8080
: FbcAssociation(fbcns)
8181
, mAssociations (fbcns)
8282
{
83-
// set the element namespace of this object
84-
setElementNamespace(fbcns->getURI());
85-
86-
// connect to child objects
8783
connectToChild();
88-
89-
// load package extensions bound with this object (if any)
90-
loadPlugins(fbcns);
84+
//
85+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
86+
// in this constuctor because the functions are properly invoked in the constructor of the
87+
// base class (FbcAssociation).
88+
//
9189
}
9290

9391

src/sbml/packages/fbc/sbml/FbcOr.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@ FbcOr::FbcOr (FbcPkgNamespaces* fbcns)
8181
: FbcAssociation(fbcns)
8282
, mAssociations (fbcns)
8383
{
84-
// set the element namespace of this object
85-
setElementNamespace(fbcns->getURI());
86-
87-
// connect to child objects
8884
connectToChild();
89-
90-
// load package extensions bound with this object (if any)
91-
loadPlugins(fbcns);
85+
//
86+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
87+
// in this constuctor because the functions are properly invoked in the constructor of the
88+
// base class (FbcAssociation).
89+
//
9290
}
9391

9492

src/sbml/packages/fbc/sbml/GeneProductRef.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ GeneProductRef::GeneProductRef (FbcPkgNamespaces* fbcns)
7777
, mGeneProduct ("")
7878
// , mName ("")
7979
{
80-
// set the element namespace of this object
81-
setElementNamespace(fbcns->getURI());
82-
83-
// load package extensions bound with this object (if any)
84-
loadPlugins(fbcns);
80+
connectToChild();
81+
//
82+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
83+
// in this constuctor because the functions are properly invoked in the constructor of the
84+
// base class (FbcAssociation).
85+
//
8586
}
8687

8788

src/sbml/packages/fbc/sbml/KeyValuePair.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ KeyValuePair::KeyValuePair(FbcPkgNamespaces *fbcns)
7777
, mUri ("")
7878
{
7979
setElementNamespace(fbcns->getURI());
80+
connectToChild();
8081
loadPlugins(fbcns);
8182
}
8283

src/sbml/packages/layout/sbml/CompartmentGlyph.cpp

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ CompartmentGlyph::CompartmentGlyph (unsigned int level, unsigned int version, un
7676
, mOrder(numeric_limits<double>::quiet_NaN())
7777
, mIsSetOrder(false)
7878
{
79+
connectToChild();
7980
//
80-
// (NOTE) Developers don't have to invoke setSBMLNamespacesAndOwn function as follows (commentted line)
81+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
8182
// in this constuctor because the function is properly invoked in the constructor of the
8283
// base class (GraphicalObject).
8384
//
@@ -91,18 +92,12 @@ CompartmentGlyph::CompartmentGlyph(LayoutPkgNamespaces* layoutns)
9192
, mOrder(numeric_limits<double>::quiet_NaN())
9293
, mIsSetOrder(false)
9394
{
95+
connectToChild();
9496
//
95-
// (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
96-
// in this constuctor because the function is properly invoked in the constructor of the
97+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
98+
// in this constuctor because the functions are properly invoked in the constructor of the
9799
// base class (GraphicalObject).
98100
//
99-
100-
// setElementNamespace(layoutns->getURI());
101-
102-
//
103-
// load package extensions bound with this object (if any)
104-
//
105-
loadPlugins(layoutns);
106101
}
107102

108103

@@ -116,18 +111,12 @@ CompartmentGlyph::CompartmentGlyph (LayoutPkgNamespaces* layoutns, const std::st
116111
, mIsSetOrder(false)
117112

118113
{
114+
connectToChild();
119115
//
120-
// (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
121-
// in this constuctor because the function is properly invoked in the constructor of the
116+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
117+
// in this constuctor because the functions are properly invoked in the constructor of the
122118
// base class (GraphicalObject).
123119
//
124-
125-
// setElementNamespace(layoutns->getURI());
126-
127-
//
128-
// load package extensions bound with this object (if any)
129-
//
130-
loadPlugins(layoutns);
131120
}
132121

133122
/*
@@ -141,18 +130,12 @@ CompartmentGlyph::CompartmentGlyph (LayoutPkgNamespaces* layoutns, const std::st
141130
, mIsSetOrder(false)
142131

143132
{
133+
connectToChild();
144134
//
145-
// (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
146-
// in this constuctor because the function is properly invoked in the constructor of the
135+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
136+
// in this constuctor because the functions are properly invoked in the constructor of the
147137
// base class (GraphicalObject).
148138
//
149-
150-
// setElementNamespace(layoutns->getURI());
151-
152-
//
153-
// load package extensions bound with this object (if any)
154-
//
155-
loadPlugins(layoutns);
156139
}
157140

158141
/*

src/sbml/packages/layout/sbml/CubicBezier.cpp

Lines changed: 18 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,11 @@ CubicBezier::CubicBezier(LayoutPkgNamespaces* layoutns)
101101
this->mBasePoint2.setElementName("basePoint2");
102102

103103
connectToChild();
104-
105-
//
106-
// (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
107-
// in this constuctor because the function is properly invoked in the constructor of the
108-
// base class (LineSegment).
109-
//
110-
111-
// setElementNamespace(layoutns->getURI());
112-
113104
//
114-
// load package extensions bound with this object (if any)
105+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
106+
// in this constuctor because the functions are properly invoked in the constructor of the
107+
// base class (GraphicalObject).
115108
//
116-
loadPlugins(layoutns);
117109
}
118110

119111

@@ -133,19 +125,11 @@ CubicBezier::CubicBezier (LayoutPkgNamespaces* layoutns, double x1, double y1, d
133125
this->mBasePoint2.setElementName("basePoint2");
134126

135127
connectToChild();
136-
137128
//
138-
// (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
139-
// in this constuctor because the function is properly invoked in the constructor of the
140-
// base class (LineSegment).
129+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
130+
// in this constuctor because the functions are properly invoked in the constructor of the
131+
// base class (GraphicalObject).
141132
//
142-
143-
// setElementNamespace(layoutns->getURI());
144-
145-
//
146-
// load package extensions bound with this object (if any)
147-
//
148-
loadPlugins(layoutns);
149133
}
150134

151135

@@ -166,19 +150,11 @@ CubicBezier::CubicBezier (LayoutPkgNamespaces* layoutns, double x1, double y1, d
166150
this->mBasePoint2.setElementName("basePoint2");
167151

168152
connectToChild();
169-
170-
//
171-
// (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
172-
// in this constuctor because the function is properly invoked in the constructor of the
173-
// base class (LineSegment).
174-
//
175-
176-
// setElementNamespace(layoutns->getURI());
177-
178153
//
179-
// load package extensions bound with this object (if any)
154+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
155+
// in this constuctor because the functions are properly invoked in the constructor of the
156+
// base class (GraphicalObject).
180157
//
181-
loadPlugins(layoutns);
182158
}
183159

184160
/*
@@ -245,19 +221,11 @@ CubicBezier::CubicBezier (LayoutPkgNamespaces* layoutns, const Point* start, con
245221
this->mBasePoint2.setElementName("basePoint2");
246222

247223
connectToChild();
248-
249-
//
250-
// (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
251-
// in this constuctor because the function is properly invoked in the constructor of the
252-
// base class (LineSegment).
253224
//
254-
255-
// setElementNamespace(layoutns->getURI());
256-
225+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
226+
// in this constuctor because the functions are properly invoked in the constructor of the
227+
// base class (GraphicalObject).
257228
//
258-
// load package extensions bound with this object (if any)
259-
//
260-
loadPlugins(layoutns);
261229
}
262230

263231

@@ -285,20 +253,12 @@ CubicBezier::CubicBezier (LayoutPkgNamespaces* layoutns, const Point* start, con
285253
this->mEndPoint=Point(layoutns);
286254
}
287255

288-
connectToChild();
289-
290-
//
291-
// (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
292-
// in this constuctor because the function is properly invoked in the constructor of the
293-
// base class (LineSegment).
294-
//
295-
296-
// setElementNamespace(layoutns->getURI());
297-
298-
//
299-
// load package extensions bound with this object (if any)
300-
//
301-
loadPlugins(layoutns);
256+
connectToChild();
257+
//
258+
// (NOTE) Developers don't have to invoke setElementNamespace or loadPlugins functions
259+
// in this constuctor because the functions are properly invoked in the constructor of the
260+
// base class (GraphicalObject).
261+
//
302262
}
303263

304264
/*

0 commit comments

Comments
 (0)