0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BlockHeaderCellStore.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
28 #ifndef HYPERTABLE_BLOCKHEADERCELLSTORE_H
29 #define HYPERTABLE_BLOCKHEADERCELLSTORE_H
30 
32 
33 #include <utility>
34 
35 namespace Hypertable {
36 
37  using namespace std::rel_ops;
38 
48 
49  public:
50 
51  static const uint16_t LatestVersion = 1;
52 
59  BlockHeaderCellStore(uint16_t version=LatestVersion, const char *magic=0);
60 
65  virtual size_t encoded_length();
66 
78  virtual void encode(uint8_t **bufp);
79 
87  virtual void decode(const uint8_t **bufp, size_t *remainp);
88 
95  bool equals(const BlockHeaderCellStore &other) const;
96 
97  private:
99  uint16_t m_version;
100  };
101 
108  inline bool operator==(const BlockHeaderCellStore &lhs,
109  const BlockHeaderCellStore &rhs) {
110  return lhs.equals(rhs);
111  }
112 
115 }
116 
117 #endif // HYPERTABLE_BLOCKHEADERCELLSTORE_H
uint16_t m_version
Serialization format version number
Declarations for BlockHeader.
bool equals(const BlockHeaderCellStore &other) const
Equality test.
bool operator==(const directory_entry< _Key, _Tp > &lhs, const directory_entry< _Key, _Tp > &rhs)
Definition: directory.h:112
Hypertable definitions
Base class for block headers.
Definition: BlockHeader.h:48