Drizzled Public API Documentation

key_map.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 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/definitions.h>
00023 
00024 #include <bitset>
00025 
00026 #include <drizzled/visibility.h>
00027 
00028 namespace drizzled
00029 {
00030 
00031 /* Used for finding keys */
00032 #if MAX_INDEXES <= 64
00033 typedef std::bitset<72> key_map;
00034 #else
00035 typedef std::bitset<((MAX_INDEXES+7)/8*8)> key_map;
00036 #endif
00037 
00038 /* useful constants */
00039 extern const key_map key_map_empty;
00040 extern DRIZZLED_API key_map key_map_full;          /* Should be threaded as const */
00041 
00042 bool is_keymap_prefix(const key_map& map, const uint32_t n);
00043 bool is_overlapping(const key_map& map, const key_map& map2);
00044 void set_prefix(key_map& map, const uint32_t n);
00045 void key_map_subtract(key_map& map1, key_map& map2);
00046 
00047 } /* namespace drizzled */
00048