Example #1
0
        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]);
        }
Example #2
0
        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"));
        }
Example #3
0
        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"));
        }
Example #4
0
 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;
 }
Example #5
0
File: Id.cs Project: rc153/LTF
 public string GetSymbol(SymbolType type)
 {
     return idService.GetSymbol(this, type);
 }
Example #6
0
        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;
        }
Example #7
0
 public string GetSymbol(Id id, SymbolType type)
 {
     return txmaps[type][id];
 }
Example #8
0
 public Id GetId(string symbol, SymbolType type)
 {
     return rxmaps[type][symbol];
 }
Example #9
0
 public Id CreateId(string[] symbols, SymbolType[] types)
 {
     Id id = new Id(this);
     Add(id, symbols, types);
     return id;
 }