@@ -34,7 +34,7 @@ BPLUSTREE_TYPE::BPlusTree(std::string name, page_id_t header_page_id, BufferPool
34
34
* @return Returns true if this B+ tree has no keys and values.
35
35
*/
36
36
INDEX_TEMPLATE_ARGUMENTS
37
- auto BPLUSTREE_TYPE::IsEmpty () const -> bool { return true ; }
37
+ auto BPLUSTREE_TYPE::IsEmpty () const -> bool { UNIMPLEMENTED ( " TODO(P2): Add implementation. " ) ; }
38
38
39
39
/* ****************************************************************************
40
40
* SEARCH
@@ -50,10 +50,9 @@ auto BPLUSTREE_TYPE::IsEmpty() const -> bool { return true; }
50
50
*/
51
51
INDEX_TEMPLATE_ARGUMENTS
52
52
auto BPLUSTREE_TYPE::GetValue (const KeyType &key, std::vector<ValueType> *result) -> bool {
53
- // Declaration of context instance.
53
+ UNIMPLEMENTED (" TODO(P2): Add implementation." );
54
+ // Declaration of context instance. Using the Context is not necessary but advised.
54
55
Context ctx;
55
- (void )ctx;
56
- return false ;
57
56
}
58
57
59
58
/* ****************************************************************************
@@ -72,10 +71,9 @@ auto BPLUSTREE_TYPE::GetValue(const KeyType &key, std::vector<ValueType> *result
72
71
*/
73
72
INDEX_TEMPLATE_ARGUMENTS
74
73
auto BPLUSTREE_TYPE::Insert (const KeyType &key, const ValueType &value) -> bool {
75
- // Declaration of context instance.
74
+ UNIMPLEMENTED (" TODO(P2): Add implementation." );
75
+ // Declaration of context instance. Using the Context is not necessary but advised.
76
76
Context ctx;
77
- (void )ctx;
78
- return false ;
79
77
}
80
78
81
79
/* ****************************************************************************
@@ -94,7 +92,7 @@ INDEX_TEMPLATE_ARGUMENTS
94
92
void BPLUSTREE_TYPE::Remove (const KeyType &key) {
95
93
// Declaration of context instance.
96
94
Context ctx;
97
- ( void )ctx ;
95
+ UNIMPLEMENTED ( " TODO(P2): Add implementation. " ) ;
98
96
}
99
97
100
98
/* ****************************************************************************
@@ -103,32 +101,37 @@ void BPLUSTREE_TYPE::Remove(const KeyType &key) {
103
101
/* *
104
102
* @brief Input parameter is void, find the leftmost leaf page first, then construct
105
103
* index iterator
104
+ *
105
+ * You may want to implement this while implementing Task #3.
106
+ *
106
107
* @return : index iterator
107
108
*/
108
109
INDEX_TEMPLATE_ARGUMENTS
109
- auto BPLUSTREE_TYPE::Begin () -> INDEXITERATOR_TYPE { return INDEXITERATOR_TYPE ( ); }
110
+ auto BPLUSTREE_TYPE::Begin () -> INDEXITERATOR_TYPE { UNIMPLEMENTED ( " TODO(P2): Add implementation. " ); }
110
111
111
112
/* *
112
113
* @brief Input parameter is low key, find the leaf page that contains the input key
113
114
* first, then construct index iterator
114
115
* @return : index iterator
115
116
*/
116
117
INDEX_TEMPLATE_ARGUMENTS
117
- auto BPLUSTREE_TYPE::Begin (const KeyType &key) -> INDEXITERATOR_TYPE { return INDEXITERATOR_TYPE ( ); }
118
+ auto BPLUSTREE_TYPE::Begin (const KeyType &key) -> INDEXITERATOR_TYPE { UNIMPLEMENTED ( " TODO(P2): Add implementation. " ); }
118
119
119
120
/* *
120
121
* @brief Input parameter is void, construct an index iterator representing the end
121
122
* of the key/value pair in the leaf node
122
123
* @return : index iterator
123
124
*/
124
125
INDEX_TEMPLATE_ARGUMENTS
125
- auto BPLUSTREE_TYPE::End () -> INDEXITERATOR_TYPE { return INDEXITERATOR_TYPE ( ); }
126
+ auto BPLUSTREE_TYPE::End () -> INDEXITERATOR_TYPE { UNIMPLEMENTED ( " TODO(P2): Add implementation. " ); }
126
127
127
128
/* *
128
129
* @return Page id of the root of this tree
130
+ *
131
+ * You may want to implement this while implementing Task #3.
129
132
*/
130
133
INDEX_TEMPLATE_ARGUMENTS
131
- auto BPLUSTREE_TYPE::GetRootPageId () -> page_id_t { return 0 ; }
134
+ auto BPLUSTREE_TYPE::GetRootPageId () -> page_id_t { UNIMPLEMENTED ( " TODO(P2): Add implementation. " ) ; }
132
135
133
136
template class BPlusTree <GenericKey<4 >, RID, GenericComparator<4 >>;
134
137
0 commit comments