~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/data_engine/status.h

  • Committer: Monty Taylor
  • Date: 2010-02-05 08:11:15 UTC
  • mfrom: (1283 build)
  • mto: (1273.13.43 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: mordred@inaugust.com-20100205081115-dr82nvrwv4lvw7sd
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef PLUGIN_DATA_ENGINE_STATUS_H
22
22
#define PLUGIN_DATA_ENGINE_STATUS_H
23
23
 
24
 
#include "config.h"
25
 
 
26
24
#include "drizzled/plugin/table_function.h"
27
25
#include "drizzled/field.h"
28
 
 
29
 
class StateTool : public drizzled::plugin::TableFunction
30
 
{
31
 
  sql_var_t option_type;
32
 
 
33
 
public:
34
 
 
35
 
  StateTool(const char *arg, bool global);
36
 
 
37
 
  virtual drizzle_show_var *getVariables()= 0;
38
 
 
39
 
  virtual bool hasStatus()
40
 
  {
41
 
    return true;
42
 
  }
43
 
 
44
 
  class Generator : public drizzled::plugin::TableFunction::Generator 
45
 
  {
46
 
    sql_var_t option_type;
47
 
    bool has_status;
48
 
    drizzle_show_var *variables;
49
 
    system_status_var status;
50
 
    system_status_var *status_ptr;
51
 
 
52
 
    void fill(const char *name, char *value, SHOW_TYPE show_type);
53
 
 
54
 
    system_status_var *getStatus()
55
 
    {
56
 
      return status_ptr;
57
 
    }
58
 
 
59
 
  public:
60
 
    Generator(Field **arg, sql_var_t option_arg,
61
 
              drizzle_show_var *show_arg,
62
 
              bool status_arg);
63
 
    ~Generator();
64
 
 
65
 
    bool populate();
66
 
 
67
 
  };
68
 
 
69
 
  Generator *generator(Field **arg)
70
 
  {
71
 
    return new Generator(arg, option_type, getVariables(), hasStatus());
72
 
  }
73
 
};
 
26
#include "plugin/data_engine/state_tool.h"
 
27
#include "plugin/data_engine/variables.h"
 
28
 
74
29
 
75
30
class StatusTool : public StateTool
76
31
{
79
34
    StateTool(global ? "GLOBAL_STATUS" : "SESSION_STATUS", global)
80
35
  { }
81
36
 
82
 
  drizzle_show_var *getVariables()
 
37
  drizzled::drizzle_show_var *getVariables()
83
38
  {
84
 
    return getFrontOfStatusVars();
 
39
    return drizzled::getFrontOfStatusVars();
85
40
  }
86
41
};
87
42
 
93
48
    StateTool(global ? "GLOBAL_STATEMENTS" : "SESSION_STATEMENTS", global)
94
49
    { }
95
50
 
96
 
  drizzle_show_var *getVariables()
 
51
  drizzled::drizzle_show_var *getVariables()
97
52
  {
98
 
    return getCommandStatusVars();
 
53
    return drizzled::getCommandStatusVars();
99
54
  }
100
55
};
101
56
 
102
 
#include "plugin/data_engine/variables.h"
103
 
 
104
57
#endif // PLUGIN_DATA_ENGINE_STATUS_H