1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2004, 2005, 2006 Ferdinando Ametrano
5 Copyright (C) 2006 Katiuscia Manzoni
6 Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
7 Copyright (C) 2003, 2004, 2005, 2006, 2008 StatPro Italia srl
8
9 This file is part of QuantLib, a free-software/open-source library
10 for financial quantitative analysts and developers - http://quantlib.org/
11
12 QuantLib is free software: you can redistribute it and/or modify it
13 under the terms of the QuantLib license. You should have received a
14 copy of the license along with this program; if not, please email
15 <quantlib-dev@lists.sf.net>. The license is also available online at
16 <http://quantlib.org/license.shtml>.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the license for more details.
21*/
22
23#include <ql/time/frequency.hpp>
24#include <ql/types.hpp>
25#include <ql/errors.hpp>
26
27namespace QuantLib {
28
29 std::ostream& operator<<(std::ostream& out, Frequency f) {
30 switch (f) {
31 case NoFrequency:
32 return out << "No-Frequency";
33 case Once:
34 return out << "Once";
35 case Annual:
36 return out << "Annual";
37 case Semiannual:
38 return out << "Semiannual";
39 case EveryFourthMonth:
40 return out << "Every-Fourth-Month";
41 case Quarterly:
42 return out << "Quarterly";
43 case Bimonthly:
44 return out << "Bimonthly";
45 case Monthly:
46 return out << "Monthly";
47 case EveryFourthWeek:
48 return out << "Every-fourth-week";
49 case Biweekly:
50 return out << "Biweekly";
51 case Weekly:
52 return out << "Weekly";
53 case Daily:
54 return out << "Daily";
55 case OtherFrequency:
56 return out << "Unknown frequency";
57 default:
58 QL_FAIL("unknown frequency (" << Integer(f) << ")");
59 }
60 }
61
62}
63

source code of quantlib/ql/time/frequency.cpp