~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/info_schema_table.h

Remove PLUGIN and MODULES.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLED_PLUGIN_INFO_SCHEMA_TABLE_H
22
22
#define DRIZZLED_PLUGIN_INFO_SCHEMA_TABLE_H
23
23
 
24
 
#include "drizzled/hash/crc32.h"
 
24
#include "drizzled/plugin/plugin.h"
 
25
#include "drizzled/algorithm/crc32.h"
 
26
#include "drizzled/common.h"
25
27
 
 
28
#include <cstring>
26
29
#include <string>
27
30
#include <set>
28
31
#include <algorithm>
29
32
 
 
33
class Session;
 
34
class TableList;
 
35
class Table;
 
36
 
 
37
typedef struct drizzle_lex_string LEX_STRING;
 
38
 
 
39
extern const std::string INFORMATION_SCHEMA_NAME;
 
40
 
30
41
namespace drizzled
31
42
{
32
43
namespace plugin
40
51
 */
41
52
 
42
53
typedef class Item COND;
 
54
class InfoSchemaTable;
43
55
 
44
56
 
45
57
/**
197
209
class InfoSchemaRecord
198
210
{
199
211
public:
200
 
  InfoSchemaRecord()
201
 
    :
202
 
      record(NULL),
203
 
      rec_len(0),
204
 
      checksum(0)
205
 
  {}
206
 
 
207
 
  InfoSchemaRecord(unsigned char *buf,
208
 
                   size_t in_len)
209
 
    :
210
 
      record(NULL),
211
 
      rec_len(in_len),
212
 
      checksum(0)
213
 
  {
214
 
    record= new unsigned char[rec_len];
215
 
    memcpy(record, buf, rec_len);
216
 
    checksum= drizzled::hash::crc32((const char *) record, rec_len);
217
 
  }
218
 
 
219
 
  InfoSchemaRecord(const InfoSchemaRecord &rhs)
220
 
    :
221
 
      record(NULL),
222
 
      rec_len(rhs.rec_len)
223
 
  {
224
 
    record= new(std::nothrow) unsigned char[rec_len];
225
 
    memcpy(record, rhs.record, rec_len);
226
 
    checksum= drizzled::hash::crc32((const char *) record, rec_len);
227
 
  }
 
212
  InfoSchemaRecord();
 
213
  InfoSchemaRecord(unsigned char *buf, size_t in_len);
 
214
  InfoSchemaRecord(const InfoSchemaRecord &rhs);
228
215
 
229
216
  ~InfoSchemaRecord()
230
217
  {
336
323
      requested_object(req_object),
337
324
      column_info(in_column_info),
338
325
      rows(),
339
 
      i_s_methods(in_methods)
 
326
      i_s_methods(in_methods),
 
327
      plugin_name("")
 
328
  {}
 
329
 
 
330
  InfoSchemaTable(const std::string& tab_name,
 
331
                  Columns& in_column_info,
 
332
                  int idx_col1,
 
333
                  int idx_col2,
 
334
                  bool in_hidden,
 
335
                  bool in_opt_possible,
 
336
                  uint32_t req_object,
 
337
                  InfoSchemaMethods *in_methods,
 
338
                  const std::string in_plugin_name)
 
339
    :
 
340
      Plugin(tab_name, "InfoSchemaTable"),
 
341
      hidden(in_hidden),
 
342
      is_opt_possible(in_opt_possible),
 
343
      first_column_index(idx_col1),
 
344
      second_column_index(idx_col2),
 
345
      requested_object(req_object),
 
346
      column_info(in_column_info),
 
347
      rows(),
 
348
      i_s_methods(in_methods),
 
349
      plugin_name(in_plugin_name)
340
350
  {}
341
351
 
342
352
  explicit InfoSchemaTable(const std::string& tab_name)
349
359
      requested_object(0),
350
360
      column_info(),
351
361
      rows(),
352
 
      i_s_methods(NULL)
 
362
      i_s_methods(NULL),
 
363
      plugin_name("")
353
364
  {}
354
365
 
355
366
  virtual ~InfoSchemaTable()
499
510
  }
500
511
 
501
512
  /**
 
513
   * @return the plugin name.
 
514
   */
 
515
  const std::string &getPluginName() const
 
516
  {
 
517
    return plugin_name;
 
518
  }
 
519
 
 
520
  /**
502
521
   * @return the columns for this I_S table
503
522
   */
504
523
  const Columns &getColumns() const
536
555
   */
537
556
  void addRow(unsigned char *buf, size_t len)
538
557
  {
539
 
    uint32_t cs= drizzled::hash::crc32((const char *) buf, len);
 
558
    uint32_t cs= drizzled::algorithm::crc32((const char *) buf, len);
540
559
    Rows::iterator it= std::find_if(rows.begin(),
541
560
                                    rows.end(),
542
561
                                    FindRowByChecksum(cs));
602
621
   */
603
622
  InfoSchemaMethods *i_s_methods;
604
623
 
 
624
  /**
 
625
   * The name of the plugin associated with this I_S table
 
626
   * NULL for non I_S tables. 
 
627
   */ 
 
628
  const std::string plugin_name; 
 
629
 
605
630
public:
606
631
  static bool addPlugin(plugin::InfoSchemaTable *schema_table);
607
632
  static void removePlugin(plugin::InfoSchemaTable *table);