~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/unique.h

  • Committer: Ivo Roper
  • Date: 2011-11-19 00:03:07 UTC
  • mfrom: (2455.1.5 drizzle-tree-refactor)
  • mto: This revision was merged to the branch mainline in revision 2479.
  • Revision ID: ivolucien@gmail.com-20111119000307-kxxoqfok9t0qv4v7
refactored TREE struct into Tree class, updating calling code appropriately

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
class Unique : public memory::SqlAlloc
41
41
{
42
42
  size_t max_in_memory_size;
43
 
  TREE tree;
 
43
  Tree tree;
44
44
  unsigned char *record_pointers;
45
45
  uint32_t size;
46
46
 
49
49
  Unique(qsort_cmp2 comp_func, void *comp_func_fixed_arg,
50
50
         uint32_t size_arg, size_t max_in_memory_size_arg);
51
51
  ~Unique();
52
 
  ulong elements_in_tree() { return tree.elements_in_tree; }
 
52
  ulong elements_in_tree() { return tree.getElementsInTree(); }
53
53
  inline bool unique_add(void *ptr)
54
54
  {
55
 
    return (not tree_insert(&tree, ptr, 0, tree.custom_arg));
 
55
    return (not tree.tree_insert(ptr, 0, tree.getCustomArg()));
56
56
  }
57
57
 
58
58
  bool get(Table *table);
62
62
                                            size_t sortbuff_size)
63
63
  {
64
64
    register size_t max_elems_in_tree=
65
 
      (1 + sortbuff_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size));
 
65
      (1 + sortbuff_size / ALIGN_SIZE(sizeof(Tree_Element)+key_size));
66
66
    return (int) (sizeof(uint32_t)*(1 + nkeys/max_elems_in_tree));
67
67
  }
68
68