private static void NewInstance(ExternalPtr ptr, AtomList args) { External instance; Class cl = Internal.pass.klass; // set by native side Internal.extptr = ptr; // Post("CLASS-NEW {0}",cl); try { // TODO: create dynamic delegate for that.... System.Reflection.ConstructorInfo m = cl.extclass.GetConstructor(new Type[1] { typeof(Atom[]) }); if (m != null) { instance = (External)m.Invoke(new object[1] { (Atom[])args }); } else { // search for the argument-less constructor... it must exist, we searched before m = cl.extclass.GetConstructor(System.Type.EmptyTypes); instance = (External)m.Invoke(null); } } catch (Exception exc) { instance = null; PostError(exc.ToString()); } #if DEBUG Internal.extptr.Clear(); #endif Internal.pass.ext = instance; // back to native }
internal extern static void Unbind(ExternalPtr obj, Symbol dst);
internal extern static void AddInlet(ExternalPtr obj, Symbol type); // create proxy inlet (typed)
internal extern static void AddInlet(ExternalPtr obj, ref Symbol s);
internal extern static void AddInlet(ExternalPtr obj, Symbol sel, Symbol to_sel);
internal extern static void Outlet(ExternalPtr obj, int n, Atom a);
internal extern static void OutletEx(ExternalPtr obj, int n, object o);
internal extern static void AddInlet(ExternalPtr obj,ref Pointer f);
internal extern static void AddInlet(ExternalPtr obj, ref float f);
// -------------------------------------------------------------------------- protected External() { ptr = Internal.extptr; klass = Internal.pass.klass; }
private static void NewInstance(ExternalPtr ptr,AtomList args) { External instance; Class cl = Internal.pass.klass; // set by native side Internal.extptr = ptr; // Post("CLASS-NEW {0}",cl); try { // TODO: create dynamic delegate for that.... System.Reflection.ConstructorInfo m = cl.extclass.GetConstructor(new Type[1] { typeof(Atom[]) }); if (m != null) instance = (External)m.Invoke(new object[1] { (Atom[])args }); else { // search for the argument-less constructor... it must exist, we searched before m = cl.extclass.GetConstructor(System.Type.EmptyTypes); instance = (External)m.Invoke(null); } } catch (Exception exc) { instance = null; PostError(exc.ToString()); } #if DEBUG Internal.extptr.Clear(); #endif Internal.pass.ext = instance; // back to native }
internal extern static void Outlet(ExternalPtr obj, int n, float f);
internal extern static void AddInlet(ExternalPtr obj); // create proxy inlet (anything)
internal extern static void Outlet(ExternalPtr obj, int n, Pointer p);
internal extern static void AddOutlet(ExternalPtr obj, Symbol type);
internal extern static void Outlet(ExternalPtr obj, int n, Symbol s, Atom[] l);
internal extern static void Outlet(ExternalPtr obj, int n, Symbol s);
internal extern static void AddInlet(ExternalPtr obj, ref Pointer f);