fractionRate.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_FRACTIONRATE_HPP
2 #define JULIAN_FRACTIONRATE_HPP
3 
5 #include <boost/serialization/export.hpp>
6 #include <boost/archive/text_oarchive.hpp>
7 #include <boost/archive/text_iarchive.hpp>
8 
9 namespace julian {
10 
25  class FractionRate: public Compounding {
26  public:
29  FractionRate(double input = 1.0): frequency_(input){};
30 
31  virtual double getCapitalization(double interest_rate, double accrual_time) const;
32  virtual double getRate(double future_value,double accrual_time) const;
33  virtual std::string info() const;
34 
35  virtual FractionRate* clone() const;
36  virtual ~FractionRate(){};
37 
38  friend std::ostream& operator<<(std::ostream& s, FractionRate& c);
39  friend class boost::serialization::access;
40  private:
41 
44  template<class Archive>
45  void serialize(Archive & ar, const unsigned int){
46  boost::serialization::base_object<Compounding>(*this);
47  ar & BOOST_SERIALIZATION_NVP(frequency_);
48  }
49 
50  double frequency_;
51  };
52 }
53 #endif
FractionRate(double input=1.0)
Constructor.
Definition: fractionRate.hpp:29
virtual FractionRate * clone() const
Virtual copy constructor.
Definition: fractionRate.cpp:32
The class encapsulates the fraction rate compounding method.
Definition: fractionRate.hpp:25
File contains interface of interest rate compounding concept.
double frequency_
Compounding frequency used by interest rate.
Definition: fractionRate.hpp:50
Definition: cadHoliday.cpp:3
virtual double getRate(double future_value, double accrual_time) const
Calculates interest rate.
Definition: fractionRate.cpp:24
virtual std::string info() const
Info about class.
Definition: fractionRate.cpp:49
Class is an abstract class expressing the concept of compounding interest rate.
Definition: compounding.hpp:23
void serialize(Archive &ar, const unsigned int)
interface used by Boost serialization library
Definition: fractionRate.hpp:45
virtual double getCapitalization(double interest_rate, double accrual_time) const
Calculates future value.
Definition: fractionRate.cpp:14
friend std::ostream & operator<<(std::ostream &s, FractionRate &c)
Overloads stream operator.
Definition: fractionRate.cpp:40