Inheritance: IDisposable
Ejemplo n.º 1
0
 public void setUp()
 {
     S = new Model(2,4);
       if (S == null);
       {
       }
 }
 /**
    * Takes a list of CVTerm objects and creates a complete SBML annotation
    * around it.
    *
    * This essentially takes the given SBML object, reads out the CVTerm
    * objects attached to it, calls @if clike createRDFAnnotation()@else
    * RDFAnnotationParser::createRDFAnnotation()@endif to create an RDF
    * annotation to hold the terms, and finally calls @if clike
    * createAnnotation()@else
    * RDFAnnotationParser::createAnnotation()@endif to wrap the result as
    * an SBML <code>&lt;annotation&gt;</code> element.
    *
    * @param obj the SBML object to start from
    *
    * @return the XMLNode tree corresponding to the annotation.
    *
    * @if notclike @note Because this is a @em static method, the non-C++
    * language interfaces for libSBML will contain two variants.  One will
    * be a static method on the class (i.e., RDFAnnotationParser), and the
    * other will be a standalone top-level function with the name
    * RDFAnnotationParser_parseCVTerms(). They are functionally
    * identical. @endif
    */
 public static XMLNode parseCVTerms(SBase obj)
 {
     IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_parseCVTerms(SBase.getCPtr(obj));
     XMLNode ret = (cPtr == IntPtr.Zero) ? null : new XMLNode(cPtr, true);
     return ret;
 }
