小组成员: 曹可心-10223903406 朴祉燕-10224602413
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

43 行
990 B

  1. // Copyright (c) 2011 The LevelDB 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. See the AUTHORS file for names of contributors.
  4. #ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_
  5. #define STORAGE_LEVELDB_TABLE_BLOCK_H_
  6. #include <stddef.h>
  7. #include <stdint.h>
  8. #include "include/iterator.h"
  9. namespace leveldb {
  10. class Comparator;
  11. class Block {
  12. public:
  13. // Initialize the block with the specified contents.
  14. // Takes ownership of data[] and will delete[] it when done.
  15. Block(const char* data, size_t size);
  16. ~Block();
  17. size_t size() const { return size_; }
  18. Iterator* NewIterator(const Comparator* comparator);
  19. private:
  20. uint32_t NumRestarts() const;
  21. const char* data_;
  22. size_t size_;
  23. uint32_t restart_offset_; // Offset in data_ of restart array
  24. // No copying allowed
  25. Block(const Block&);
  26. void operator=(const Block&);
  27. class Iter;
  28. };
  29. }
  30. #endif // STORAGE_LEVELDB_TABLE_BLOCK_H_