~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/create.cc

  • Committer: Brian Aker
  • Date: 2010-09-11 01:35:47 UTC
  • mto: (1759.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 1762.
  • Revision ID: brian@tangent.org-20100911013547-b04k7f1qddr3ml4t
Shuffle native functions over to hash such that we have a specific container
for them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <drizzled/item/func.h>
26
26
#include <drizzled/error.h>
27
27
 
 
28
#include "drizzled/function_container.h"
 
29
 
28
30
#include <drizzled/function/str/binary.h>
29
31
#include <drizzled/function/str/concat.h>
30
32
#include <drizzled/function/str/conv.h>
98
100
#include <drizzled/function/math/tan.h>
99
101
#include <drizzled/function/units.h>
100
102
 
101
 
#include <map>
102
 
 
103
103
using namespace std;
104
104
 
105
105
namespace drizzled
2596
2596
  { {0, 0}, NULL}
2597
2597
};
2598
2598
 
2599
 
static map<string, Native_func_registry *> native_functions_map;
2600
 
 
2601
2599
/*
2602
2600
  Load the hash table for native functions.
2603
2601
  Note: this code is not thread safe, and is intended to be used at server
2614
2612
    func_name.assign(func->name.str, func->name.length);
2615
2613
    transform(func_name.begin(), func_name.end(), func_name.begin(), ::tolower);
2616
2614
 
2617
 
    native_functions_map[func_name]= func;
 
2615
    FunctionContainer::getMap()[func_name]= func;
2618
2616
  }
2619
2617
 
2620
2618
  return 0;
2630
2628
  string func_name(name.str, name.length);
2631
2629
  transform(func_name.begin(), func_name.end(), func_name.begin(), ::tolower);
2632
2630
 
2633
 
  map<string, Native_func_registry *>::iterator func_iter=
2634
 
    native_functions_map.find(func_name);
 
2631
  NativeFunctionsMap::iterator func_iter=
 
2632
    FunctionContainer::getMap().find(func_name);
2635
2633
 
2636
 
  if (func_iter != native_functions_map.end())
 
2634
  if (func_iter != FunctionContainer::getMap().end())
2637
2635
  {
2638
2636
    func= (*func_iter).second;
2639
2637
    builder= func->builder;