Ejemplo n.º 3
0
        public static SBase DowncastSBase(IntPtr cPtr, bool owner)
        {
            if (cPtr.Equals(IntPtr.Zero)) return null;

            SBase sb = new SBase(cPtr, false);
            string pkgName = sb.getPackageName();
            if (pkgName == "core")
            {
            switch( sb.getTypeCode() )
            {
                case (int) libsbml.SBML_COMPARTMENT:
                    return new Compartment(cPtr, owner);

                case (int) libsbml.SBML_COMPARTMENT_TYPE:
                    return new CompartmentType(cPtr, owner);

                case (int) libsbml.SBML_CONSTRAINT:
                    return new Constraint(cPtr, owner);

                case (int) libsbml.SBML_DOCUMENT:
                    return new SBMLDocument(cPtr, owner);

                case (int) libsbml.SBML_DELAY:
                    return new Delay(cPtr, owner);

                case (int) libsbml.SBML_EVENT:
                    return new Event(cPtr, owner);

                case (int) libsbml.SBML_EVENT_ASSIGNMENT:
                    return new EventAssignment(cPtr, owner);

                case (int) libsbml.SBML_FUNCTION_DEFINITION:
                    return new FunctionDefinition(cPtr, owner);

                case (int) libsbml.SBML_INITIAL_ASSIGNMENT:
                    return new InitialAssignment(cPtr, owner);

                case (int) libsbml.SBML_KINETIC_LAW:
                    return new KineticLaw(cPtr, owner);

                case (int) libsbml.SBML_LIST_OF:
                     string name = sb.getElementName();
                     if(name == "listOf")
                         {
                    return new ListOf(cPtr, owner);
                     }
                     else if(name == "listOfCompartments")
                     {
                    return new ListOfCompartments(cPtr, owner);
                     }
                     else if(name == "listOfCompartmentTypes")
                     {
                    return new ListOfCompartmentTypes(cPtr, owner);
                     }
                     else if(name == "listOfConstraints")
                     {
                    return new ListOfConstraints(cPtr, owner);
                     }
                     else if(name == "listOfEvents")
                     {
                         return new ListOfEvents(cPtr, owner);
                                 }
                                 else if(name == "listOfEventAssignments")
                                 {
                    return new ListOfEventAssignments(cPtr, owner);
                         }
                         else if(name == "listOfFunctionDefinitions")
                         {
             		               return new ListOfFunctionDefinitions(cPtr, owner);
                         }
                         else if(name == "listOfInitialAssignments")
                         {
                           return new ListOfInitialAssignments(cPtr, owner);
                         }
                         else if(name == "listOfParameters")
                         {
                           return new ListOfParameters(cPtr, owner);
                         }
                         else if(name == "listOfLocalParameters")
                         {
                           return new ListOfLocalParameters(cPtr, owner);
                         }
                     else if(name == "listOfReactions")
                         {
                           return new ListOfReactions(cPtr, owner);
                         }
                         else if(name == "listOfRules")
                         {
                           return new ListOfRules(cPtr, owner);
                                 }
                         else if(name == "listOfSpecies")
                         {
                           return new ListOfSpecies(cPtr, owner);
                                 }
                         else if(name == "listOfUnknowns")
                         {
                           return new ListOfSpeciesReferences(cPtr, owner);
                                 }
                         else if(name == "listOfReactants")
                         {
                           return new ListOfSpeciesReferences(cPtr, owner);
                                 }
                         else if(name == "listOfProducts")
                         {
                           return new ListOfSpeciesReferences(cPtr, owner);
                                 }
                         else if(name == "listOfModifiers")
                         {
                           return new ListOfSpeciesReferences(cPtr, owner);
                                 }
                         else if(name == "listOfSpeciesTypes")
                         {
                           return new ListOfSpeciesTypes(cPtr, owner);
                                 }
                         else if(name == "listOfUnits")
                         {
                           return new ListOfUnits(cPtr, owner);
                                 }
                         else if(name == "listOfUnitDefinitions")
                         {
                           return new ListOfUnitDefinitions(cPtr, owner);
                                 }
                         return new ListOf(cPtr, owner);

                case (int) libsbml.SBML_MODEL:
                    return new Model(cPtr, owner);

                case (int) libsbml.SBML_PARAMETER:
                    return new Parameter(cPtr, owner);

            case (int) libsbml.SBML_PRIORITY:
                return new Priority(cPtr, owner);

                case (int) libsbml.SBML_LOCAL_PARAMETER:
                    return new LocalParameter(cPtr, owner);

                case (int) libsbml.SBML_REACTION:
                    return new Reaction(cPtr, owner);

                case (int) libsbml.SBML_SPECIES:
                    return new Species(cPtr, owner);

                case (int) libsbml.SBML_SPECIES_REFERENCE:
                    return new SpeciesReference(cPtr, owner);

                case (int) libsbml.SBML_MODIFIER_SPECIES_REFERENCE:
                    return new ModifierSpeciesReference(cPtr, owner);

                case (int) libsbml.SBML_SPECIES_TYPE:
                    return new SpeciesType(cPtr, owner);

                case (int) libsbml.SBML_TRIGGER:
                    return new Trigger(cPtr, owner);

                case (int) libsbml.SBML_UNIT_DEFINITION:
                    return new UnitDefinition(cPtr, owner);

                case (int) libsbml.SBML_UNIT:
                    return new Unit(cPtr, owner);

                case (int) libsbml.SBML_ALGEBRAIC_RULE:
                    return new AlgebraicRule(cPtr, owner);

                case (int) libsbml.SBML_ASSIGNMENT_RULE:
                    return new AssignmentRule(cPtr, owner);

                case (int) libsbml.SBML_RATE_RULE:
                    return new RateRule(cPtr, owner);

                case (int) libsbml.SBML_STOICHIOMETRY_MATH:
                    return new StoichiometryMath(cPtr, owner);

                default:
                    return new SBase(cPtr, owner);
            }
            }
            else
            {
            SBMLExtension sbmlext = SBMLExtensionRegistry.getInstance().getExtension(pkgName);
            if (sbmlext != null)
            {
                return sbmlext.DowncastSBase(cPtr,owner);
            }
            }
            return new SBase(cPtr, owner);
        }
Ejemplo n.º 4
0
 public void append(SBase item)
 {
     libsbmlPINVOKE.ListOf_append(swigCPtr, SBase.getCPtr(item));
 }
