00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _EYEDB_EXECUTABLE_CACHE_H
00026 #define _EYEDB_EXECUTABLE_CACHE_H
00027
00028 namespace eyedb {
00029
00030 class Database;
00031 class Signature;
00032 class Argument;
00033 class ArgArray;
00034
00035 class ExecutableCache;
00036
00037 class ExecutableItem {
00038
00039 friend class ExecutableCache;
00040 public:
00041
00042 ExecutableItem(Database *db, const char *intname,
00043 const char *name,
00044 int exec_type, int isStaticExec, const Oid &cloid,
00045 const char *extref,
00046 Signature *signature,
00047 const Oid& oid);
00048
00049 Status check();
00050 Status execute(Object *, ArgArray *argarray, Argument *retarg);
00051 ~ExecutableItem();
00052
00053 private:
00054 Database *db;
00055 int exec_type;
00056 char *intname;
00057 char *extref;
00058 Object *exec;
00059 void *dl;
00060 void *csym;
00061 };
00062
00063 class ExecutableCache {
00064
00065 public:
00066 ExecutableCache();
00067
00068 void insert(ExecutableItem *item);
00069 void remove(const char *intname);
00070 void remove(ExecutableItem *);
00071
00072 ExecutableItem *get(const char *intname);
00073
00074 ~ExecutableCache();
00075
00076 private:
00077 unsigned int nkeys;
00078 unsigned int mask;
00079 LinkedList **lists;
00080 unsigned int get_key(const char *);
00081 };
00082 }
00083
00084 #endif
00085
00086