QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
business252.hpp
Go to the documentation of this file.
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
21/*! \file business252.hpp
22 \brief business/252 day counter
23*/
24
25#ifndef quantlib_business252_day_counter_hpp
26#define quantlib_business252_day_counter_hpp
27
28#include <ql/time/calendar.hpp>
31#include <utility>
32
33namespace QuantLib {
34
35 //! Business/252 day count convention
36 /*! \ingroup daycounters */
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.
calendar class
Brazilian calendar.
Definition: brazil.hpp:78
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
day counter class
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
Definition: any.hpp:35
STL namespace.