-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathHDF5Attribute.h
89 lines (71 loc) · 3.44 KB
/
HDF5Attribute.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/************************************************************************
* Copyright(c) 2009, One Unified. All rights reserved. *
* email: [email protected] *
* *
* This file is provided as is WITHOUT ANY WARRANTY *
* without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* This software may not be used nor distributed without proper license *
* agreement. *
* *
* See the file LICENSE.txt for redistribution information. *
************************************************************************/
#pragma once
#include <string>
#include <boost/cstdint.hpp>
#include "HDF5DataManager.h"
#include <TFTrading/TradingEnumerations.h>
#include <TFTrading/KeyTypes.h>
namespace ou { // One Unified
namespace tf { // TradeFrame
class HDF5Attributes{
public:
struct structOption {
//std::string sUnderlying;
double dblStrike;
unsigned short nYear;
unsigned short nMonth;
unsigned short nDay;
OptionSide::EOptionSide eSide;
structOption( void ) : dblStrike( 0 ), nYear( 0 ), nMonth( 0 ), nDay( 0 ), eSide( OptionSide::Unknown ) {};
structOption( double dblStrike_, unsigned short nYear_, unsigned short nMonth_, unsigned short nDay_, OptionSide::EOptionSide eSide_ )
: dblStrike( dblStrike_ ), nYear( nYear_ ), nMonth( nMonth_ ), nDay( nDay_), eSide( eSide_ ) {};
};
struct structFuture {
unsigned short nYear;
unsigned short nMonth;
unsigned short nDay;
structFuture( void ) :nYear( 0 ), nMonth( 0 ), nDay( 0 ) {};
structFuture( unsigned short nYear_, unsigned short nMonth_, unsigned short nDay_ )
: nYear( nYear_ ), nMonth( nMonth_ ), nDay( nDay_) {};
};
HDF5Attributes( HDF5DataManager& dm );
HDF5Attributes( HDF5DataManager& dm, const std::string& sPath );
HDF5Attributes( HDF5DataManager& dm, const std::string& sPath, InstrumentType::EInstrumentType );
HDF5Attributes( HDF5DataManager& dm, const std::string& sPath, const structOption& );
HDF5Attributes( HDF5DataManager& dm, const std::string& sPath, const structFuture& );
~HDF5Attributes(void);
void SetSignature( boost::uint64_t ); // left to right reading: 9=datetime, 8=char, 1=double, 2=16 3=32, 4=64
boost::uint64_t GetSignature();
void SetInstrumentType( InstrumentType::EInstrumentType );
InstrumentType::EInstrumentType GetInstrumentType( void );
void SetProviderType( keytypes::eidProvider_t );
keytypes::eidProvider_t GetProviderType( void );
void SetOptionAttributes( const structOption& );
void GetOptionAttributes( structOption* );
void SetFutureAttributes( const structFuture& );
void GetFutureAttributes( structFuture* );
void SetSignificantDigits( unsigned char );
unsigned char GetSignificantDigits( void );
void SetMultiplier( unsigned short );
unsigned short GetMultiplier( void );
protected:
void OpenDataSet( const std::string& sPath );
void CloseDataSet( void );
private:
HDF5DataManager& m_dm;
H5::DataSet *m_pDataSet;
};
} // namespace tf
} // namespace ou