0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RowInterval.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_RowInterval_h
23 #define Hypertable_Lib_RowInterval_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 RowInterval : public Serializable {
39  public:
41  RowInterval(const char *start_row, bool start_row_inclusive,
42  const char *end_row, bool end_row_inclusive)
43  : start(start_row), start_inclusive(start_row_inclusive),
44  end(end_row), end_inclusive(end_row_inclusive) { }
45  RowInterval(const uint8_t **bufp, size_t *remainp) {
46  decode(bufp, remainp);
47  }
48 
49  virtual ~RowInterval() {}
50 
53  const string render_hql() const;
54 
55  const char *start {};
56  bool start_inclusive {true};
57  const char *end {};
58  bool end_inclusive {true};
59 
60  private:
61 
64  uint8_t encoding_version() const override;
65 
69  size_t encoded_length_internal() const override;
70 
73  void encode_internal(uint8_t **bufp) const override;
74 
81  void decode_internal(uint8_t version, const uint8_t **bufp,
82  size_t *remainp) override;
83 
84  };
85 
86  ostream &operator<<(ostream &os, const RowInterval &ri);
87 
88 }}
89 
90 #endif // Hypertable_Lib_RowInterval_h
STL namespace.
RowInterval(const uint8_t **bufp, size_t *remainp)
Definition: RowInterval.h:45
Represents a row interval.
Definition: RowInterval.h:38
ostream & operator<<(ostream &os, const CellInterval &ci)
Declarations for Serializable.
Hypertable definitions
Mixin class that provides a standard serialization interface.
Definition: Serializable.h:65
RowInterval(const char *start_row, bool start_row_inclusive, const char *end_row, bool end_row_inclusive)
Definition: RowInterval.h:41