1*56bb7041Schristos /* GDB wrapper for splay trees.
2*56bb7041Schristos 
3*56bb7041Schristos    Copyright (C) 2017-2020 Free Software Foundation, Inc.
4*56bb7041Schristos 
5*56bb7041Schristos    This file is part of GDB.
6*56bb7041Schristos 
7*56bb7041Schristos    This program is free software; you can redistribute it and/or modify
8*56bb7041Schristos    it under the terms of the GNU General Public License as published by
9*56bb7041Schristos    the Free Software Foundation; either version 3 of the License, or
10*56bb7041Schristos    (at your option) any later version.
11*56bb7041Schristos 
12*56bb7041Schristos    This program is distributed in the hope that it will be useful,
13*56bb7041Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
14*56bb7041Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*56bb7041Schristos    GNU General Public License for more details.
16*56bb7041Schristos 
17*56bb7041Schristos    You should have received a copy of the GNU General Public License
18*56bb7041Schristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19*56bb7041Schristos 
20*56bb7041Schristos #ifndef COMMON_GDB_SPLAY_TREE_H
21*56bb7041Schristos #define COMMON_GDB_SPLAY_TREE_H
22*56bb7041Schristos 
23*56bb7041Schristos #include "splay-tree.h"
24*56bb7041Schristos 
25*56bb7041Schristos namespace gdb {
26*56bb7041Schristos 
27*56bb7041Schristos struct splay_tree_deleter
28*56bb7041Schristos {
operatorsplay_tree_deleter29*56bb7041Schristos   void operator() (splay_tree tree) const
30*56bb7041Schristos   {
31*56bb7041Schristos     splay_tree_delete (tree);
32*56bb7041Schristos   }
33*56bb7041Schristos };
34*56bb7041Schristos 
35*56bb7041Schristos } /* namespace gdb */
36*56bb7041Schristos 
37*56bb7041Schristos /* A unique pointer to a splay tree.  */
38*56bb7041Schristos 
39*56bb7041Schristos typedef std::unique_ptr<splay_tree_s, gdb::splay_tree_deleter>
40*56bb7041Schristos     gdb_splay_tree_up;
41*56bb7041Schristos 
42*56bb7041Schristos #endif /* COMMON_GDB_SPLAY_TREE_H */
43