1/*
2 * Legal Notice
3 *
4 * This document and associated source code (the "Work") is a part of a
5 * benchmark specification maintained by the TPC.
6 *
7 * The TPC reserves all right, title, and interest to the Work as provided
8 * under U.S. and international laws, including without limitation all patent
9 * and trademark rights therein.
10 *
11 * No Warranty
12 *
13 * 1.1 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE INFORMATION
14 * CONTAINED HEREIN IS PROVIDED "AS IS" AND WITH ALL FAULTS, AND THE
15 * AUTHORS AND DEVELOPERS OF THE WORK HEREBY DISCLAIM ALL OTHER
16 * WARRANTIES AND CONDITIONS, EITHER EXPRESS, IMPLIED OR STATUTORY,
17 * INCLUDING, BUT NOT LIMITED TO, ANY (IF ANY) IMPLIED WARRANTIES,
18 * DUTIES OR CONDITIONS OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
19 * PURPOSE, OF ACCURACY OR COMPLETENESS OF RESPONSES, OF RESULTS, OF
20 * WORKMANLIKE EFFORT, OF LACK OF VIRUSES, AND OF LACK OF NEGLIGENCE.
21 * ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT,
22 * QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT
23 * WITH REGARD TO THE WORK.
24 * 1.2 IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THE WORK BE LIABLE TO
25 * ANY OTHER PARTY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO THE
26 * COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS
27 * OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT,
28 * INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY,
29 * OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT
30 * RELATING TO THE WORK, WHETHER OR NOT SUCH AUTHOR OR DEVELOPER HAD
31 * ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
32 *
33 * Contributors
34 * - Christopher Chan-Nui, Matt Emmerton
35 */
36
37/*
38 * Interface file for the various C<txn_name> classes.
39 */
40
41#ifndef DBINTERFACE_H_INCLUDED
42#define DBINTERFACE_H_INCLUDED
43
44#include <string>
45#include <cassert>
46#include <cstdio>
47#include "TxnHarnessStructs.h"
48#include "TxnHarnessSendToMarketInterface.h"
49#include "utilities/error.h"
50
51#include "duckdb/main/connection.hpp"
52
53using namespace std;
54
55namespace TPCE {
56
57class CTradeOrderDBInterface {
58 duckdb::Connection con;
59
60public:
61 void DoTradeOrderFrame1(const TTradeOrderFrame1Input *pIn, TTradeOrderFrame1Output *pOut);
62 void DoTradeOrderFrame2(const TTradeOrderFrame2Input *pIn, TTradeOrderFrame2Output *pOut);
63 void DoTradeOrderFrame3(const TTradeOrderFrame3Input *pIn, TTradeOrderFrame3Output *pOut);
64 void DoTradeOrderFrame4(const TTradeOrderFrame4Input *pIn, TTradeOrderFrame4Output *pOut);
65 void DoTradeOrderFrame5(void);
66 void DoTradeOrderFrame6(void);
67};
68
69class CTradeStatusDBInterface {
70public:
71 virtual void DoTradeStatusFrame1(const TTradeStatusFrame1Input *pIn, TTradeStatusFrame1Output *pOut) = 0;
72 virtual ~CTradeStatusDBInterface() {
73 }
74};
75
76class CCustomerPositionDBInterface {
77public:
78 virtual void DoCustomerPositionFrame1(const TCustomerPositionFrame1Input *pIn,
79 TCustomerPositionFrame1Output *pOut) = 0;
80 virtual void DoCustomerPositionFrame2(const TCustomerPositionFrame2Input *pIn,
81 TCustomerPositionFrame2Output *pOut) = 0;
82 virtual void DoCustomerPositionFrame3(void) = 0;
83 virtual ~CCustomerPositionDBInterface() {
84 }
85};
86
87class CBrokerVolumeDBInterface {
88public:
89 virtual void DoBrokerVolumeFrame1(const TBrokerVolumeFrame1Input *pIn, TBrokerVolumeFrame1Output *pOut) = 0;
90 virtual ~CBrokerVolumeDBInterface() {
91 }
92};
93
94class CSecurityDetailDBInterface {
95public:
96 virtual void DoSecurityDetailFrame1(const TSecurityDetailFrame1Input *pIn, TSecurityDetailFrame1Output *pOut) = 0;
97 virtual ~CSecurityDetailDBInterface() {
98 }
99};
100
101class CMarketWatchDBInterface {
102public:
103 virtual void DoMarketWatchFrame1(const TMarketWatchFrame1Input *pIn, TMarketWatchFrame1Output *pOut) = 0;
104 virtual ~CMarketWatchDBInterface() {
105 }
106};
107
108class CTradeLookupDBInterface {
109public:
110 virtual void DoTradeLookupFrame1(const TTradeLookupFrame1Input *pIn, TTradeLookupFrame1Output *pOut) = 0;
111 virtual void DoTradeLookupFrame2(const TTradeLookupFrame2Input *pIn, TTradeLookupFrame2Output *pOut) = 0;
112 virtual void DoTradeLookupFrame3(const TTradeLookupFrame3Input *pIn, TTradeLookupFrame3Output *pOut) = 0;
113 virtual void DoTradeLookupFrame4(const TTradeLookupFrame4Input *pIn, TTradeLookupFrame4Output *pOut) = 0;
114 virtual ~CTradeLookupDBInterface() {
115 }
116};
117
118class CTradeUpdateDBInterface {
119public:
120 virtual void DoTradeUpdateFrame1(const TTradeUpdateFrame1Input *pIn, TTradeUpdateFrame1Output *pOut) = 0;
121 virtual void DoTradeUpdateFrame2(const TTradeUpdateFrame2Input *pIn, TTradeUpdateFrame2Output *pOut) = 0;
122 virtual void DoTradeUpdateFrame3(const TTradeUpdateFrame3Input *pIn, TTradeUpdateFrame3Output *pOut) = 0;
123 virtual ~CTradeUpdateDBInterface() {
124 }
125};
126
127class CTradeResultDBInterface {
128public:
129 virtual void DoTradeResultFrame1(const TTradeResultFrame1Input *pIn, TTradeResultFrame1Output *pOut) = 0;
130 virtual void DoTradeResultFrame2(const TTradeResultFrame2Input *pIn, TTradeResultFrame2Output *pOut) = 0;
131 virtual void DoTradeResultFrame3(const TTradeResultFrame3Input *pIn, TTradeResultFrame3Output *pOut) = 0;
132 virtual void DoTradeResultFrame4(const TTradeResultFrame4Input *pIn, TTradeResultFrame4Output *pOut) = 0;
133 virtual void DoTradeResultFrame5(const TTradeResultFrame5Input *pIn) = 0;
134 virtual void DoTradeResultFrame6(const TTradeResultFrame6Input *pIn, TTradeResultFrame6Output *pOut) = 0;
135 virtual ~CTradeResultDBInterface() {
136 }
137};
138
139class CMarketFeedDBInterface {
140public:
141 virtual void DoMarketFeedFrame1(const TMarketFeedFrame1Input *pIn, TMarketFeedFrame1Output *pOut,
142 CSendToMarketInterface *pSendToMarket) = 0;
143 virtual ~CMarketFeedDBInterface() {
144 }
145};
146
147class CDataMaintenanceDBInterface {
148public:
149 virtual void DoDataMaintenanceFrame1(const TDataMaintenanceFrame1Input *pIn) = 0;
150 virtual ~CDataMaintenanceDBInterface() {
151 }
152};
153
154class CTradeCleanupDBInterface {
155public:
156 virtual void DoTradeCleanupFrame1(const TTradeCleanupFrame1Input *pIn) = 0;
157 virtual ~CTradeCleanupDBInterface() {
158 }
159};
160
161} // namespace TPCE
162#endif // DBINTERFACE_H_INCLUDED
163