Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
block.h
Go to the documentation of this file.
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 
5 #ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_
6 #define STORAGE_LEVELDB_TABLE_BLOCK_H_
7 
8 #include <stddef.h>
9 #include <stdint.h>
10 #include "leveldb/iterator.h"
11 
12 namespace leveldb {
13 
14 struct BlockContents;
15 class Comparator;
16 
17 class Block {
18  public:
19  // Initialize the block with the specified contents.
20  explicit Block(const BlockContents& contents);
21 
22  ~Block();
23 
24  size_t size() const { return size_; }
25  Iterator* NewIterator(const Comparator* comparator);
26 
27  private:
28  uint32_t NumRestarts() const;
29 
30  const char* data_;
31  size_t size_;
32  uint32_t restart_offset_; // Offset in data_ of restart array
33  bool owned_; // Block owns data_[]
34 
35  // No copying allowed
36  Block(const Block&);
37  void operator=(const Block&);
38 
39  class Iter;
40 };
41 
42 } // namespace leveldb
43 
44 #endif // STORAGE_LEVELDB_TABLE_BLOCK_H_
Block(const BlockContents &contents)
Definition: block.cc:23
size_t size_
Definition: block.h:31
Iterator * NewIterator(const Comparator *comparator)
Definition: block.cc:256
const char * data_
Definition: block.h:30
unsigned int uint32_t
Definition: stdint.h:21
bool owned_
Definition: block.h:33
size_t size() const
Definition: block.h:24
void operator=(const Block &)
uint32_t restart_offset_
Definition: block.h:32
uint32_t NumRestarts() const
Definition: block.cc:18