ExecutableCache.h

00001 /* 
00002    EyeDB Object Database Management System
00003    Copyright (C) 1994-2008 SYSRA
00004    
00005    EyeDB is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009    
00010    EyeDB is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014    
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with this library; if not, write to the Free Software
00017    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA 
00018 */
00019 
00020 /*
00021    Author: Eric Viara <viara@sysra.com>
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   

Generated on Mon Dec 22 18:15:54 2008 for eyedb by  doxygen 1.5.3