Drizzled Public API Documentation

quick_range.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 #pragma once
00021 
00022 #include <drizzled/memory/sql_alloc.h>
00023 #include <drizzled/base.h>
00024 
00025 namespace drizzled
00026 {
00027 
00028 namespace optimizer
00029 {
00030 
00031 class QuickRange : public memory::SqlAlloc
00032 {
00033 public:
00034   unsigned char *min_key;
00035   unsigned char *max_key;
00036   uint16_t min_length;
00037   uint16_t max_length;
00038   uint16_t flag;
00039   key_part_map min_keypart_map; 
00040   key_part_map max_keypart_map; 
00042   QuickRange(); 
00043   QuickRange(const unsigned char *min_key_arg,
00044               uint32_t min_length_arg,
00045               key_part_map min_keypart_map_arg,
00046               const unsigned char *max_key_arg,
00047               uint32_t max_length_arg,
00048               key_part_map max_keypart_map_arg,
00049               uint32_t flag_arg)
00050     :
00051       min_key((unsigned char*) memory::sql_memdup(min_key_arg,min_length_arg+1)),
00052       max_key((unsigned char*) memory::sql_memdup(max_key_arg,max_length_arg+1)),
00053       min_length((uint16_t) min_length_arg),
00054       max_length((uint16_t) max_length_arg),
00055       flag((uint16_t) flag_arg),
00056       min_keypart_map(min_keypart_map_arg),
00057       max_keypart_map(max_keypart_map_arg)
00058     {}
00059 };
00060 
00061 } /* namespace optimizer */
00062 
00063 } /* namespace drizzled */
00064