Qucs-core
0.0.19
|
00001 /* 00002 * module.h - module class definitions 00003 * 00004 * Copyright (C) 2008 Stefan Jahn <stefan@lkcc.org> 00005 * 00006 * This is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2, or (at your option) 00009 * any later version. 00010 * 00011 * This software is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this package; see the file COPYING. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 * $Id$ 00022 * 00023 */ 00024 00025 #ifndef __MODULE_H__ 00026 #define __MODULE_H__ 00027 00028 #include <list> 00029 00030 #include "hash.h" 00031 00032 namespace qucs { 00033 00034 class circuit; 00035 class analysis; 00036 00037 // function typedefs for circuits and analyses 00038 typedef circuit * (* circuit_creator_t) (void); 00039 typedef analysis * (* analysis_creator_t) (void); 00040 typedef struct define_t * (* circuit_definer_t) (void); 00041 typedef struct define_t * (* analysis_definer_t) (void); 00042 typedef struct define_t * (* misc_definer_t) (void); 00043 00044 class module 00045 { 00046 public: 00047 module (); 00048 ~module (); 00049 00050 static void registerModule (circuit_definer_t, circuit_creator_t); 00051 static void registerModules (void); 00052 static void unregisterModules (void); 00053 static struct define_t * getModule (char *); 00054 static void print (void); 00055 00056 static void registerDynamicModules (char *proj, std::list<std::string> modlist); 00057 static void closeDynamicLibs (void); 00058 00059 private: 00060 static void registerModule (analysis_definer_t , analysis_creator_t); 00061 static void registerModule (struct define_t *); 00062 static void registerModule (misc_definer_t); 00063 static void registerModule (const char *, module *); 00064 00065 public: 00066 static qucs::hash<module> modules; 00067 00068 public: 00069 struct define_t * definition; 00070 circuit_creator_t circreate; 00071 analysis_creator_t anacreate; 00072 00073 }; 00074 00075 } // namespace qucs 00076 00077 #endif /* __MODULE_H__ */