1 //------------------------------------------------------------------------------ 2 // <auto-generated /> 3 // 4 // This file was automatically generated by SWIG (http://www.swig.org). 5 // Version 4.0.2 6 // 7 // Do not make changes to this file unless you know what you are doing--modify 8 // the SWIG interface file instead. 9 //------------------------------------------------------------------------------ 10 11 namespace libsbml { 12 13 using System; 14 using System.Runtime.InteropServices; 15 16 /** 17 * @sbmlpackage{core} 18 * 19 @htmlinclude pkg-marker-core.html Registry of all libSBML SBML DefinitionURLs. 20 * 21 * @htmlinclude libsbml-facility-only-warning.html 22 * 23 * LibSBML provides facilities for transforming and converting SBML 24 * documents in various ways. These transformations can involve 25 * essentially anything that can be written algorithmically; examples 26 * include converting the units of measurement in a model, or converting 27 * from one Level+Version combination of SBML to another. DefinitionURLs are 28 * implemented as objects derived from the class DefinitionURL. 29 * 30 * The DefinitionURL registry, implemented as a singleton object of class 31 * DefinitionURLRegistry, maintains a list of known DefinitionURLs and provides 32 * methods for discovering them. Callers can use the method 33 * DefinitionURLRegistry::getNumDefinitionURLs() to find out how many 34 * DefinitionURLs are registered, then use 35 * DefinitionURLRegistry::getDefinitionURLByIndex(@if java int@endif) to 36 * iterate over each one; alternatively, callers can use 37 * DefinitionURLRegistry::getDefinitionURLFor(@if java ConversionProperties@endif) 38 * to search for a DefinitionURL having specific properties. 39 */ 40 41 public class DefinitionURLRegistry : global::System.IDisposable { 42 private HandleRef swigCPtr; 43 protected bool swigCMemOwn; 44 DefinitionURLRegistry(IntPtr cPtr, bool cMemoryOwn)45 internal DefinitionURLRegistry(IntPtr cPtr, bool cMemoryOwn) 46 { 47 swigCMemOwn = cMemoryOwn; 48 swigCPtr = new HandleRef(this, cPtr); 49 } 50 getCPtr(DefinitionURLRegistry obj)51 internal static HandleRef getCPtr(DefinitionURLRegistry obj) 52 { 53 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 54 } 55 getCPtrAndDisown(DefinitionURLRegistry obj)56 internal static HandleRef getCPtrAndDisown (DefinitionURLRegistry obj) 57 { 58 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 59 60 if (obj != null) 61 { 62 ptr = obj.swigCPtr; 63 obj.swigCMemOwn = false; 64 } 65 66 return ptr; 67 } 68 ~DefinitionURLRegistry()69 ~DefinitionURLRegistry() { 70 Dispose(false); 71 } 72 Dispose()73 public void Dispose() { 74 Dispose(true); 75 global::System.GC.SuppressFinalize(this); 76 } 77 Dispose(bool disposing)78 protected virtual void Dispose(bool disposing) { 79 lock(this) { 80 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 81 if (swigCMemOwn) { 82 swigCMemOwn = false; 83 libsbmlPINVOKE.delete_DefinitionURLRegistry(swigCPtr); 84 } 85 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 86 } 87 } 88 } 89 90 91 /** 92 * Returns the singleton instance for the DefinitionURL registry. 93 * 94 * Prior to using the registry, callers have to obtain a copy of the 95 * registry. This static method provides the means for doing that. 96 * 97 * @return the singleton for the DefinitionURL registry. 98 */ public getInstance()99 static DefinitionURLRegistry getInstance() { 100 DefinitionURLRegistry ret = new DefinitionURLRegistry(libsbmlPINVOKE.DefinitionURLRegistry_getInstance(), false); 101 return ret; 102 } 103 104 105 /** 106 * Adds the given DefinitionURL to the registry of SBML DefinitionURLs. 107 * 108 * @param url the DefinitionURL to add to the registry. 109 * @param type the ASTNodeType_t of the URL to add to the registry. 110 * 111 * 112 * @return integer value indicating success/failure of the 113 * function. @if clike The value is drawn from the 114 * enumeration #OperationReturnValues_t. @endif The possible values 115 * returned by this function are: 116 * @li @link libsbml#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink 117 * @li @link libsbml#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT@endlink 118 */ public addDefinitionURL(string url, int type)119 static int addDefinitionURL(string url, int type) { 120 int ret = libsbmlPINVOKE.DefinitionURLRegistry_addDefinitionURL(url, type); 121 return ret; 122 } 123 124 125 /** 126 * Returns the number of DefinitionURLs known by the registry. 127 * 128 * @return the number of registered DefinitionURLs. 129 * 130 * @see getDefinitionURLByIndex(@if java int@endif) 131 */ public getNumDefinitionURLs()132 static int getNumDefinitionURLs() { 133 int ret = libsbmlPINVOKE.DefinitionURLRegistry_getNumDefinitionURLs(); 134 return ret; 135 } 136 137 138 /** */ public addSBMLDefinitions()139 static void addSBMLDefinitions() { 140 libsbmlPINVOKE.DefinitionURLRegistry_addSBMLDefinitions(); 141 } 142 143 144 /** */ public getCoreDefinitionsAdded()145 static bool getCoreDefinitionsAdded() { 146 bool ret = libsbmlPINVOKE.DefinitionURLRegistry_getCoreDefinitionsAdded(); 147 return ret; 148 } 149 150 151 /** */ public getType(string url)152 static int getType(string url) { 153 int ret = libsbmlPINVOKE.DefinitionURLRegistry_getType(url); 154 return ret; 155 } 156 157 158 /** */ public getDefinitionUrlByIndex(int index)159 static string getDefinitionUrlByIndex(int index) { 160 string ret = libsbmlPINVOKE.DefinitionURLRegistry_getDefinitionUrlByIndex(index); 161 return ret; 162 } 163 164 165 /** */ public clearDefinitions()166 static void clearDefinitions() { 167 libsbmlPINVOKE.DefinitionURLRegistry_clearDefinitions(); 168 } 169 170 } 171 172 } 173