Ejemplo n.º 5
0
 /**
    * Inserts an item at a given position in this ListOf's list of items.
    *
    * This variant of the method does not make a clone of the @p disownedItem handed to it.
    * This means that when the ListOf is destroyed, the original @p item
    * <em>will</em> be destroyed.
    *
    * @param location the location where to insert the item
    * @param disownedItem the item to be inserted to the list
    *
    *
  * @return integer value indicating success/failure of the
  * function.  @if clike The value is drawn from the
  * enumeration #OperationReturnValues_t. @endif The possible values
  * returned by this function are:
  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
    * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink
    *
    * @see insert(int location, SBase item)
    */
 public int insertAndOwn(int location, SBase disownedItem)
 {
     int ret = libsbmlPINVOKE.ListOf_insertAndOwn(swigCPtr, location, SBase.getCPtrAndDisown(disownedItem));
     return ret;
 }
Ejemplo n.º 6
0
 /**
    * Adds an item to the end of this ListOf's list of items.
    *
    * This method does not clone the @p disownedItem handed to it; instead, it assumes
    * ownership of it.  This means that when the ListOf is destroyed, the item
    * will be destroyed along with it.  For a method with an alternative
    * ownership behavior, see the ListOf::append(SBase item) method.
    *
    * @param disownedItem the item to be added to the list.
    *
    *
  * @return integer value indicating success/failure of the
  * function.  @if clike The value is drawn from the
  * enumeration #OperationReturnValues_t. @endif The possible values
  * returned by this function are:
  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
    * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink
    *
    * @see append(SBase item)
    * @see appendFrom(ListOf list)
    */
 public int appendAndOwn(SBase disownedItem)
 {
     int ret = libsbmlPINVOKE.ListOf_appendAndOwn(swigCPtr, SBase.getCPtrAndDisown(disownedItem));
     return ret;
 }
Ejemplo n.º 7
0
        static void testListOfRemove(ListOf lof, SBase s)
        {
            string ename = s.getElementName();

              lof.append(s);
              SBase c = lof.get(0);

              if ( c is CompartmentType ) { CompartmentType x = (lof as ListOfCompartmentTypes).remove(0); c = x; }
              else if ( c is Compartment ) { Compartment x = (lof as ListOfCompartments).remove(0); c = x; }
              else if ( c is Constraint )  { Constraint x = (lof as ListOfConstraints).remove(0); c = x; }
              else if ( c is EventAssignment ) { EventAssignment x = (lof as ListOfEventAssignments).remove(0); c = x; }
              else if ( c is Event ) { Event x = (lof as ListOfEvents).remove(0); c = x; }
              else if ( c is FunctionDefinition ) { FunctionDefinition x = (lof as ListOfFunctionDefinitions).remove(0); c = x; }
              else if ( c is InitialAssignment ) { InitialAssignment x = (lof as ListOfInitialAssignments).remove(0); c = x; }
              else if ( c is Parameter ) { Parameter x = (lof as ListOfParameters).remove(0); c = x; }
              else if ( c is Reaction ) { Reaction x = (lof as ListOfReactions).remove(0); c = x; }
              else if ( c is Rule ) { Rule x = (lof as ListOfRules).remove(0); c = x; }
              else if ( c is Species ) { Species x = (lof as ListOfSpecies).remove(0); c = x; }
              else if ( c is SpeciesReference ) {SimpleSpeciesReference x = (lof as ListOfSpeciesReferences).remove(0); c = x; }
              else if ( c is SpeciesType ) { SpeciesType x = (lof as ListOfSpeciesTypes).remove(0); c = x; }
              else if ( c is UnitDefinition ) { UnitDefinition x = (lof as ListOfUnitDefinitions).remove(0); c = x; }
              else if ( c is Unit ) { Unit x = (lof as ListOfUnits).remove(0); c = x; }
              else
              {
            ERR("[testListOfRemove] Error: (" + ename + ") : ListOfXXX::remove() failed.");
            return;
              }

              if ( c == null)
              {
            ERR("[testListOfRemove] Error: (" + ename + ") : ListOfXXX::remove() failed.");
            return;
              }

              string enameGet = c.getElementName();

              if ( ename == enameGet )
              {
            //Console.Out.WriteLine("[testListOfRemove] OK: (" + ename + ") remove(" + enameGet + ") : type match.");
            OK();
              }
              else
              {
            ERR("[testListOfRemove] Error: (" + ename + ") remove(" + enameGet + ") : type mismatch.");
              }
        }
