cheshirekow  v0.1.0
node.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of mpblocks.
5  *
6  * mpblocks is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * mpblocks is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mpblocks. If not, see <http://www.gnu.org/licenses/>.
18  */
25 #ifndef MPBLOCKS_RED_BLACK_NODE_H_
26 #define MPBLOCKS_RED_BLACK_NODE_H_
27 
29 #include <cstdint>
30 
31 namespace mpblocks {
32 namespace redblack {
33 
35 template <typename Traits>
36 struct BasicNode {
37  typedef typename Traits::Key Key;
38  typedef typename Traits::NodeRef NodeRef;
39 
45 
47  : color(Color::BLACK), key(key), parent(Nil), left(Nil), right(Nil) {}
48 
50  : color(Color::BLACK), parent(Nil), left(Nil), right(Nil) {}
51 };
52 
53 } //< namespace redblack
54 } //< namespace mpblocks
55 
56 #endif // MPBLOCKS_RED_BLACK_NODE_H_
A node in a redblack tree.
Definition: node.h:36
Traits::NodeRef NodeRef
Definition: node.h:38
BasicNode(NodeRef Nil)
Definition: node.h:49
BasicNode(Key key, NodeRef Nil)
Definition: node.h:46