Skip to content

Commit

Permalink
Remove all checks for SBML core version when adding package elements.
Browse files Browse the repository at this point in the history
This was already done for FBC; do this for all other packages as well.

FBC had additional checks in places for checking the core version, because FBC itself had different versions.  But no other package yet has other versions, so nobody had added those additional (unnecessary) checks.
  • Loading branch information
luciansmith committed Aug 5, 2024
1 parent b7b6bd2 commit f954392
Show file tree
Hide file tree
Showing 70 changed files with 0 additions and 408 deletions.
8 changes: 0 additions & 8 deletions src/sbml/packages/comp/extension/CompModelPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,6 @@ CompModelPlugin::addSubmodel (const Submodel* submodel)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != submodel->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != submodel->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -427,10 +423,6 @@ CompModelPlugin::addPort (const Port* port)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != port->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != port->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
8 changes: 0 additions & 8 deletions src/sbml/packages/comp/extension/CompSBMLDocumentPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,6 @@ CompSBMLDocumentPlugin::addModelDefinition (const ModelDefinition* modelDefiniti
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != modelDefinition->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != modelDefinition->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -511,10 +507,6 @@ CompSBMLDocumentPlugin::addExternalModelDefinition (const ExternalModelDefinitio
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != externalModelDefinition->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != externalModelDefinition->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
8 changes: 0 additions & 8 deletions src/sbml/packages/comp/extension/CompSBasePlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,6 @@ CompSBasePlugin::addReplacedElement (const ReplacedElement* replacedElement)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != replacedElement->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != replacedElement->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -423,10 +419,6 @@ CompSBasePlugin::setReplacedBy (const ReplacedBy* replacedBy)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != replacedBy->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != replacedBy->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/comp/sbml/SBaseRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,6 @@ SBaseRef::setSBaseRef (const SBaseRef* sBaseRef)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != sBaseRef->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != sBaseRef->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/comp/sbml/Submodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,6 @@ Submodel::addDeletion (const Deletion* deletion)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != deletion->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != deletion->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/distrib/extension/DistribSBasePlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ DistribSBasePlugin::addUncertainty(const Uncertainty* u)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != u->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != u->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
8 changes: 0 additions & 8 deletions src/sbml/packages/distrib/sbml/ListOfUncertParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,6 @@ ListOfUncertParameters::addUncertParameter(const UncertParameter* up)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != up->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(up)) == false)
{
Expand Down Expand Up @@ -254,10 +250,6 @@ ListOfUncertParameters::addUncertSpan(const UncertSpan* up)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != up->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(up)) == false)
{
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/distrib/sbml/ListOfUncertainties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ ListOfUncertainties::addUncertainty(const Uncertainty* u)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != u->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(u)) == false)
{
Expand Down
8 changes: 0 additions & 8 deletions src/sbml/packages/distrib/sbml/UncertParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,6 @@ UncertParameter::addUncertParameter(const UncertParameter* up1)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != up1->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(up1)) == false)
{
Expand Down Expand Up @@ -681,10 +677,6 @@ UncertParameter::addUncertSpan(const UncertSpan* up1)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != up1->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(up1)) == false)
{
Expand Down
8 changes: 0 additions & 8 deletions src/sbml/packages/distrib/sbml/Uncertainty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ Uncertainty::addUncertParameter(const UncertParameter* up)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != up->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(up)) == false)
{
Expand Down Expand Up @@ -260,10 +256,6 @@ Uncertainty::addUncertSpan(const UncertSpan* up)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != up->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(up)) == false)
{
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/groups/extension/GroupsModelPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ GroupsModelPlugin::addGroup(const Group* g)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != g->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != g->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/groups/sbml/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,6 @@ Group::addMember(const Member* m)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != m->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(m)) == false)
{
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/groups/sbml/ListOfGroups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,6 @@ ListOfGroups::addGroup(const Group* g)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != g->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(g)) == false)
{
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/groups/sbml/ListOfMembers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,6 @@ ListOfMembers::addMember(const Member* m)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != m->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(m)) == false)
{
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/layout/extension/LayoutModelPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,6 @@ LayoutModelPlugin::addLayout (const Layout* layout)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != layout->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != layout->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/layout/sbml/Curve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,6 @@ Curve::addCurveSegment (const LineSegment* segment)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != segment->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (matchesRequiredSBMLNamespacesForAddition(static_cast<const
SBase*>(segment)) == false)
{
Expand Down
8 changes: 0 additions & 8 deletions src/sbml/packages/layout/sbml/GeneralGlyph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,6 @@ GeneralGlyph::addReferenceGlyph (const ReferenceGlyph* glyph)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != glyph->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != glyph->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -555,10 +551,6 @@ GeneralGlyph::addSubGlyph (const GraphicalObject* glyph)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != glyph->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != glyph->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
20 changes: 0 additions & 20 deletions src/sbml/packages/layout/sbml/Layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,10 +1156,6 @@ Layout::addCompartmentGlyph (const CompartmentGlyph* glyph)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != glyph->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != glyph->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -1189,10 +1185,6 @@ Layout::addSpeciesGlyph (const SpeciesGlyph* glyph)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != glyph->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != glyph->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -1222,10 +1214,6 @@ Layout::addReactionGlyph (const ReactionGlyph* glyph)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != glyph->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != glyph->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -1255,10 +1243,6 @@ Layout::addTextGlyph (const TextGlyph* glyph)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != glyph->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != glyph->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -1288,10 +1272,6 @@ Layout::addAdditionalGraphicalObject (const GraphicalObject* glyph)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != glyph->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != glyph->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/layout/sbml/ReactionGlyph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,6 @@ ReactionGlyph::addSpeciesReferenceGlyph (const SpeciesReferenceGlyph* glyph)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != glyph->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != glyph->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/multi/extension/MultiCompartmentPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,6 @@ MultiCompartmentPlugin::addCompartmentReference (const CompartmentReference* com
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != compartmentReference->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != compartmentReference->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
4 changes: 0 additions & 4 deletions src/sbml/packages/multi/extension/MultiModelPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,6 @@ MultiModelPlugin::addMultiSpeciesType (const MultiSpeciesType* multiSpeciesType)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != multiSpeciesType->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != multiSpeciesType->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
12 changes: 0 additions & 12 deletions src/sbml/packages/multi/extension/MultiSpeciesPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,6 @@ MultiSpeciesPlugin::addOutwardBindingSite (const OutwardBindingSite* outwardBind
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != outwardBindingSite->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != outwardBindingSite->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -606,10 +602,6 @@ MultiSpeciesPlugin::addSpeciesFeature (const SpeciesFeature* speciesFeature)
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != speciesFeature->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != speciesFeature->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down Expand Up @@ -708,10 +700,6 @@ MultiSpeciesPlugin::addSubListOfSpeciesFeatures (SubListOfSpeciesFeatures* subLi
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != subListOfSpeciesFeatures->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != subListOfSpeciesFeatures->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ MultiSpeciesReferencePlugin::addSpeciesTypeComponentMapInProduct (const SpeciesT
{
return LIBSBML_LEVEL_MISMATCH;
}
else if (getVersion() != speciesTypeComponentMapInProduct->getVersion())
{
return LIBSBML_VERSION_MISMATCH;
}
else if (getPackageVersion() != speciesTypeComponentMapInProduct->getPackageVersion())
{
return LIBSBML_PKG_VERSION_MISMATCH;
Expand Down
Loading

0 comments on commit f954392

Please sign in to comment.