Zero  0.1.0
tpcb_schema_man.h
Go to the documentation of this file.
1 /* -*- mode:C++; c-basic-offset:4 -*-
2  Shore-kits -- Benchmark implementations for Shore-MT
3 
4  Copyright (c) 2007-2009
5  Data Intensive Applications and Systems Labaratory (DIAS)
6  Ecole Polytechnique Federale de Lausanne
7 
8  All Rights Reserved.
9 
10  Permission to use, copy, modify and distribute this software and
11  its documentation is hereby granted, provided that both the
12  copyright notice and this permission notice appear in all copies of
13  the software, derivative works or modified versions, and any
14  portions thereof, and that both notices appear in supporting
15  documentation.
16 
17  This code is distributed in the hope that it will be useful, but
18  WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS
20  DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
21  RESULTING FROM THE USE OF THIS SOFTWARE.
22 */
23 
32 #ifndef __TPCB_SCHEMA_MAN_H
33 #define __TPCB_SCHEMA_MAN_H
34 
35 #include "tpcb_schema.h"
36 
37 /* ------------------------------------------------------------------ */
38 /* --- The managers of all the tables used in the TPC-B benchmark --- */
39 /* ------------------------------------------------------------------ */
40 
41 namespace tpcb {
42 
43  class branch_man_impl : public table_man_t<branch_t> {
45 
46  public:
47 
48  branch_man_impl(branch_t* aBranchDesc)
49  : table_man_t(aBranchDesc) {}
50 
52 
53  // --- access specific tuples ---
55  branch_tuple* ptuple,
56  const int b_id);
57 
59  branch_tuple* ptuple,
60  const int b_id);
61 
62  w_rc_t b_idx_nl(ss_m* db,
63  branch_tuple* ptuple,
64  const int b_id);
65  }; // EOF: branch_man_impl
66 
67 
68 
69  class teller_man_impl : public table_man_t<teller_t> {
71 
72  public:
73 
74  teller_man_impl(teller_t* aTellerDesc)
75  : table_man_t(aTellerDesc) {}
76 
78 
79  // --- access specific tuples ---
80  w_rc_t t_index_probe_forupdate(ss_m* db,
81  teller_tuple* ptuple,
82  const int t_id);
83 
84  w_rc_t t_idx_nl(ss_m* db,
85  teller_tuple* ptuple,
86  const int t_id);
87  }; // EOF: teller_man_impl
88 
89 
90 
91  class account_man_impl : public table_man_t<account_t> {
93 
94  public:
95 
96  account_man_impl(account_t* aAccountDesc)
97  : table_man_t(aAccountDesc) {}
98 
100 
101  // --- access specific tuples ---
102  w_rc_t a_index_probe_forupdate(ss_m* db,
103  account_tuple* ptuple,
104  const int a_id,
105  const int b_id = 0, // PLP_MBENCH
106  const double balance = 0);
107 
108  w_rc_t a_delete_by_index(ss_m* db,
109  account_tuple* ptuple,
110  const int a_id,
111  const int b_id = 0, // PLP_MBENCH
112  const double balance = 0);
113 
114  w_rc_t a_index_probe(ss_m* db,
115  account_tuple* ptuple,
116  const int a_id,
117  const int b_id = 0, // PLP_MBENCH
118  const double balance = 0);
119 
120  w_rc_t a_idx_nl(ss_m* db,
121  account_tuple* ptuple,
122  const int a_id,
123  const int b_id = 0, // PLP_MBENCH
124  const double balance = 0);
125  }; // EOF: account_man_impl
126 
127 
128 
129 
130  class history_man_impl : public table_man_t<history_t> {
132 
133  public:
134 
135  history_man_impl(history_t* aHistoryDesc)
136  : table_man_t(aHistoryDesc) {}
137 
139  }; // EOF: history_man_impl
140 
141 };
142 
143 #endif // __TPCB_SCHEMA_MAN_H
table_row_t teller_tuple
Definition: tpcb_schema_man.h:70
Definition: tpcb_schema_man.h:69
teller_man_impl(teller_t *aTellerDesc)
Definition: tpcb_schema_man.h:74
table_row_t history_tuple
Definition: tpcb_schema_man.h:131
table_row_t branch_tuple
Definition: tpcb_schema_man.h:44
~teller_man_impl()
Definition: tpcb_schema_man.h:77
This is the SHORE Storage Manager API.
Definition: sm.h:405
branch_man_impl(branch_t *aBranchDesc)
Definition: tpcb_schema_man.h:48
: Declaration of the TPC-B tables
account_man_impl(account_t *aAccountDesc)
Definition: tpcb_schema_man.h:96
Definition: tpcb_schema_man.h:130
~branch_man_impl()
Definition: tpcb_schema_man.h:51
Return code for most functions and methods.
Definition: w_rc.h:87
~account_man_impl()
Definition: tpcb_schema_man.h:99
Definition: tpcb_schema_man.h:91
w_rc_t b_index_probe(ss_m *db, branch_tuple *ptuple, const int b_id)
Definition: tpcb_schema_man.cpp:48
table_row_t account_tuple
Definition: tpcb_schema_man.h:92
~history_man_impl()
Definition: tpcb_schema_man.h:138
volatile unsigned long balance
Definition: tpcb_input.cpp:133
w_rc_t b_idx_nl(ss_m *db, branch_tuple *ptuple, const int b_id)
Definition: tpcb_schema_man.cpp:64
Definition: tpcb_schema_man.h:43
Definition: tpcb_client.cpp:33
w_rc_t b_index_probe_forupdate(ss_m *db, branch_tuple *ptuple, const int b_id)
Definition: tpcb_schema_man.cpp:56
Definition: row.h:147
Definition: table_man.h:117
history_man_impl(history_t *aHistoryDesc)
Definition: tpcb_schema_man.h:135