GetClassesByIterator
If input class is zero, the handle will point to the first relevant class.
If all classes are past (or no relevant classes are found), the function will return 0.
Syntax
public const string enginedll = @"engine.dll"; [DllImport(enginedll, EntryPoint = "GetClassesByIterator")] public static extern Int64 GetClassesByIterator(Int64 model, Int64 owlClass);
Property model
Size: 64 bit / 8 byte (value)Property owlClass
Size: 64 bit / 8 byte (value)
Example (based on pure API calls)
Here you can find code snippits that show how the API call GetClassesByIterator can be used.
using RDF; // include at least engine.cs within your solution public Int64 GetClassCnt(Int64 model) { Int64 classCnt = 0, myIteratedClass = RDF.engine.GetClassesByIterator(model, 0); while (myIteratedClass != 0) { IntPtr classNamePtr = IntPtr.Zero; RDF.engine.GetNameOfClass(myIteratedClass, out classNamePtr); string className = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(classNamePtr); Console.WriteLine(className); myIteratedClass = RDF.engine.GetClassesByIterator(model, myIteratedClass); classCnt++; } Console.WriteLine(); return classCnt; } public void Example() { Int64 model = RDF.engine.CreateModel(); if (model != 0) { Int64 classCnt = GetClassCnt(model); // // Add a new class // RDF.engine.CreateClass(model, "CreatedClassToTestClassCnt"); System.Diagnostics.Debug.Assert(GetClassCnt(model) == classCnt + 1); Int64 classCntThroughAPI = 0; RDF.engine.OrderedHandles(model, out classCntThroughAPI, (IntPtr) null, (IntPtr) null, 0, 0); System.Diagnostics.Debug.Assert(GetClassCnt(model) == classCntThroughAPI); RDF.engine.CloseModel(model); } }