//TODO: Introduce code that just returns an encoded string //Since all that will be returned is the string itself and the //width and height; and an error code (potentially) why not just set it up as //such. I bet that the encoding of the hashtable isn't that efficient. public override Message Invoke(Message input) { Hashtable table = (Hashtable)input.Value; TranslateData(table); return new Message(Guid.NewGuid(), ObjectID, input.Sender, MessageOperationType.Return, Transform(table)); }
public Message Invoke(Message input) { return this[input.Receiver].Invoke(input); }
public abstract Message Invoke(Message input);
public virtual void OnSystemCall(Message incoming) { //do nothing }
public virtual void Receive(Message incoming) { switch(incoming.OperationType) { case MessageOperationType.Pass: OnPass(incoming); break; case MessageOperationType.Execute: OnExecute(incoming); break; case MessageOperationType.Return: OnReturn(incoming); break; case MessageOperationType.System: OnSystemCall(incoming); break; case MessageOperationType.Init: OnInit(incoming); break; case MessageOperationType.Failure: throw new ArgumentException(string.Format("Error: {0}", incoming.Value)); default: DispatchTo(incoming.Sender, ObjectID, MessageOperationType.Failure, "Invalid Action Given"); break; } }
public virtual void OnReturn(Message incoming) { //do nothing }
public virtual void OnPass(Message incoming) { //do nothing }
public virtual void OnInit(Message incoming) { //do nothing }
public virtual void OnExecute(Message incoming) { //do nothing }
public abstract void DispatchTo(Message mess);