Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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 CHROME_BROWSER_RAPPOR_BLOOM_FILTER_H_ | |
| 6 #define CHROME_BROWSER_RAPPOR_BLOOM_FILTER_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <string> | |
| 11 #include <vector> | |
| 12 | |
| 13 #include "components/rappor/bytevector.h" | |
| 14 | |
| 15 namespace rappor { | |
| 16 | |
| 17 // BloomFilter is a simple bloom filter for keeping track of a set of strings. | |
| 18 class BloomFilter { | |
| 19 public: | |
| 20 BloomFilter(uint32_t bytes_size, uint32_t hash_count); | |
| 21 void Add(const std::string& str); | |
| 22 void Add(const std::vector<std::string>& strings); | |
|
jwd
2013/12/16 17:04:03
Overloaded functions are usually frowned upon in c
Steven Holte
2013/12/16 23:02:16
Done.
| |
| 23 const ByteVector& bytes() const; | |
|
jwd
2013/12/16 17:04:03
Can you give a comment for this function and for h
Steven Holte
2013/12/16 23:02:16
Done.
| |
| 24 uint32_t hash_count() const; | |
| 25 | |
| 26 private: | |
| 27 ByteVector bytes_; | |
| 28 uint32_t hash_count_; | |
|
jwd
2013/12/16 17:04:03
Maybe a short comment here too.
Steven Holte
2013/12/16 23:02:16
Done.
| |
| 29 }; | |
| 30 | |
| 31 } // namespace rappor | |
| 32 | |
| 33 #endif // CHROME_BROWSER_RAPPOR_BLOOM_FILTER_H_ | |
| OLD | NEW |