public AbstractPipe(IExpire <Pipe <T> > e, IFlagable f) { this.myExpire = e; this.myFlagable = f; // TODO, consider providing this object with a better NocabName // than the default uuid from a NocabNamable. this.myNocabName = new NocabNameable(this); }
public void loadJson(JsonObject jo) { if (!jo.ContainsKey("Type")) { throw new InvalidLoadType("Missing Type field, this is not valid json object"); } if (jo["Type"] != _MyJsonType) { throw new InvalidLoadType("JsonObject has invalid type: " + jo["Type"]); } PipeFactory <T> pipeFactory = new PipeFactory <T>(); Pipe <T> newPipe = pipeFactory.fromJson(jo); this.MyNocabName = new NocabNameable(jo["NocabName"], this); }
protected void abstractLoadJson(JsonObject jo) { if (!jo.ContainsKey("Type")) { throw new InvalidLoadType("Missing Type field, this is not valid json object"); } if (jo["Type"] != _MyType) { throw new InvalidLoadType("JsonObject has invalid type: " + jo["Type"]); } // TODO: this is an abstract class. Should the CentralRegistry of NocabNamables // have a refrence to this abstraction? I guess, what happens if you try to cast // an abstract class as the (hopefully) correct base class? I guess everything should // still work out ok... Maybe? this.myNocabName = new NocabNameable(jo["NocabName"], this); this.myFlagable = new Flagable(); this.myFlagable.loadJson(jo["Flags"]); // Load the JsonObject into myFlagable ExpireableFactory <Pipe <T> > expireFactory = new ExpireableFactory <Pipe <T> >(); this.myExpire = expireFactory.fromJson(jo["Expire"]); }
public PipeLine() { this.pipes = new Dictionary <string, HashSet <Pipe <T> > >(); this.MyNocabName = new NocabNameable(this); }