File indexing completed on 2024-11-24 04:54:36

0001 /*
0002     SPDX-License-Identifier: MPL-2.0
0003 */
0004 
0005 /* Copyright (c) 2015 Brian R. Bondy. Distributed under the MPL2 license.
0006  * This Source Code Form is subject to the terms of the Mozilla Public
0007  * License, v. 2.0. If a copy of the MPL was not distributed with this
0008  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
0009 
0010 #ifndef HASH_ITEM_H_
0011 #define HASH_ITEM_H_
0012 
0013 #include "./base.h"
0014 
0015 template<class T>
0016 class HashItem {
0017  public:
0018   HashItem() : next_(nullptr), hash_item_storage_(nullptr) {
0019   }
0020 
0021   ~HashItem() {
0022     if (hash_item_storage_) {
0023       delete hash_item_storage_;
0024     }
0025   }
0026 
0027   HashItem *next_;
0028   T *hash_item_storage_;
0029 };
0030 
0031 #endif  // HASH_ITEM_H_