Drizzled Public API Documentation

execute.h

00001 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2010 Brian Aker
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; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 
00022 #pragma once
00023 
00024 #include <drizzled/item/function/boolean.h>
00025 #include <drizzled/execute.h>
00026 #include <iostream>
00027 
00028 namespace drizzled
00029 {
00030 
00031 namespace utility_functions
00032 {
00033 
00034 class Execute :public drizzled::item::function::Boolean
00035 {
00036   drizzled::String _res;
00037   drizzled::Execute execute;
00038 
00039 public:
00040   Execute() :
00041     drizzled::item::function::Boolean(),
00042     execute(getSession(), false)
00043   {
00044     unsigned_flag= true;
00045   }
00046 
00047   bool val_bool();
00048 
00049   int64_t val_int()
00050   {
00051     return val_bool();
00052   }
00053   const char *func_name() const { return "execute"; }
00054   const char *fully_qualified_func_name() const { return "execute()"; }
00055 
00056   void fix_length_and_dec()
00057   {
00058     max_length= 1;
00059   }
00060 
00061   bool check_argument_count(int n)
00062   {
00063     if (n == 2)
00064     {
00065       execute.setWait();
00066     }
00067 
00068     return (n == 1 or n == 2);
00069   }
00070 };
00071 
00072 } /* namespace utility_functions */
00073 } /* namespace drizzled */
00074