/
HDF5Attribute.h
77 lines (62 loc) · 2.89 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
/************************************************************************
* Copyright(c) 2009, One Unified. All rights reserved. *
* *
* 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 "HDF5DataManager.h"
#include <LibTrading/TradingEnumerations.h>
namespace ou { // One Unified
namespace tf { // TradeFrame
class CHDF5Attributes {
public:
struct structOption {
//std::string sUnderlying;
double dblStrike;
unsigned short nYear;
unsigned short nMonth;
unsigned short nDay;
OptionSide::enumOptionSide 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::enumOptionSide 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_) {};
};
CHDF5Attributes(void);
CHDF5Attributes( const std::string& sPath );
CHDF5Attributes( const std::string& sPath, InstrumentType::enumInstrumentTypes );
CHDF5Attributes( const std::string& sPath, const structOption& );
CHDF5Attributes( const std::string& sPath, const structFuture& );
~CHDF5Attributes(void);
void OpenDataSet( const std::string& sPath );
void CloseDataSet( void );
void SetInstrumentType( InstrumentType::enumInstrumentTypes );
InstrumentType::enumInstrumentTypes GetInstrumentType( void );
void SetProviderId( unsigned short );
unsigned short GetProviderId( void );
void SetOptionAttributes( const structOption& );
void GetOptionAttributes( structOption* );
void SetFutureAttributes( const structFuture& );
void GetFutureAttributes( structFuture* );
protected:
private:
CHDF5DataManager dm;
H5::DataSet *m_pDataSet;
};
} // namespace tf
} // namespace ou