forked from ra3xdh/qucs_s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.h
75 lines (62 loc) · 2.16 KB
/
module.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/***************************************************************************
module.h
----------
begin : Thu Nov 5 2009
copyright : (C) 2009 by Stefan Jahn
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef MODULE_H
#define MODULE_H
#include <QList>
#include <QHash>
#include <QMap>
// function typedefs for circuits and analyses
typedef Element * (* pInfoFunc) (QString&, char * &, bool);
typedef Element * (* pInfoVAFunc) (QString&, QString&, bool, QString);
typedef Component * (* pCreatorFunc) ();
class Module
{
public:
Module ();
~Module ();
static void registerModule (QString, pInfoFunc);
static void registerComponent (QString, pInfoFunc);
static void intoCategory (Module *);
static Component * getComponent (QString);
static void registerDynamicComponents(void);
public:
static QHash<QString, Module *> Modules;
static QMap<QString, QString> vaComponents;
public:
static void registerModules (void);
static void unregisterModules (void);
public:
pInfoFunc info = 0;
pInfoVAFunc infoVA = 0;
QString category;
};
class Category
{
public:
Category ();
Category (const QString);
~Category ();
public:
static QList<Category *> Categories;
public:
static QStringList getCategories (void);
static QList<Module *> getModules (QString);
static int getModulesNr (QString);
public:
QString Name;
QList<Module *> Content;
};
#endif /* __MODULE_H__ */