timeseries.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) 2007, 2008 Ferdinando Ametrano
5  Copyright (C) 2007 Eric Ehlers
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 #ifndef qla_timeseries_hpp
22 #define qla_timeseries_hpp
23 
24 #include <oh/libraryobject.hpp>
25 
26 #include <ql/types.hpp>
27 #include <map>
28 
29 namespace QuantLib {
30  class Date;
31  class Index;
32 
33  template<class T, class Container>
34  class TimeSeries;
35 
37 }
38 
39 namespace QuantLibAddin {
40 
41  class TimeSeriesDef : public ObjectHandler::LibraryObject<QuantLib::TimeSeriesDef> {
42  public:
44  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
45  const std::vector<QuantLib::Date>& dates,
46  const std::vector<QuantLib::Real>& values,
47  bool permanent);
48  // QuantLib::Index::timeSeries()
50  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
51  const boost::shared_ptr<QuantLib::Index>& index,
52  bool permanent);
53  // Addin function qlTimeSeriesValue() requires address of QuantLib::TimeSeries::operator[]
54  // but the autogenerated code causes VC7 to crash (VC7 doesn't support address of operator
55  // of template class?) so here we wrap [] and let VC7 use the adddress of the wrapper.
56  QuantLib::Real subscriptWrapper(const QuantLib::Date& d);
57  };
58 }
59 
60 #endif
Definition: timeseries.hpp:41
Definition: abcd.hpp:38
Definition: timeseries.hpp:34
QuantLib::Real subscriptWrapper(const QuantLib::Date &d)
Definition: abcd.hpp:30
TimeSeries< QuantLib::Real, std::map< QuantLib::Date, QuantLib::Real > > TimeSeriesDef
Definition: timeseries.hpp:34
TimeSeriesDef(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const std::vector< QuantLib::Date > &dates, const std::vector< QuantLib::Real > &values, bool permanent)