fbergmann / libSEDML

SED-ML library based on libSBML
BSD 2-Clause "Simplified" License
9 stars 12 forks source link

Move all id/name functions to SedBase.cpp #116

Closed luciansmith closed 3 years ago

luciansmith commented 3 years ago

This change moves all functionality with respect to id and name to SedBase, so the bulk of the change is simply 'deleted code'.

In L1v4, everything has an id and name, so everything works fine there.

In L1v3 and earlier, some elements had id and name, some had just id, some had just name, and some had neither. This is now handled with the 'mIdAllowedPreV4' and 'mNameAllowedPreV4' boolean member variables on SedBase, which the relevant classes define in their constructors, and then checked in the various SedBase functions that set/get/unset/read/write the id and name attributes. The exception is that the 'id is required' functionality is still handled in 'readAttributes', but instead of setting the id and then checking if it's set, it now just calls SedBase::readAttributes and then checks 'isSetId()'.

fbergmann commented 3 years ago

@luciansmith if you could just double check on the id allowed on curve, then i would be happy to merge this back. thanks for doing this.

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 31 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication