-
Notifications
You must be signed in to change notification settings - Fork 156
/
DBWrapper.h
62 lines (48 loc) · 2.02 KB
/
DBWrapper.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
/************************************************************************
* Copyright(c) 2022, 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. *
************************************************************************/
/*
* File: DBWrapper.h
* Author: [email protected]
* Project: lib/TFTrading
* Created: February 19, 2022 13:04
*/
#pragma once
// may need to inherit and add more functionality to the class:
#include <TFTrading/DBOps.h>
#include <TFTrading/PortfolioManager.h>
namespace ou {
namespace tf {
class db {
public:
db( const std::string& sFileName );
virtual ~db();
protected:
private:
using pPortfolio_t = ou::tf::PortfolioManager::pPortfolio_t;
using pPosition_t = ou::tf::PortfolioManager::pPosition_t;
ou::tf::DBOps m_db;
std::string m_sPortfolioStrategyAggregate;
pPortfolio_t m_pPortfolioMaster;
pPortfolio_t m_pPortfolioCurrencyUSD;
void HandlePopulateDatabase();
void HandleLoadDatabase();
void HandlePortfolioLoad( pPortfolio_t& pPortfolio );
void HandlePositionLoad( pPosition_t& pPosition );
void HandleDbOnLoad( ou::db::Session& session );
void HandleDbOnPopulate( ou::db::Session& session );
void HandleRegisterTables( ou::db::Session& session );
void HandleRegisterRows( ou::db::Session& session );
};
} // namespace tf
} // namespace ou