00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <drizzled/cursor.h>
00024
00025 #include <plugin/function_engine/function.h>
00026 #include <drizzled/base.h>
00027
00028 class FunctionCursor: public drizzled::Cursor
00029 {
00030 drizzled::plugin::TableFunction *tool;
00031 drizzled::plugin::TableFunction::Generator *generator;
00032 size_t row_cache_position;
00033 std::vector<unsigned char> row_cache;
00034 drizzled::ha_rows estimate_of_rows;
00035 drizzled::ha_rows rows_returned;
00036
00037 void wipeCache();
00038
00039 std::vector <unsigned char> record_buffer;
00040 uint32_t max_row_length();
00041 unsigned int pack_row(const unsigned char *record);
00042
00043 public:
00044 FunctionCursor(drizzled::plugin::StorageEngine &engine,
00045 drizzled::Table &table_arg);
00046 ~FunctionCursor() {}
00047
00048 int open(const char *name, int mode, uint32_t test_if_locked);
00049
00050 int close(void);
00051
00052 int reset()
00053 {
00054 return extra(drizzled::HA_EXTRA_RESET_STATE);
00055 }
00056
00057 int doStartTableScan(bool scan);
00058
00059
00060 int rnd_next(unsigned char *buf);
00061
00062
00063 int rnd_pos(unsigned char *buf, unsigned char *pos);
00064
00065 int doEndTableScan();
00066
00067 int extra(enum drizzled::ha_extra_function);
00068
00069
00070 void position(const unsigned char *record);
00071
00072 int info(uint32_t flag);
00073
00077 drizzled::ha_rows estimate_rows_upper_bound()
00078 {
00079 return estimate_of_rows;
00080 }
00081
00082 void get_auto_increment(uint64_t, uint64_t,
00083 uint64_t,
00084 uint64_t *,
00085 uint64_t *)
00086 {}
00087 };
00088