~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_identifier.h

  • Committer: Brian Aker
  • Date: 2010-06-11 18:03:14 UTC
  • mfrom: (1608.2.4 rollup)
  • Revision ID: brian@gaz-20100611180314-1bafy27fvm3t7z1j
Merge in some recent changes to tableshare.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
#include <algorithm>
48
48
#include <functional>
49
49
 
 
50
#include <boost/functional/hash.hpp>
 
51
 
50
52
namespace drizzled {
51
53
 
52
54
class Table;
62
64
  std::string table_name;
63
65
  std::string lower_table_name;
64
66
  std::string sql_path;
 
67
  size_t hash_value;
65
68
 
66
69
  void init();
67
70
 
116
119
 
117
120
  const std::string &getSQLPath();
118
121
 
119
 
  const std::string &getPath();
 
122
  const std::string &getPath() const;
120
123
 
121
124
  void setPath(const std::string &new_path)
122
125
  {
132
135
 
133
136
  friend bool operator<(const TableIdentifier &left, const TableIdentifier &right)
134
137
  {
 
138
    // Compare the schema names. You must use schema, path is not valid for
 
139
    // this operation.
135
140
    int first= left.getLower().compare(right.getLower());
136
 
 
137
141
    if (first < 0)
138
142
    {
139
143
      return true;
144
148
    }
145
149
    else
146
150
    {
 
151
      // Compare the tables names.
147
152
      int val= left.lower_table_name.compare(right.lower_table_name);
148
153
 
149
154
      if (val < 0)
194
199
    output << type_str;
195
200
    output << ", ";
196
201
    output << identifier.path;
 
202
    output << ", ";
 
203
    output << identifier.getHashValue();
197
204
    output << ")";
198
205
 
199
206
    return output;  // for multiple << operators.
218
225
  static uint32_t filename_to_tablename(const char *from, char *to, uint32_t to_length);
219
226
  static size_t build_table_filename(std::string &buff, const char *db, const char *table_name, bool is_tmp);
220
227
 
221
 
 
 
228
  size_t getHashValue() const
 
229
  {
 
230
    return hash_value;
 
231
  }
222
232
};
223
233
 
 
234
std::size_t hash_value(TableIdentifier const& b);
 
235
 
224
236
typedef std::vector <TableIdentifier> TableIdentifierList;
225
237
typedef std::list <TableIdentifier> TableIdentifiers;
226
238