public void setPricer(InflationCouponPricer pricer) { Utils.QL_REQUIRE(checkPricerImpl(pricer), () => "pricer given is wrong type"); if (pricer_ != null) { pricer_.unregisterWith(update); } pricer_ = pricer; if (pricer_ != null) { pricer_.registerWith(update); } update(); }
protected override bool checkPricerImpl(InflationCouponPricer i) { return(i is YoYInflationCouponPricer); }
//! makes sure you were given the correct type of pricer // this can also done in external pricer setter classes via // accept/visit mechanism protected virtual bool checkPricerImpl(InflationCouponPricer i) { return(false); }
protected override bool checkPricerImpl(InflationCouponPricer pricer) { CPICouponPricer p = pricer as CPICouponPricer; return(p != null); }