~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/function.h

  • Committer: Brian Aker
  • Date: 2009-11-18 06:24:48 UTC
  • mfrom: (1220.1.15 staging)
  • Revision ID: brian@gaz-20091118062448-o36lo3yv81sc6u9z
Merge Brian + Stewart

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
21
21
#define DRIZZLED_PLUGIN_FUNCTION_H
22
22
 
23
23
 
24
 
#include <drizzled/item/func.h>
25
 
#include <drizzled/plugin.h>
26
 
#include <drizzled/plugin/plugin.h>
 
24
#include <drizzled/item.h>
 
25
#include <drizzled/sql_list.h>
 
26
#include <drizzled/item/bin_string.h>
 
27
#include "drizzled/plugin/plugin.h"
 
28
#include "drizzled/function/func.h"
27
29
 
28
30
#include <string>
29
31
#include <vector>
30
32
#include <functional>
31
33
 
32
 
#include <boost/unordered_map.hpp>
33
 
 
34
 
#include "drizzled/visibility.h"
35
34
 
36
35
namespace drizzled
37
36
{
38
 
 
39
 
class Item_func;
40
 
 
41
 
namespace memory
42
 
{
43
 
  class Root;
44
 
}
45
 
 
46
 
namespace util
47
 
{
48
 
struct insensitive_hash;
49
 
struct insensitive_equal_to;
50
 
}
51
 
 
52
37
namespace plugin
53
38
{
54
39
 
55
40
/**
56
41
 * Functions in the server: AKA UDF
57
42
 */
58
 
class DRIZZLED_API Function
 
43
class Function
59
44
  : public Plugin,
60
 
    public std::unary_function<memory::Root*, Item_func *>
 
45
    public std::unary_function<MEM_ROOT*, Item_func *>
61
46
{
62
47
  Function();
63
48
  Function(const Function &);
65
50
public:
66
51
  Function(std::string in_name)
67
52
   : Plugin(in_name, "Function"),
68
 
     std::unary_function<memory::Root*, Item_func *>()
 
53
     std::unary_function<MEM_ROOT*, Item_func *>()
69
54
  { }
70
55
  virtual result_type operator()(argument_type root) const= 0;
71
56
  virtual ~Function() {}
80
65
   */
81
66
  static void removePlugin(const plugin::Function *function_obj);
82
67
 
 
68
  /**
 
69
   * Accept a new connection (Protocol object) on one of the configured
 
70
   * listener interfaces.
 
71
   */
83
72
  static const plugin::Function *get(const char *name, size_t len=0);
84
73
 
85
 
  typedef boost::unordered_map<std::string, const plugin::Function *, util::insensitive_hash, util::insensitive_equal_to> UdfMap;
86
 
  typedef boost::unordered_map<std::string, const plugin::Function *, util::insensitive_hash, util::insensitive_equal_to> Map;
87
 
 
88
 
  static const UdfMap &getMap();
89
74
};
90
75
 
91
76
template<class T>