QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
business252.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Piter Dias
5 Copyright (C) 2011 StatPro Italia srl
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_business252_day_counter_hpp
26#define quantlib_business252_day_counter_hpp
27
28#include <ql/time/calendar.hpp>
29#include <ql/time/calendars/brazil.hpp>
30#include <ql/time/daycounter.hpp>
31#include <utility>
32
33namespace QuantLib {
34
36
37 class Business252 : public DayCounter {
38 private:
39 class Impl final : public DayCounter::Impl {
40 private:
42 public:
43 std::string name() const override;
44 Date::serial_type dayCount(const Date& d1, const Date& d2) const override;
45 Time
46 yearFraction(const Date& d1, const Date& d2, const Date&, const Date&) const override;
47 explicit Impl(Calendar c) : calendar_(std::move(c)) {}
48 };
49 public:
51 : DayCounter(ext::shared_ptr<DayCounter::Impl>(new Business252::Impl(c))) {}
52 };
53
54}
55
56#endif
Brazilian calendar.
Definition: brazil.hpp:77
Date::serial_type dayCount(const Date &d1, const Date &d2) const override
to be overloaded by more complex day counters
Definition: business252.cpp:78
Time yearFraction(const Date &d1, const Date &d2, const Date &, const Date &) const override
std::string name() const override
Definition: business252.cpp:72
Business/252 day count convention.
Definition: business252.hpp:37
Business252(const Calendar &c=Brazil())
Definition: business252.hpp:50
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
std::int_fast32_t serial_type
serial number type
Definition: date.hpp:128
abstract base class for day counter implementations
Definition: daycounter.hpp:47
day counter class
Definition: daycounter.hpp:44
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
Definition: any.hpp:35
STL namespace.