zeroCouponBond.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_ZEROCOUPONBOND_HPP
2 #define JULIAN_ZEROCOUPONBOND_HPP
3 
7 
8 namespace julian {
21  class ZeroCouponBond: public Bond {
22  public:
28  ZeroCouponBond(Date issue_date, Date maturity_date, double principal, CashFlowVector cash_flows):
29  issue_date_(issue_date), maturity_date_(maturity_date), principal_(principal), cash_flows_(cash_flows) {};
33  virtual void valuation(const SmartPointer<ir::Curve>&) const override;
34  virtual void valuation(const SmartPointer<ir::Curve>&,
35  const SmartPointer<ir::Curve>&) const override;
36  virtual double prize(const SmartPointer<ir::Curve>&) const override;
37  virtual double prize(const SmartPointer<ir::Curve>&,
38  const SmartPointer<ir::Curve>&) const override;
39 
40  virtual double getPrincipal() const override;
41  virtual Date getDate() const override;
42  virtual ZeroCouponBond* clone() const;
44 
45  virtual ~ZeroCouponBond(){};
46 
47  friend std::ostream& operator<<(std::ostream&, ZeroCouponBond&);
48 
49  private:
52  double principal_;
54  };
55 }
56 
57 #endif
friend std::ostream & operator<<(std::ostream &, ZeroCouponBond &)
Overloads stream operator.
Definition: zeroCouponBond.cpp:58
virtual ZeroCouponBond * clone() const
virtual copy constructor
Definition: zeroCouponBond.cpp:69
virtual double getPrincipal() const override
returns the bond&#39;s principal
Definition: zeroCouponBond.cpp:9
Definition: cadHoliday.cpp:3
virtual Date getDate() const override
returns the bond&#39;s maturity
Definition: zeroCouponBond.cpp:15
Class helps to handle the vector of CFs.
Definition: CashFlowVector.hpp:22
File contains interface for all bond instruments.
Date issue_date_
Bond&#39;s issue date.
Definition: zeroCouponBond.hpp:50
Date maturity_date_
Date of repaying original sum loaned.
Definition: zeroCouponBond.hpp:51
Class is an abstract class expressing the concept of bonds.
Definition: bond.hpp:20
virtual void valuation(const SmartPointer< ir::Curve > &) const override
bond valuation
Definition: zeroCouponBond.cpp:39
ZeroCouponBond()
Default constructor.
Definition: zeroCouponBond.hpp:25
ZeroCouponBond(Date issue_date, Date maturity_date, double principal, CashFlowVector cash_flows)
Constructor.
Definition: zeroCouponBond.hpp:28
double principal_
Principal of bond.
Definition: zeroCouponBond.hpp:52
Class implements a date object.
Definition: date.hpp:27
virtual double prize(const SmartPointer< ir::Curve > &) const override
prize bond
Definition: zeroCouponBond.cpp:23
CashFlowVector cash_flows_
Cash Flow Vector containing julian::FixedCashFlow.
Definition: zeroCouponBond.hpp:53
Class implements the zero coupon bond.
Definition: zeroCouponBond.hpp:21
File contains definition of InterestRate class.
File contains definition of cash flow vector.