~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/slot/function.h

  • Committer: Monty Taylor
  • Date: 2009-08-17 20:54:05 UTC
  • mto: (1115.3.12 captain)
  • mto: This revision was merged to the branch mainline in revision 1121.
  • Revision ID: mordred@inaugust.com-20090817205405-xogz4uoii3c2co4c
Moved UDFs to slot organization.

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
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 */
 
26
#include <drizzled/plugin/function.h>
 
27
 
 
28
namespace drizzled
 
29
{
 
30
namespace slot
 
31
{
 
32
 
 
33
/**
 
34
 * Class to handle all Function plugin objects.
 
35
 */
 
36
class Function
 
37
{
 
38
  Registry<const plugin::Function *> udf_registry;
 
39
 
 
40
public:
 
41
  Function() : udf_registry() {}
 
42
  ~Function() {}
 
43
 
 
44
  /**
 
45
   * Add a new Function factory to the list of factories we manage.
 
46
   */
 
47
  void add(const plugin::Function *function_obj);
 
48
 
 
49
  /**
 
50
   * Remove a Function factory from the list of factory we manage.
 
51
   */
 
52
  void remove(const plugin::Function *function_obj);
 
53
 
 
54
  /**
 
55
   * Accept a new connection (Protocol object) on one of the configured
 
56
   * listener interfaces.
 
57
   */
 
58
  const plugin::Function *get(const char *name, size_t len=0) const;
 
59
 
 
60
};
 
61
 
 
62
} /* end namespace slot */
 
63
} /* end namespace drizzled */
 
64
 
 
65
#endif /* DRIZZLED_SLOT_FUNCTION_H */