| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_HUFFMAN_HUFFMAN_NODE_H_ |
| 6 #define NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_HUFFMAN_HUFFMAN_NODE_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <memory> |
| 11 |
| 12 namespace net { |
| 13 |
| 14 class HuffmanNode { |
| 15 public: |
| 16 HuffmanNode(uint8_t value, |
| 17 int count, |
| 18 std::unique_ptr<HuffmanNode> left, |
| 19 std::unique_ptr<HuffmanNode> right); |
| 20 ~HuffmanNode(); |
| 21 |
| 22 bool IsLeaf() const; |
| 23 |
| 24 uint8_t value() const { return value_; } |
| 25 int count() const { return count_; } |
| 26 const std::unique_ptr<HuffmanNode>& left() const { return left_; } |
| 27 const std::unique_ptr<HuffmanNode>& right() const { return right_; } |
| 28 |
| 29 private: |
| 30 uint8_t value_; |
| 31 int count_; |
| 32 std::unique_ptr<HuffmanNode> left_; |
| 33 std::unique_ptr<HuffmanNode> right_; |
| 34 }; |
| 35 |
| 36 } // namespace net |
| 37 |
| 38 #endif // NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_HUFFMAN_HUFFMAN_NODE_H_ |
| OLD | NEW |