Ejemplo n.º 8
0
 /**
    * Predicate to test elements.
    *
    * This is the central predicate of the ElementFilter class.  In subclasses
    * of ElementFilter, callers should implement this method such that it
    * returns @c true for @p element arguments that are 'desirable' and @c
    * false for those that are 'undesirable' in whatever filtering context the
    * ElementFilter subclass is designed to be used.
    *
    * @param element the element to be tested.
    *
    * @return @c true if the @p element is desirable or should be kept,
    * @c false otherwise.
    */
 public virtual bool filter(SBase element)
 {
     bool ret = (SwigDerivedClassHasMethod("filter", swigMethodTypes0) ? libsbmlPINVOKE.ElementFilter_filterSwigExplicitElementFilter(swigCPtr, SBase.getCPtr(element)) : libsbmlPINVOKE.ElementFilter_filter(swigCPtr, SBase.getCPtr(element)));
     return ret;
 }
Ejemplo n.º 9
0
 /**
    * Returns @c true if this object's set of XML namespaces are a subset
    * of the given object's XML namespaces.
    *
    *
  *
  * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
  * information.  It is used to communicate the SBML Level, Version, and (in
  * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
  * common approach to using libSBML's SBMLNamespaces facilities is to create an
  * SBMLNamespaces object somewhere in a program once, then hand that object
  * as needed to object constructors that accept SBMLNamespaces as arguments.
  *
  *
    *
    * @param sb an object to compare with respect to namespaces
    *
    * @return boolean, @c true if this object's collection of namespaces is
    * a subset of @p sb's, @c false otherwise.
    */
 public bool matchesRequiredSBMLNamespacesForAddition(SBase sb)
 {
     bool ret = libsbmlPINVOKE.SBase_matchesRequiredSBMLNamespacesForAddition__SWIG_0(swigCPtr, SBase.getCPtr(sb));
     return ret;
 }
 /**
    * Takes an SBML object and creates an empty XMLNode corresponding to an
    * RDF 'Description' element.
    *
    * This method is a handy way of creating RDF description objects linked
    * by the appropriate 'metaid' field to the given @p object, for
    * insertion into RDF annotations in a model.  The method retrieves the
    * 'metaid' attribute from the @p object passed in as argument, then
    * creates an empty element having the following form
    * (where <span class='code' style='background-color: #eed0d0'>metaid</span>
    * the value of the 'metaid' attribute of the argument):
    *
 <div class='fragment'>
 &lt;rdf:Description rdf:about=&quot;#<span style='background-color: #eed0d0'>metaid</span>&quot; xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'&gt;<br>
 ...<br>
 &lt;/rdf:Description&gt;<br>
 </div>
    * Note that this method does @em not create a complete annotation or
    * even an RDF element; it only creates the 'Description' portion.  Callers
    * will need to use other methods such as
    * @if clike createRDFAnnotation()@else RDFAnnotationParser::createRDFAnnotation()@endif
    * to create the rest of the structure for an annotation.
    *
    * @param obj the object to which the 'Description' refers
    *
    * @return a new XMLNode containing the 'rdf:Description' element with
    * its 'about' attribute value set to the @p object meta identifier.
    *
    * @see createRDFAnnotation()
    */
 public static XMLNode createRDFDescription(SBase obj)
 {
     IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_createRDFDescription(SBase.getCPtr(obj));
     XMLNode ret = (cPtr == IntPtr.Zero) ? null : new XMLNode(cPtr, true);
     return ret;
 }
Ejemplo n.º 11
0
 public static XMLNode parseModelHistory(SBase arg0)
 {
     IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_parseModelHistory(SBase.getCPtr(arg0));
     XMLNode ret = (cPtr == IntPtr.Zero) ? null : new XMLNode(cPtr, true);
     return ret;
 }
