QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
experimental
commodities
petroleumunitsofmeasure.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) 2008 J. Erik Radmall
5
6
This file is part of QuantLib, a free-software/open-source library
7
for financial quantitative analysts and developers - http://quantlib.org/
8
9
QuantLib is free software: you can redistribute it and/or modify it
10
under the terms of the QuantLib license. You should have received a
11
copy of the license along with this program; if not, please email
12
<quantlib-dev@lists.sf.net>. The license is also available online at
13
<http://quantlib.org/license.shtml>.
14
15
This program is distributed in the hope that it will be useful, but WITHOUT
16
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
FOR A PARTICULAR PURPOSE. See the license for more details.
18
*/
19
20
/*! \file petroleumunitsofmeasure.hpp
21
\brief Petroleum units of measure
22
*/
23
24
#ifndef quantlib_petroleum_units_of_measure_hpp
25
#define quantlib_petroleum_units_of_measure_hpp
26
27
#include <
ql/experimental/commodities/unitofmeasure.hpp
>
28
29
namespace
QuantLib
{
30
31
class
BarrelUnitOfMeasure
:
public
UnitOfMeasure
{
32
public
:
33
BarrelUnitOfMeasure
() {
34
static
ext::shared_ptr<Data> data(
35
new
Data
(
"Barrels"
,
"BBL"
,
UnitOfMeasure::Volume
));
36
data_
= data;
37
}
38
};
39
40
class
MTUnitOfMeasure
:
public
UnitOfMeasure
{
41
public
:
42
MTUnitOfMeasure
() {
43
static
ext::shared_ptr<Data> data(
44
new
Data
(
"Metric Tonnes"
,
"MT"
,
UnitOfMeasure::Mass
));
45
data_
= data;
46
}
47
};
48
49
class
MBUnitOfMeasure
:
public
UnitOfMeasure
{
50
public
:
51
MBUnitOfMeasure
() {
52
static
ext::shared_ptr<Data> data(
53
new
Data
(
"1000 Barrels"
,
"MB"
,
UnitOfMeasure::Volume
,
54
BarrelUnitOfMeasure
()));
55
data_
= data;
56
}
57
};
58
59
class
GallonUnitOfMeasure
:
public
UnitOfMeasure
{
60
public
:
61
GallonUnitOfMeasure
() {
62
static
ext::shared_ptr<Data> data(
63
new
Data
(
"US Gallons"
,
"GAL"
,
UnitOfMeasure::Volume
,
64
BarrelUnitOfMeasure
()));
65
data_
= data;
66
}
67
};
68
69
class
LitreUnitOfMeasure
:
public
UnitOfMeasure
{
70
public
:
71
LitreUnitOfMeasure
() {
72
static
ext::shared_ptr<Data> data(
73
new
Data
(
"Litres"
,
"l"
,
UnitOfMeasure::Volume
,
74
BarrelUnitOfMeasure
()));
75
data_
= data;
76
}
77
};
78
79
class
KilolitreUnitOfMeasure
:
public
UnitOfMeasure
{
80
public
:
81
KilolitreUnitOfMeasure
() {
82
static
ext::shared_ptr<Data> data(
83
new
Data
(
"Kilolitres"
,
"kl"
,
UnitOfMeasure::Volume
,
84
BarrelUnitOfMeasure
()));
85
data_
= data;
86
}
87
};
88
89
class
TokyoKilolitreUnitOfMeasure
:
public
UnitOfMeasure
{
90
public
:
91
TokyoKilolitreUnitOfMeasure
() {
92
static
ext::shared_ptr<Data> data(
93
new
Data
(
"Tokyo Kilolitres"
,
"KL_tk"
,
UnitOfMeasure::Volume
,
94
BarrelUnitOfMeasure
()));
95
data_
= data;
96
}
97
};
98
99
}
100
101
102
#endif
QuantLib::BarrelUnitOfMeasure
Definition:
petroleumunitsofmeasure.hpp:31
QuantLib::BarrelUnitOfMeasure::BarrelUnitOfMeasure
BarrelUnitOfMeasure()
Definition:
petroleumunitsofmeasure.hpp:33
QuantLib::GallonUnitOfMeasure
Definition:
petroleumunitsofmeasure.hpp:59
QuantLib::GallonUnitOfMeasure::GallonUnitOfMeasure
GallonUnitOfMeasure()
Definition:
petroleumunitsofmeasure.hpp:61
QuantLib::KilolitreUnitOfMeasure
Definition:
petroleumunitsofmeasure.hpp:79
QuantLib::KilolitreUnitOfMeasure::KilolitreUnitOfMeasure
KilolitreUnitOfMeasure()
Definition:
petroleumunitsofmeasure.hpp:81
QuantLib::LitreUnitOfMeasure
Definition:
petroleumunitsofmeasure.hpp:69
QuantLib::LitreUnitOfMeasure::LitreUnitOfMeasure
LitreUnitOfMeasure()
Definition:
petroleumunitsofmeasure.hpp:71
QuantLib::MBUnitOfMeasure
Definition:
petroleumunitsofmeasure.hpp:49
QuantLib::MBUnitOfMeasure::MBUnitOfMeasure
MBUnitOfMeasure()
Definition:
petroleumunitsofmeasure.hpp:51
QuantLib::MTUnitOfMeasure
Definition:
petroleumunitsofmeasure.hpp:40
QuantLib::MTUnitOfMeasure::MTUnitOfMeasure
MTUnitOfMeasure()
Definition:
petroleumunitsofmeasure.hpp:42
QuantLib::TokyoKilolitreUnitOfMeasure
Definition:
petroleumunitsofmeasure.hpp:89
QuantLib::TokyoKilolitreUnitOfMeasure::TokyoKilolitreUnitOfMeasure
TokyoKilolitreUnitOfMeasure()
Definition:
petroleumunitsofmeasure.hpp:91
QuantLib::UnitOfMeasure
Unit of measure specification
Definition:
unitofmeasure.hpp:37
QuantLib::UnitOfMeasure::Volume
@ Volume
Definition:
unitofmeasure.hpp:39
QuantLib::UnitOfMeasure::Mass
@ Mass
Definition:
unitofmeasure.hpp:39
QuantLib::UnitOfMeasure::data_
ext::shared_ptr< Data > data_
Definition:
unitofmeasure.hpp:70
QuantLib
Definition:
any.hpp:35
QuantLib::UnitOfMeasure::Data
Definition:
unitofmeasure.hpp:76
unitofmeasure.hpp
Unit of measure.
Generated by
Doxygen
1.9.5