Drizzled Public API Documentation

quick_range.h
1 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3  *
4  * Copyright (C) 2008-2009 Sun Microsystems, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #pragma once
21 
22 #include <drizzled/memory/sql_alloc.h>
23 #include <drizzled/base.h>
24 
25 namespace drizzled
26 {
27 
28 namespace optimizer
29 {
30 
32 {
33 public:
34  unsigned char *min_key;
35  unsigned char *max_key;
36  uint16_t min_length;
37  uint16_t max_length;
38  uint16_t flag;
39  key_part_map min_keypart_map;
40  key_part_map max_keypart_map;
42  QuickRange();
43  QuickRange(const unsigned char *min_key_arg,
44  uint32_t min_length_arg,
45  key_part_map min_keypart_map_arg,
46  const unsigned char *max_key_arg,
47  uint32_t max_length_arg,
48  key_part_map max_keypart_map_arg,
49  uint32_t flag_arg)
50  :
51  min_key((unsigned char*) memory::sql_memdup(min_key_arg,min_length_arg+1)),
52  max_key((unsigned char*) memory::sql_memdup(max_key_arg,max_length_arg+1)),
53  min_length((uint16_t) min_length_arg),
54  max_length((uint16_t) max_length_arg),
55  flag((uint16_t) flag_arg),
56  min_keypart_map(min_keypart_map_arg),
57  max_keypart_map(max_keypart_map_arg)
58  {}
59 };
60 
61 } /* namespace optimizer */
62 
63 } /* namespace drizzled */
64