Drizzled Public API Documentation

functions.cc
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  *  Copyright (C) 2010 Stewart Smith
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 #include <config.h>
00023 #include <drizzled/plugin/function.h>
00024 #include <plugin/math_functions/functions.h>
00025 #include <plugin/math_functions/abs.h>
00026 #include <plugin/math_functions/acos.h>
00027 #include <plugin/math_functions/asin.h>
00028 #include <plugin/math_functions/atan.h>
00029 #include <plugin/math_functions/cos.h>
00030 #include <plugin/math_functions/log.h>
00031 #include <plugin/math_functions/sin.h>
00032 #include <plugin/math_functions/pow.h>
00033 #include <plugin/math_functions/ln.h>
00034 #include <plugin/math_functions/sqrt.h>
00035 #include <plugin/math_functions/ceiling.h>
00036 #include <plugin/math_functions/exp.h>
00037 #include <plugin/math_functions/floor.h>
00038 #include <plugin/math_functions/ord.h>
00039 
00040 using namespace drizzled;
00041 
00042 static int init(drizzled::module::Context &context)
00043 {
00044   context.add(new plugin::Create_function<Item_func_abs>("abs"));
00045   context.add(new plugin::Create_function<Item_func_acos>("acos"));
00046   context.add(new plugin::Create_function<Item_func_asin>("asin"));
00047   context.add(new plugin::Create_function<Item_func_atan>("atan"));
00048   context.add(new plugin::Create_function<Item_func_atan>("atan2"));
00049   context.add(new plugin::Create_function<Item_func_cos>("cos"));
00050   context.add(new plugin::Create_function<Item_func_log>("log"));
00051   context.add(new plugin::Create_function<Item_func_log2>("log2"));
00052   context.add(new plugin::Create_function<Item_func_log10>("log10"));
00053   context.add(new plugin::Create_function<Item_func_sin>("sin"));
00054   context.add(new plugin::Create_function<Item_func_pow>("pow"));
00055   context.add(new plugin::Create_function<Item_func_pow>("power"));
00056   context.add(new plugin::Create_function<Item_func_ln>("ln"));
00057   context.add(new plugin::Create_function<Item_func_sqrt>("sqrt"));
00058   context.add(new plugin::Create_function<Item_func_ceiling>("ceil"));
00059   context.add(new plugin::Create_function<Item_func_ceiling>("ceiling"));
00060   context.add(new plugin::Create_function<Item_func_exp>("exp"));
00061   context.add(new plugin::Create_function<Item_func_floor>("floor"));
00062   context.add(new plugin::Create_function<Item_func_ord>("ord"));
00063 
00064   return 0;
00065 }
00066 
00067 DRIZZLE_DECLARE_PLUGIN
00068 {
00069   DRIZZLE_VERSION_ID,
00070   "Math Functions",
00071   "1.0",
00072   "Brian Aker, Stewart Smith",
00073   "Math Functions.",
00074   PLUGIN_LICENSE_GPL,
00075   init,
00076   NULL,
00077   NULL
00078 }
00079 DRIZZLE_DECLARE_PLUGIN_END;