diff options
author | yang.zhang <y0169.zhang@samsung.com> | 2016-05-18 11:25:47 +0800 |
---|---|---|
committer | yang.zhang <y0169.zhang@samsung.com> | 2016-05-18 11:27:16 +0800 |
commit | 41c06420b9ff028fd452cec19ac1412be665673f (patch) | |
tree | ece29e014e212b56654888fa3f95f50625164919 /cpp-btree/btree_set.h | |
parent | a96d62621beefe4aa20b696744be6325bc536fb6 (diff) | |
download | xdelta3-release-20160531.tar.gz xdelta3-release-20160531.tar.bz2 xdelta3-release-20160531.zip |
Imported upstream 3.0.8HEADsubmit/trunk/20191101.102136submit/trunk/20191030.112603submit/trunk/20191017.233826submit/trunk/20191017.111201submit/trunk/20190927.012842accepted/tools/devbase/tools/legacy/20240424.050617accepted/tools/devbase/tools/legacy/20240423.040635accepted/tools/devbase/tools/legacy/20240422.110744accepted/tizen/devbase/tools/20190927.044910spin-release-latestrelease-20161231release-20160930release-20160615release-20160531masterdevel_psk_20160727develaccepted/tools_devbase_tools_legacyaccepted/tizen_devbase_tools
Change-Id: I8423a2e4bed8a15b862b6b1ab6f6371c92e78b3f
Diffstat (limited to 'cpp-btree/btree_set.h')
-rw-r--r-- | cpp-btree/btree_set.h | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/cpp-btree/btree_set.h b/cpp-btree/btree_set.h deleted file mode 100644 index f9b2e75..0000000 --- a/cpp-btree/btree_set.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2013 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// A btree_set<> implements the STL unique sorted associative container -// interface (a.k.a set<>) using a btree. A btree_multiset<> implements the STL -// multiple sorted associative container interface (a.k.a multiset<>) using a -// btree. See btree.h for details of the btree implementation and caveats. - -#ifndef UTIL_BTREE_BTREE_SET_H__ -#define UTIL_BTREE_BTREE_SET_H__ - -#include <functional> -#include <memory> -#include <string> - -#include "btree.h" -#include "btree_container.h" - -namespace btree { - -// The btree_set class is needed mainly for its constructors. -template <typename Key, - typename Compare = std::less<Key>, - typename Alloc = std::allocator<Key>, - int TargetNodeSize = 256> -class btree_set : public btree_unique_container< - btree<btree_set_params<Key, Compare, Alloc, TargetNodeSize> > > { - - typedef btree_set<Key, Compare, Alloc, TargetNodeSize> self_type; - typedef btree_set_params<Key, Compare, Alloc, TargetNodeSize> params_type; - typedef btree<params_type> btree_type; - typedef btree_unique_container<btree_type> super_type; - - public: - typedef typename btree_type::key_compare key_compare; - typedef typename btree_type::allocator_type allocator_type; - - public: - // Default constructor. - btree_set(const key_compare &comp = key_compare(), - const allocator_type &alloc = allocator_type()) - : super_type(comp, alloc) { - } - - // Copy constructor. - btree_set(const self_type &x) - : super_type(x) { - } - - // Range constructor. - template <class InputIterator> - btree_set(InputIterator b, InputIterator e, - const key_compare &comp = key_compare(), - const allocator_type &alloc = allocator_type()) - : super_type(b, e, comp, alloc) { - } -}; - -template <typename K, typename C, typename A, int N> -inline void swap(btree_set<K, C, A, N> &x, btree_set<K, C, A, N> &y) { - x.swap(y); -} - -// The btree_multiset class is needed mainly for its constructors. -template <typename Key, - typename Compare = std::less<Key>, - typename Alloc = std::allocator<Key>, - int TargetNodeSize = 256> -class btree_multiset : public btree_multi_container< - btree<btree_set_params<Key, Compare, Alloc, TargetNodeSize> > > { - - typedef btree_multiset<Key, Compare, Alloc, TargetNodeSize> self_type; - typedef btree_set_params<Key, Compare, Alloc, TargetNodeSize> params_type; - typedef btree<params_type> btree_type; - typedef btree_multi_container<btree_type> super_type; - - public: - typedef typename btree_type::key_compare key_compare; - typedef typename btree_type::allocator_type allocator_type; - - public: - // Default constructor. - btree_multiset(const key_compare &comp = key_compare(), - const allocator_type &alloc = allocator_type()) - : super_type(comp, alloc) { - } - - // Copy constructor. - btree_multiset(const self_type &x) - : super_type(x) { - } - - // Range constructor. - template <class InputIterator> - btree_multiset(InputIterator b, InputIterator e, - const key_compare &comp = key_compare(), - const allocator_type &alloc = allocator_type()) - : super_type(b, e, comp, alloc) { - } -}; - -template <typename K, typename C, typename A, int N> -inline void swap(btree_multiset<K, C, A, N> &x, - btree_multiset<K, C, A, N> &y) { - x.swap(y); -} - -} // namespace btree - -#endif // UTIL_BTREE_BTREE_SET_H__ |