bondBuilder.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_BONDBUILDER_HPP
2 #define JULIAN_BONDBUILDER_HPP
3 
7 namespace julian {
26  class BuildBond {
27  public:
28  BuildBond();
29 
30  BuildBond& withNotional(const double&);
31 
33  BuildBond& withStartDate(const Date&);
36  BuildBond& withTenor(const Tenor&);
37 
39  BuildBond& withCoupon(const double&);
40  BuildBond& withMargin(const double&);
41  BuildBond& withFaceValue(const double&);
43 
44  operator FixedIncomeBond();
45  operator FloatingRateBond();
46  operator ZeroCouponBond();
47 
48  private:
49 
50  void reset();
51  void datesCalculation();
52 
53  double notional_;
54  double coupon_;
55  double margin_;
56  double face_amount_;
66  };
67 }
68 
69 #endif
File contains definition of FixedIncomeBond.
BuildBond & withFaceValue(const double &)
sets face value for zero-coupon bond
Definition: bondBuilder.cpp:71
BuildBond & withMaturityDate(const Date &)
sets maturity date
Definition: bondBuilder.cpp:42
Date start_date_
Date from which bond starts to accrue value.
Definition: bondBuilder.hpp:58
Class implements builder design pattern supporting construction of bonds.
Definition: bondBuilder.hpp:26
void reset()
resets inputs to default values
Definition: bondBuilder.cpp:97
BuildBond & withMargin(const double &)
sets bond margin
Definition: bondBuilder.cpp:78
Definition: cadHoliday.cpp:3
BuildBond & withInterestRate(const InterestRate &)
sets interest rate convention
Definition: bondBuilder.cpp:85
Class implements calendar object.
Definition: calendar.hpp:30
double notional_
Notional of the bond.
Definition: bondBuilder.hpp:53
BuildBond & withTenor(const Tenor &)
sets maturity
Definition: bondBuilder.cpp:50
BuildBond & withCoupon(const double &)
sets bond coupon
Definition: bondBuilder.cpp:64
double face_amount_
Face amount of Zero coupon bond.
Definition: bondBuilder.hpp:56
Class implements the bond paying fixed coupon.
Definition: fixedIncomeBond.hpp:22
BuildBond & withCommenceOfTradingDate(const Date &)
sets commence of trading date
Definition: bondBuilder.cpp:35
Tenor maturity_
Maturity of the bond.
Definition: bondBuilder.hpp:62
File contains implementation of ZeroCouponBond.
double margin_
Margin of floating rate bond.
Definition: bondBuilder.hpp:55
File contains definition of FloatingRateBond.
Class implements the bond paying floating coupon.
Definition: floatingRateBond.hpp:22
Frequency payment_frequency_
Frequency of payment.
Definition: bondBuilder.hpp:65
BuildBond & withFrequencyOfPayment(const Frequency &)
sets frequency of payment
Definition: bondBuilder.cpp:57
Date maturity_date_
Calendar used by a curve.
Definition: bondBuilder.hpp:60
BuildBond & usingCalendar(const Calendar &)
sets calendar
Definition: bondBuilder.cpp:21
double coupon_
Coupon paid by bond.
Definition: bondBuilder.hpp:54
void datesCalculation()
calculates
Definition: bondBuilder.cpp:109
Class implements a date object.
Definition: date.hpp:27
InterestRate rate_
Interest rate convention.
Definition: bondBuilder.hpp:64
BuildBond()
default constructor
Definition: bondBuilder.cpp:8
BuildBond & withNotional(const double &)
sets notional
Definition: bondBuilder.cpp:14
Class implements a tenor object.
Definition: tenor.hpp:23
Date commence_of_trading_date_
Bond issue date.
Definition: bondBuilder.hpp:59
The class implements the concept of interest rate.
Definition: interestRate.hpp:25
Calendar calendar_
Calendar used to construct the bond.
Definition: bondBuilder.hpp:57
Frequency
Definition: timeUnit.hpp:68
Class implements the zero coupon bond.
Definition: zeroCouponBond.hpp:21
BuildBond & withStartDate(const Date &)
sets start date
Definition: bondBuilder.cpp:28