~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/create.h

  • Committer: Brian Aker
  • Date: 2009-04-09 15:03:26 UTC
  • mfrom: (971.1.44 mordred)
  • Revision ID: brian@gaz-20090409150326-cu50yn12esijpy1c
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/item/bin_string.h>
27
27
 
28
28
#include <string>
 
29
#include <vector>
29
30
#include <functional>
30
31
 
31
32
class Function_builder
32
33
  : public std::unary_function<MEM_ROOT*, Item_func *>
33
34
{
34
35
  std::string name;
 
36
  std::vector<std::string> aliases;
35
37
public:
36
38
  Function_builder(std::string in_name) : name(in_name) {}
 
39
  Function_builder(const char *in_name) : name(in_name) {}
37
40
  virtual result_type operator()(argument_type session) const= 0;
38
41
  virtual ~Function_builder() {}
39
42
 
40
 
  std::string get_name() const
41
 
  {
42
 
      return name;
 
43
  std::string getName() const
 
44
  {
 
45
    return name;
 
46
  }
 
47
 
 
48
  const std::vector<std::string>& getAliases() const
 
49
  {
 
50
    return aliases;
 
51
  }
 
52
 
 
53
  void addAlias(std::string alias)
 
54
  {
 
55
    aliases.push_back(alias);
43
56
  }
44
57
};
45
58
 
49
62
public:
50
63
  typedef T Function_class;
51
64
  Create_function(std::string in_name): Function_builder(in_name) {}
 
65
  Create_function(const char *in_name): Function_builder(in_name) {}
52
66
  virtual result_type operator()(argument_type root) const
53
67
  {
54
68
    return new (root) Function_class();