~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/slot/function.h

  • Committer: Brian Aker
  • Date: 2009-08-21 06:18:23 UTC
  • mfrom: (1115.3.12 captain)
  • Revision ID: brian@gaz-20090821061823-ljcpbpvun22lsvem
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_SQL_UDF_H
21
 
#define DRIZZLED_SQL_UDF_H
 
20
#ifndef DRIZZLED_SLOT_FUNCTION_H
 
21
#define DRIZZLED_SLOT_FUNCTION_H
22
22
 
23
23
/* This file defines structures needed by udf functions */
24
24
 
25
 
#include <drizzled/function/func.h>
26
 
#include <drizzled/function/create.h>
27
 
 
28
 
#include <stdint.h>
29
 
 
30
 
enum Item_udftype {UDFTYPE_FUNCTION=1,UDFTYPE_AGGREGATE};
31
 
 
32
 
Function_builder *find_udf(const char *name, uint32_t len=0);
33
 
void free_udf(Function_builder *udf);
34
 
int mysql_create_function(Session *session,Function_builder *udf);
35
 
void add_udf(Function_builder *udf);
36
 
void remove_udf(Function_builder *udf);
37
 
 
38
 
#endif /* DRIZZLED_SQL_UDF_H */
 
25
#include "drizzled/function/func.h"
 
26
#include "drizzled/plugin/function.h"
 
27
#include "drizzled/registry.h"
 
28
 
 
29
namespace drizzled
 
30
{
 
31
namespace slot
 
32
{
 
33
 
 
34
/**
 
35
 * Class to handle all Function plugin objects.
 
36
 */
 
37
class Function
 
38
{
 
39
  Registry<const plugin::Function *> udf_registry;
 
40
 
 
41
public:
 
42
  Function() : udf_registry() {}
 
43
  ~Function() {}
 
44
 
 
45
  /**
 
46
   * Add a new Function factory to the list of factories we manage.
 
47
   */
 
48
  void add(const plugin::Function *function_obj);
 
49
 
 
50
  /**
 
51
   * Remove a Function factory from the list of factory we manage.
 
52
   */
 
53
  void remove(const plugin::Function *function_obj);
 
54
 
 
55
  /**
 
56
   * Accept a new connection (Protocol object) on one of the configured
 
57
   * listener interfaces.
 
58
   */
 
59
  const plugin::Function *get(const char *name, size_t len=0) const;
 
60
 
 
61
};
 
62
 
 
63
} /* end namespace slot */
 
64
} /* end namespace drizzled */
 
65
 
 
66
#endif /* DRIZZLED_SLOT_FUNCTION_H */