QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
region.cpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007 Chris Kenyon
5 Copyright (C) 2014 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#include <ql/indexes/region.hpp>
22
23namespace QuantLib {
24
25 CustomRegion::CustomRegion(const std::string& name,
26 const std::string& code) {
27 data_ = ext::make_shared<Data>(name,code);
28 }
29
30
32 static ext::shared_ptr<Data> AUdata(new Data("Australia","AU"));
33 data_ = AUdata;
34 }
35
37 static ext::shared_ptr<Data> EUdata(new Data("EU","EU"));
38 data_ = EUdata;
39 }
40
42 static ext::shared_ptr<Data> FRdata(new Data("France","FR"));
43 data_ = FRdata;
44 }
45
47 static ext::shared_ptr<Data> UKdata(new Data("UK","UK"));
48 data_ = UKdata;
49 }
50
52 static ext::shared_ptr<Data> USdata(new Data("USA","US"));
53 data_ = USdata;
54 }
55
57 static ext::shared_ptr<Data> ZAdata(new Data("South Africa","ZA"));
58 data_ = ZAdata;
59 }
60
61
62}
63
CustomRegion(const std::string &name, const std::string &code)
Definition: region.cpp:25
const std::string & code() const
Definition: region.hpp:117
const std::string & name() const
Definition: region.hpp:113
ext::shared_ptr< Data > data_
Definition: region.hpp:46
Definition: any.hpp:35