Exemplo n.º 1
0
 public void SetId(MarketObject o, string id)
 {
     if (id != "")
     {
         _marketObjectIds[o] = id;
     }
 }
Exemplo n.º 2
0
        //! EUR => Yield/EUR/EUR6M, USD => Yield/USD/USD3M etc.
        public Dictionary <string, string> Mapping(MarketObject o, string configuration)
        {
            QLNet.Utils.QL_REQUIRE(HasConfiguration(configuration), () => "configuration " + configuration + " not found");

            if (_marketObjects.ContainsKey(o))
            {
                if (_marketObjects[o].ContainsKey(MarketObjectId(0, configuration)))
                {
                    return(_marketObjects[o][MarketObjectId(0, configuration)]);
                }
            }
            QLNet.Utils.QL_FAIL("market object of type " + o + " with id " + MarketObjectId(o, configuration) + " specified in configuration " + configuration + " not found");
            return(null);
        }
Exemplo n.º 3
0
 private void AddMarketObject(MarketObject o, string id, Dictionary <string, string> assignments)
 {
     if (!_marketObjects.ContainsKey(o))
     {
         Dictionary <string, Dictionary <string, string> > temp = new Dictionary <string, Dictionary <string, string> >();
         temp.Add(id, assignments);
         _marketObjects.Add(o, temp);
     }
     else
     {
         if (!_marketObjects[o].ContainsKey(id))
         {
             _marketObjects[o].Add(id, assignments);
         }
     }
     //_marketObjects[o][id] = assignments;
     foreach (KeyValuePair <string, string> s in assignments)
     {
         //DLOG("TodaysMarketParameters, add market objects of type " + o + ": " + id + " " + s.Key + " " + s.Value);
     }
 }
Exemplo n.º 4
0
 //! Individual term structure ids for a given configuration
 public string MarketObjectId(MarketObject o, string configuration)
 {
     QLNet.Utils.QL_REQUIRE(HasConfiguration(configuration), () => "configuration " + configuration + " not found");
     // TODO: Fixme!!
     return(_configurations[configuration].ToString()); // (o);
 }
Exemplo n.º 5
0
 public bool HasMarketObject(MarketObject o)
 {
     return(_marketObjects.ContainsKey(o));
 }