Exemple #1
0
        public static IoObject slotCallMessage(IoObject target, IoObject locals, IoObject message)
        {
            // setSlot("A", Object clone do(setSlot("B", method(call message))))
            IoCall self = target as IoCall;

            return(self.msg);
        }
Exemple #2
0
        //public override IoObject clone(IoState state)
        //{
        //    IoObject proto = state.protoWithInitFunc(name);
        //    IoCall result = new IoCall();
        //    uniqueIdCounter++;
        //    result.uniqueId = uniqueIdCounter;
        //    result.state = state;
        //    result.createProtos();
        //    result.createSlots();
        //    result.protos.Add(proto);
        //    return result;
        //}

        public static IoObject with(IoState state, IoObject sender, IoObject target,
                                    IoObject message, IoObject slotContext, IoObject activated, IoObject coro)
        {
            IoCall call = IoCall.createObject(state);

            call.sender      = sender;
            call.target      = target;
            call.msg         = message;
            call.slotContext = slotContext;
            call.activated   = activated;
            call.coroutine   = coro;
            call.stopStatus  = IoCallStatus.MESSAGE_STOP_STATUS_NORMAL;
            return(call);
        }
Exemple #3
0
        public override IoObject proto(IoState state)
        {
            IoCall pro = new IoCall();

            pro.state = state;
            pro.createSlots();
            pro.createProtos();
            state.registerProtoWithFunc(name, new IoStateProto(pro.name, pro, new IoStateProtoFunc(pro.proto)));
            pro.protos.Add(state.protoWithInitFunc("Object"));

            IoCFunction[] methodTable = new IoCFunction[] {
                new IoCFunction("sender", new IoMethodFunc(IoCall.slotSender)),
                new IoCFunction("target", new IoMethodFunc(IoCall.slotTarget)),
                new IoCFunction("message", new IoMethodFunc(IoCall.slotCallMessage)),
            };

            pro.addTaglessMethodTable(state, methodTable);
            return(pro);
        }
Exemple #4
0
        public override IoObject proto(IoState state)
        {
            IoCall pro = new IoCall();
            pro.state = state;
            pro.createSlots();
            pro.createProtos();
            state.registerProtoWithFunc(name, new IoStateProto(pro.name, pro, new IoStateProtoFunc(pro.proto)));
            pro.protos.Add(state.protoWithInitFunc("Object"));

            IoCFunction[] methodTable = new IoCFunction[] {
                new IoCFunction("sender", new IoMethodFunc(IoCall.slotSender)),
                new IoCFunction("target", new IoMethodFunc(IoCall.slotTarget)),
                new IoCFunction("message", new IoMethodFunc(IoCall.slotCallMessage)),
            };

            pro.addTaglessMethodTable(state, methodTable);
            return pro;
        }
Exemple #5
0
 public static new IoCall createProto(IoState state)
 {
     IoCall call = new IoCall();
     return call.proto(state) as IoCall;
 }
Exemple #6
0
 public static new IoCall createObject(IoState state)
 {
     IoCall call = new IoCall();
     return call.clone(state) as IoCall;
 }
Exemple #7
0
        public static IoObject slotTarget(IoObject target, IoObject locals, IoObject message)
        {
            IoCall self = target as IoCall;

            return(self.target);
        }
Exemple #8
0
        public static IoObject slotSender(IoObject target, IoObject locals, IoObject message)
        {
            IoCall self = target as IoCall;

            return(self.sender);
        }
Exemple #9
0
        public new static IoCall createObject(IoState state)
        {
            IoCall call = new IoCall();

            return(call.clone(state) as IoCall);
        }
Exemple #10
0
        public new static IoCall createProto(IoState state)
        {
            IoCall call = new IoCall();

            return(call.proto(state) as IoCall);
        }