Ejemplo n.º 12
0
 public void prepend(SBase item)
 {
     libsbmlPINVOKE.SBaseList_prepend(swigCPtr, SBase.getCPtr(item));
 }
 public virtual int transform(SBase element)
 {
     int ret = (SwigDerivedClassHasMethod("transform", swigMethodTypes0) ? libsbmlPINVOKE.IdentifierTransformer_transformSwigExplicitIdentifierTransformer(swigCPtr, SBase.getCPtr(element)) : libsbmlPINVOKE.IdentifierTransformer_transform(swigCPtr, SBase.getCPtr(element)));
     return ret;
 }
Ejemplo n.º 14
0
 public void appendAndOwn(SBase item)
 {
     libsbmlPINVOKE.ListOf_appendAndOwn(swigCPtr, SBase.getCPtrAndDisown(item));
 }
Ejemplo n.º 15
0
 /**
    * Reads the model history stored in @p obj and creates the
    * XML structure for an SBML annotation representing that history.
    *
    * @param obj any SBase object
    *
    * @return the XMLNode corresponding to an annotation containing
    * MIRIAM-compliant model history information in RDF format.
    *
    * @if notclike @note Because this is a @em static method, the non-C++
    * language interfaces for libSBML will contain two variants.  One will
    * be a static method on the class (i.e., RDFAnnotationParser), and the
    * other will be a standalone top-level function with the name
    * RDFAnnotationParser_parseOnlyModelHistory(). They are functionally
    * identical. @endif
    */
 public static XMLNode parseOnlyModelHistory(SBase obj)
 {
     IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_parseOnlyModelHistory(SBase.getCPtr(obj));
     XMLNode ret = (cPtr == IntPtr.Zero) ? null : new XMLNode(cPtr, false);
     return ret;
 }
Ejemplo n.º 16
0
 /**
    * Returns @c true if this object's set of XML namespaces are the same
    * as the given object's XML namespaces.
    *
    *
  *
  * The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
  * information.  It is used to communicate the SBML Level, Version, and (in
  * Level&nbsp;3) packages used in addition to SBML Level&nbsp;3 Core.  A
  * common approach to using libSBML's SBMLNamespaces facilities is to create an
  * SBMLNamespaces object somewhere in a program once, then hand that object
  * as needed to object constructors that accept SBMLNamespaces as arguments.
  *
  *
    *
    * @param sb an object to compare with respect to namespaces
    *
    * @return boolean, @c true if this object's collection of namespaces is
    * the same as @p sb's, @c false otherwise.
    */
 public bool matchesSBMLNamespaces(SBase sb)
 {
     bool ret = libsbmlPINVOKE.SBase_matchesSBMLNamespaces__SWIG_0(swigCPtr, SBase.getCPtr(sb));
     return ret;
 }
