drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
gman_do.h
1/* Copyright (C) 2009 Sun Microsystems, Inc.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15
16#pragma once
17
18#include <drizzled/item/func.h>
19#include <drizzled/function/str/strfunc.h>
20
21#include <libgearman/gearman.h>
22
23class Item_func_gman_do :public drizzled::Item_str_func
24{
25protected:
26 typedef enum
27 {
28 GMAN_DO_OPTIONS_NONE= 0,
29 GMAN_DO_OPTIONS_HIGH= (1 << 0),
30 GMAN_DO_OPTIONS_LOW= (1 << 1),
31 GMAN_DO_OPTIONS_BACKGROUND= (1 << 2),
32 GMAN_DO_OPTIONS_CLIENT= (1 << 3)
33 } gman_do_options_t;
34
35private:
36 gman_do_options_t options;
37 gearman_client_st client;
38 drizzled::String buffer;
39
40public:
41 Item_func_gman_do():
42 Item_str_func(),
43 options(GMAN_DO_OPTIONS_NONE) {}
44 Item_func_gman_do(gman_do_options_t options_arg):
45 Item_str_func(),
46 options(options_arg) {}
47 ~Item_func_gman_do();
48 void fix_length_and_dec() { max_length=10; }
49 virtual const char *func_name() const{ return "gman_do"; }
51 void *realloc(size_t size);
52};
53
54class Item_func_gman_do_high :public Item_func_gman_do
55{
56public:
57 Item_func_gman_do_high():
58 Item_func_gman_do(GMAN_DO_OPTIONS_HIGH) {}
59 const char *func_name() const{ return "gman_do_high"; }
60};
61
62class Item_func_gman_do_low :public Item_func_gman_do
63{
64public:
65 Item_func_gman_do_low():
66 Item_func_gman_do(GMAN_DO_OPTIONS_LOW) {}
67 const char *func_name() const{ return "gman_do_low"; }
68};
69
70class Item_func_gman_do_background :public Item_func_gman_do
71{
72public:
73 Item_func_gman_do_background():
74 Item_func_gman_do(GMAN_DO_OPTIONS_BACKGROUND) {}
75 const char *func_name() const{ return "gman_do_background"; }
76};
77
78class Item_func_gman_do_high_background :public Item_func_gman_do
79{
80public:
81 Item_func_gman_do_high_background():
82 Item_func_gman_do((gman_do_options_t)(GMAN_DO_OPTIONS_HIGH |
83 GMAN_DO_OPTIONS_BACKGROUND)) {}
84 const char *func_name() const{ return "gman_do_high_background"; }
85};
86
87class Item_func_gman_do_low_background :public Item_func_gman_do
88{
89public:
90 Item_func_gman_do_low_background():
91 Item_func_gman_do((gman_do_options_t)(GMAN_DO_OPTIONS_LOW |
92 GMAN_DO_OPTIONS_BACKGROUND)) {}
93 const char *func_name() const{ return "gman_do_low_background"; }
94};
95
drizzled::String * val_str(drizzled::String *)
Definition gman_do.cc:38