SBase clone() { IntPtr cPtr = libsbmlPINVOKE.ModifierSpeciesReference_clone(swigCPtr); ModifierSpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, true); return(ret); }
internal static HandleRef getCPtrAndDisown(ModifierSpeciesReference obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return(ptr); }
public void test_ModifierSpeciesReference_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(2,1); sbmlns.addNamespaces(xmlns); SBase object1 = new ModifierSpeciesReference(sbmlns); assertTrue( object1.getTypeCode() == libsbml.SBML_MODIFIER_SPECIES_REFERENCE ); assertTrue( object1.getMetaId() == "" ); assertTrue( object1.getNotes() == null ); assertTrue( object1.getAnnotation() == null ); assertTrue( object1.getLevel() == 2 ); assertTrue( object1.getVersion() == 1 ); assertTrue( object1.getNamespaces() != null ); XMLNamespaces n = object1.getNamespaces(); assertTrue( n.getLength() == 2 ); object1 = null; }
internal static HandleRef getCPtr(ModifierSpeciesReference obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
internal static HandleRef getCPtrAndDisown(ModifierSpeciesReference obj) { HandleRef ptr = new HandleRef(null, IntPtr.Zero); if (obj != null) { ptr = obj.swigCPtr; obj.swigCMemOwn = false; } return ptr; }
internal static HandleRef getCPtr(ModifierSpeciesReference obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
public void test_ModifierSpeciesReference_constructor() { SBase s; try { s = new ModifierSpeciesReference(2,1); s = new ModifierSpeciesReference(2,2); s = new ModifierSpeciesReference(2,3); s = new ModifierSpeciesReference(2,4); s = new ModifierSpeciesReference(3,1); s = new ModifierSpeciesReference(SN21); s = new ModifierSpeciesReference(SN22); s = new ModifierSpeciesReference(SN23); s = new ModifierSpeciesReference(SN24); s = new ModifierSpeciesReference(SN31); } catch (SBMLConstructorException e) { s = null; } assertTrue(s != null); string msg = ""; try { s = new ModifierSpeciesReference(1,1); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new ModifierSpeciesReference(1,2); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new ModifierSpeciesReference(9,9); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new ModifierSpeciesReference(SN11); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new ModifierSpeciesReference(SN12); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); msg = ""; try { s = new ModifierSpeciesReference(SN99); } catch (SBMLConstructorException e) { msg = e.Message; } assertTrue(msg == ErrMsg); }
public void test_ModifierSpeciesReference() { ModifierSpeciesReference msr = new ModifierSpeciesReference(2,4); assertEquals( true, msr.hasRequiredElements() ); msr = null; }
public void test_SpeciesReference_Modifier_parent_add() { ModifierSpeciesReference sr = new ModifierSpeciesReference(2,4); sr.setSpecies("s"); Reaction r = new Reaction(2,4); r.addModifier(sr); sr = null; ListOf lo = r.getListOfModifiers(); assertTrue( lo == r.getModifier(0).getParentSBMLObject() ); assertTrue( r == lo.getParentSBMLObject() ); }
public void test_SpeciesReference_Modifier_ancestor_add() { ModifierSpeciesReference sr = new ModifierSpeciesReference(2,4); sr.setSpecies("s"); Reaction r = new Reaction(2,4); r.addModifier(sr); sr = null; ListOf lo = r.getListOfModifiers(); ModifierSpeciesReference obj = r.getModifier(0); assertTrue( obj.getAncestorOfType(libsbml.SBML_REACTION) == r ); assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo ); assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null ); assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null ); }
/** * Adds a given ModifierSpeciesReference object as a product in this * Reaction. * * The ModifierSpeciesReference instance in @p msr is copied. * * @param msr a ModifierSpeciesReference object referring to a Species in * the enclosing Model * * @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 libsbmlcs.libsbml.LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS @endlink * @li @link libsbmlcs.libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE @endlink * @li @link libsbmlcs.libsbml.LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH @endlink * @li @link libsbmlcs.libsbml.LIBSBML_DUPLICATE_OBJECT_ID LIBSBML_DUPLICATE_OBJECT_ID @endlink * @li @link libsbmlcs.libsbml.LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH @endlink * @li @link libsbmlcs.libsbml.LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED @endlink * * * * @note This method should be used with some caution. The fact that this * method @em copies the object passed to it means that the caller will be * left holding a physically different object instance than the one contained * inside this object. Changes made to the original object instance (such as * resetting attribute values) will <em>not affect the instance in this * object</em>. In addition, the caller should make sure to free the * original object if it is no longer being used, or else a memory leak will * result. Please see other methods on this class (particularly a * corresponding method whose name begins with the word <code>create</code>) * for alternatives that do not lead to these issues. * * * * @see createModifier() */ public int addModifier(ModifierSpeciesReference msr) { int ret = libsbmlPINVOKE.Reaction_addModifier(swigCPtr, ModifierSpeciesReference.getCPtr(msr)); return ret; }
public void test_ModifierSpeciesReference() { ModifierSpeciesReference msr = new ModifierSpeciesReference(2,4); assertEquals( false, (msr.hasRequiredAttributes()) ); msr.setSpecies("msr"); assertEquals( true, msr.hasRequiredAttributes() ); msr = null; }