Ejemplo n.º 17
0
 internal static HandleRef getCPtr(SBase obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Ejemplo n.º 18
0
        static void testClone(SBase s)
        {
            string ename = s.getElementName();
              SBase c = s.clone();

              if ( c is Compartment ) { Compartment x = (s as Compartment).clone(); c = x; }
              else if ( c is CompartmentType ) { CompartmentType x = (s as CompartmentType).clone(); c = x; }
              else if ( c is Constraint ) { Constraint x = (s as Constraint).clone(); c = x; }
              else if ( c is Delay ) { Delay x = (s as Delay).clone(); c = x; }
              else if ( c is Event ) { Event x = (s as Event).clone(); c = x; }
              else if ( c is EventAssignment ) { EventAssignment x = (s as EventAssignment).clone(); c = x; }
              else if ( c is FunctionDefinition ) { FunctionDefinition x = (s as FunctionDefinition).clone(); c = x; }
              else if ( c is InitialAssignment ) { InitialAssignment x = (s as InitialAssignment).clone(); c = x; }
              else if ( c is KineticLaw ) { KineticLaw x = (s as KineticLaw).clone(); c = x; }
              // currently return type of ListOf::clone() is SBase
              else if ( c is ListOf ) { SBase x = (s as ListOf).clone(); c = x; }
              else if ( c is Model ) { Model x = (s as Model).clone(); c = x; }
              else if ( c is Parameter ) { Parameter x = (s as Parameter).clone(); c = x; }
              else if ( c is Reaction ) { Reaction x = (s as Reaction).clone(); c = x; }
              else if ( c is AlgebraicRule ) { AlgebraicRule x = (s as AlgebraicRule).clone(); c = x; }
              else if ( c is AssignmentRule ) { AssignmentRule x = (s as AssignmentRule).clone(); c = x; }
              else if ( c is RateRule ) { RateRule x = (s as RateRule).clone(); c = x; }
              else if ( c is SBMLDocument ) { SBMLDocument x = (s as SBMLDocument).clone(); c = x; }
              else if ( c is Species ) { Species x = (s as Species).clone(); c = x; }
              else if ( c is SpeciesReference ) { SpeciesReference x = (s as SpeciesReference).clone(); c = x; }
              else if ( c is SpeciesType ) { SpeciesType x = (s as SpeciesType).clone(); c = x; }
              else if ( c is SpeciesReference ) { SpeciesReference x = (s as SpeciesReference).clone(); c = x; }
              else if ( c is StoichiometryMath ) { StoichiometryMath x = (s as StoichiometryMath).clone(); c = x; }
              else if ( c is Trigger ) { Trigger x = (s as Trigger).clone(); c = x; }
              else if ( c is Unit ) { Unit x = (s as Unit).clone(); c = x; }
              else if ( c is UnitDefinition ) { UnitDefinition x = (s as UnitDefinition).clone(); c = x; }
              else if ( c is ListOfCompartmentTypes ) { ListOfCompartmentTypes x = (s as ListOfCompartmentTypes).clone(); c = x; }
              else if ( c is ListOfCompartments ) { ListOfCompartments x = (s as ListOfCompartments).clone(); c = x; }
              else if ( c is ListOfConstraints ) { ListOfConstraints x = (s as ListOfConstraints).clone(); c = x; }
              else if ( c is ListOfEventAssignments ) { ListOfEventAssignments x = (s as ListOfEventAssignments).clone(); c = x; }
              else if ( c is ListOfEvents ) { ListOfEvents x = (s as ListOfEvents).clone(); c = x; }
              else if ( c is ListOfFunctionDefinitions ) { ListOfFunctionDefinitions x = (s as ListOfFunctionDefinitions).clone(); c = x; }
              else if ( c is ListOfInitialAssignments ) { ListOfInitialAssignments x = (s as ListOfInitialAssignments).clone(); c = x; }
              else if ( c is ListOfParameters ) { ListOfParameters x = (s as ListOfParameters).clone(); c = x; }
              else if ( c is ListOfReactions ) { ListOfReactions x = (s as ListOfReactions).clone(); c = x; }
              else if ( c is ListOfRules ) { ListOfRules x = (s as ListOfRules).clone(); c = x; }
              else if ( c is ListOfSpecies ) { ListOfSpecies x = (s as ListOfSpecies).clone(); c = x; }
              else if ( c is ListOfSpeciesReferences ) { ListOfSpeciesReferences x = (s as ListOfSpeciesReferences).clone(); c = x; }
              else if ( c is ListOfSpeciesTypes ) { ListOfSpeciesTypes x = (s as ListOfSpeciesTypes).clone(); c = x; }
              else if ( c is ListOfUnitDefinitions ) { ListOfUnitDefinitions x = (s as ListOfUnitDefinitions).clone(); c = x; }
              else if ( c is ListOfUnits ) { ListOfUnits x = (s as ListOfUnits).clone(); c = x; }
              else
              {
            ERR("[testClone] Error: (" + ename + ") : clone() failed.");
            return;
              }

              if ( c == null)
              {
            ERR("[testClone] Error: (" + ename + ") : clone() failed.");
            return;
              }

              string enameClone = c.getElementName();

              if ( ename == enameClone )
              {
            //Console.Out.WriteLine("[testClone] OK: (" + ename + ") clone(" + enameClone + ") : type match.");
            OK();
              }
              else
              {
            ERR("[testClone] Error: (" + ename + ") clone(" + enameClone + ") : type mismatch.");
              }
        }
Ejemplo n.º 19
0
        internal static HandleRef getCPtrAndDisown(SBase obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

            if (obj != null)
            {
            ptr             = obj.swigCPtr;
            obj.swigCMemOwn = false;
            }

            return ptr;
        }
Ejemplo n.º 20
0
 /**
    * Adds an item to the end of this ListOf's list of items.
    *
    * This method makes a clone of the @p item handed to it.  This means that
    * when the ListOf object is destroyed, the original items will not be
    * destroyed.  For a method with an alternative ownership behavior, see the
    * ListOf::appendAndOwn(@if java SBase@endif) method.
    *
    * @param item the item to be added to the list.
    *
    *
  * @return integer value indicating success/failure of the
  * function.  @if clike The value is drawn from the
  * enumeration #OperationReturnValues_t. @endif The possible values
  * returned by this function are:
  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
    * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink
    *
    * @see appendAndOwn(SBase disownedItem)
    * @see appendFrom(ListOf list)
    */
 public int append(SBase item)
 {
     int ret = libsbmlPINVOKE.ListOf_append(swigCPtr, SBase.getCPtr(item));
     return ret;
 }
Ejemplo n.º 21
0
 /** */
 /* libsbml-internal */
 public int checkCompatibility(SBase arg0)
 {
     int ret = libsbmlPINVOKE.SBase_checkCompatibility(swigCPtr, SBase.getCPtr(arg0));
     return ret;
 }
Ejemplo n.º 22
0
 /**
    * Inserts an item at a given position in this ListOf's list of items.
    *
    * This variant of the method makes a clone of the @p item handed to it.
    * This means that when the ListOf is destroyed, the original @p item will
    * <em>not</em> be destroyed.
    *
    * @param location the location in the list where to insert the item.
    * @param item the item to be inserted to the list.
    *
    *
  * @return integer value indicating success/failure of the
  * function.  @if clike The value is drawn from the
  * enumeration #OperationReturnValues_t. @endif The possible values
  * returned by this function are:
  * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
    * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink
    *
    * @see insertAndOwn(int location, SBase item)
    */
 public int insert(int location, SBase item)
 {
     int ret = libsbmlPINVOKE.ListOf_insert(swigCPtr, location, SBase.getCPtr(item));
     return ret;
 }
Ejemplo n.º 23
0
 /** */
 /* libsbml-internal */
 public new void connectToParent(SBase parent)
 {
     libsbmlPINVOKE.SBase_connectToParent(swigCPtr, SBase.getCPtr(parent));
 }
Ejemplo n.º 24
0
 /**
    * Sets the parent SBML object of this plugin object to
    * this object and child elements (if any).
    * (Creates a child-parent relationship by this plugin object)
    *
    * This function is called when this object is created by
    * the parent element.
    * Subclasses must override this this function if they have one
    * or more child elements. Also, SBasePlugin::connectToParent(@if java SBase@endif)
    * must be called in the overridden function.
    *
    * @param sbase the SBase object to use
    *
    * @if cpp
    * @see setSBMLDocument()
    * @see enablePackageInternal()
    * @endif
    */
 /* libsbml-internal */
 public new void connectToParent(SBase sbase)
 {
     libsbmlPINVOKE.SBasePlugin_connectToParent(swigCPtr, SBase.getCPtr(sbase));
 }
Ejemplo n.º 25
0
 /** */
 public new bool isValidTypeForList(SBase item)
 {
     bool ret = libsbmlPINVOKE.SBasePlugin_isValidTypeForList(swigCPtr, SBase.getCPtrAndDisown(item));
     return ret;
 }