protected void Add(Id id, string[] symbols, SymbolType[] types) { if (symbols.Length != types.Length) throw new ArgumentException("symbols.Length != types.Length"); for (int i = 0; i < symbols.Length; i++) Add(id, symbols[i].Trim(), types[i]); }
public void Initialize(IEnvironment env, IConfiguration cfg) { this.env = env; idService = env.GetIdService(); symbolType = SymbolType.Parse(cfg.getString("symbolType")); mainCfg = cfg; Read(cfg.getString("source")); }
public void Initialize(IEnvironment env, IConfiguration cfg) { this.env = env; idService = env.GetIdService(); symbolType = SymbolType.Parse(cfg.getString("symbolType")); backend = (IMDBackend)env.LoadPlugin(cfg.SubSet("be")); }
public static SymbolType Parse(string name) { SymbolType result; if (!all.TryGetValue(name, out result)) { result = new SymbolType(name); lock (sync) all = all.Add(name, result); } return result; }
public string GetSymbol(SymbolType type) { return idService.GetSymbol(this, type); }
private void Add(Id id, string symbol, SymbolType type) { Dictionary<Id, string> txmap = null; if (!txmaps.TryGetValue(type, out txmap)) { txmap = new Dictionary<Id, string>(); txmaps.Add(type, txmap); } txmap[id] = symbol; Dictionary<string, Id> rxmap = null; if (!rxmaps.TryGetValue(type, out rxmap)) { rxmap = new Dictionary<string, Id>(); rxmaps.Add(type, rxmap); } rxmap[symbol] = id; }
public string GetSymbol(Id id, SymbolType type) { return txmaps[type][id]; }
public Id GetId(string symbol, SymbolType type) { return rxmaps[type][symbol]; }
public Id CreateId(string[] symbols, SymbolType[] types) { Id id = new Id(this); Add(id, symbols, types); return id; }