Re: Id/Name not on SBase
06 Sep '09 10:44
> I'm not sure why Neil thinks the functions are deprecated !
Largely because both my IDE and ant tell me. As does the source code:
* Returns the value of the 'metaid' attribute of this object.
* @deprecated libSBML internal
public String getId()
return libsbmlJNI.SBase_getId(swigCPtr, this);
However, while I understand the logic of deprecating this, I would
still quite have liked the base class NamedSBase or whatever with get/
set name/id in them... But I'll let it lie and implement a few helper
Manchester Centre for Integrative Systems Biology
Manchester Interdisciplinary Biocentre
University of Manchester
Manchester M1 7DN
On 5 Sep 2009, at 20:34, Sarah Keating wrote:
> Hi Guys
> NOTE: I changed the subject and really any further discussion on this
> topic should go to
> I'm not sure why Neil thinks the functions are deprecated ! The
> on SBase are not documented, because the implementation on SBase is a
> helper function for existing users. New users should really use the
> set/get Id/Name functions on the appropriate derived class.
> Just for the record - sorry if I'm repeating myself :-)
> In libSBML-3 and earlier the id and name attributes were members of
> base class SBase. This was a MISMATCH with the SBML specification.
> inconsistency caused problems for new users. It also provided the
> opportunity to set an attribute on an element that did not in fact
> that attribute - creating invalid SBML.
> In order to address these issues and pave the way for SBML L3
> extensibility, libSBML-4 moved the id and name attributes from SBase
> the derived classes (where appropriate). This caused problems for
> existing users who use the base class to loop through different
> within the model and required set/get Id/Name. So libSBML-4 added the
> functions back to SBase as a helper function. These functions merely
> look at the SBMLTypeCode on the object and use a switch statement to
> cast the object
> to the appropriate class before calling the class specific function.
> SBMLTypeCode_t type = this->getTypeCode();
> case SBML_COMPARTMENT:
> return static_cast <const Compartment *> (this)->getId();
> LibSBML for SBML L3 core and earlier levels will have this
> functionality. However, once libSBML becomes extendible we anticipate
> that package developers will provide code for their own package which
> will communicate with the core libSBML but not impact the code
> Thus as packages introduce new elements derived from SBase the
> to setId/Name from the SBase class may be lost.
> If you commonly use get/set Id/Name on an SBase object it may be worth
> implementing your own helper function to do this :-)
> To manage your sbml-discuss list subscription, visit
> For a web interface to the sbml-discuss mailing list, visit
> For questions or feedback about the sbml-discuss list,
> contact firstname.lastname@example.org
To manage your sbml-interoperability list subscription, visit
For a web interface to the sbml-interoperability mailing list, visit
For questions or feedback about the sbml-interoperability list,
[Updated on: 17 Sep '09 21:35] by Moderator
Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)