0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CellInterval.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 
22 #ifndef Hypertable_Lib_CellInterval_h
23 #define Hypertable_Lib_CellInterval_h
24 
25 #include <Common/Serializable.h>
26 
27 #include <ostream>
28 
29 namespace Hypertable {
30 namespace Lib {
31 
32  using namespace std;
33 
38  class CellInterval : public Serializable {
39  public:
41  CellInterval(const char *start_row, const char *start_column,
42  bool start_inclusive, const char *end_row,
43  const char *end_column, bool end_inclusive)
44  : start_row(start_row), start_column(start_column),
45  start_inclusive(start_inclusive), end_row(end_row),
46  end_column(end_column), end_inclusive(end_inclusive) { }
47  CellInterval(const uint8_t **bufp, size_t *remainp) {
48  decode(bufp, remainp);
49  }
50 
51  virtual ~CellInterval() {}
52 
55  const string render_hql() const;
56 
57  const char *start_row {};
58  const char *start_column {};
59  bool start_inclusive {true};
60  const char *end_row {};
61  const char *end_column {};
62  bool end_inclusive {true};
63 
64  private:
65 
68  uint8_t encoding_version() const override;
69 
73  size_t encoded_length_internal() const override;
74 
77  void encode_internal(uint8_t **bufp) const override;
78 
85  void decode_internal(uint8_t version, const uint8_t **bufp,
86  size_t *remainp) override;
87 
88  };
89 
90  ostream &operator<<(ostream &os, const CellInterval &ci);
91 
92 }}
93 
94 #endif // Hypertable_Lib_CellInterval_h
STL namespace.
ostream & operator<<(ostream &os, const CellInterval &ci)
CellInterval(const char *start_row, const char *start_column, bool start_inclusive, const char *end_row, const char *end_column, bool end_inclusive)
Definition: CellInterval.h:41
Declarations for Serializable.
Hypertable definitions
Mixin class that provides a standard serialization interface.
Definition: Serializable.h:65
Represents a cell interval.
Definition: CellInterval.h:38
CellInterval(const uint8_t **bufp, size_t *remainp)
Definition: CellInterval.h:47