nedtypeinfo.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __NEDTYPEINFO_H
00019 #define __NEDTYPEINFO_H
00020
00021 #include <map>
00022 #include <vector>
00023 #include <string>
00024 #include "nedelements.h"
00025 #include "commonutil.h"
00026
00027 NAMESPACE_BEGIN
00028
00029 class NEDResourceCache;
00030
00042 class NEDXML_API NEDTypeInfo
00043 {
00044 public:
00045 enum Type {SIMPLE_MODULE, COMPOUND_MODULE, MODULEINTERFACE, CHANNEL, CHANNELINTERFACE};
00046
00047 protected:
00048
00049 NEDResourceCache *resolver;
00050
00051 Type type;
00052 std::string qualifiedName;
00053 bool isInner;
00054 NEDElement *tree;
00055
00056 typedef std::vector<std::string> StringVector;
00057 typedef std::map<std::string,int> StringToIntMap;
00058
00059
00060
00061 StringVector extendsnames;
00062 StringVector interfacenames;
00063
00064 std::string enclosingTypeName;
00065
00066
00067 std::string implClassName;
00068
00069 protected:
00070 void checkComplianceToInterface(NEDTypeInfo *interfaceDecl);
00071
00072 public:
00074 NEDTypeInfo(NEDResourceCache *resolver, const char *qname, bool isInnerType, NEDElement *tree);
00075
00077 virtual ~NEDTypeInfo();
00078
00080 virtual const char *getName() const;
00081
00083 virtual const char *getFullName() const;
00084
00086 virtual NEDElement *getTree() const;
00087
00089 NEDResourceCache *getResolver() const {return resolver;}
00090
00095 virtual Type getType() const {return type;}
00096
00101 virtual std::string getPackage() const;
00102
00106 virtual std::string info() const;
00107
00111 virtual std::string nedSource() const;
00112
00117 virtual int numExtendsNames() const {return extendsnames.size();}
00118
00123 virtual const char *extendsName(int k) const;
00124
00131 virtual int numInterfaceNames() const {return interfacenames.size();}
00132
00137 virtual const char *interfaceName(int k) const;
00138
00143 virtual bool supportsInterface(const char *qname);
00144
00148 virtual bool isInnerType() const {return isInner;}
00149
00154 virtual const char *getEnclosingTypeName() const;
00155
00160 virtual bool isNetwork() const;
00161
00167 virtual const char *getImplementationClassName() const;
00168
00176 virtual std::string getPackageProperty(const char *name) const;
00177
00179 virtual std::string getCxxNamespace() const;
00180
00182 virtual NEDTypeInfo *getSuperDecl() const;
00183
00186 ParametersElement *getParametersElement() const;
00187 GatesElement *getGatesElement() const;
00188 SubmodulesElement *getSubmodulesElement() const;
00189 ConnectionsElement *getConnectionsElement() const;
00190
00192 SubmoduleElement *getLocalSubmoduleElement(const char *submoduleName) const;
00193
00195 ConnectionElement *getLocalConnectionElement(long id) const;
00196
00198 SubmoduleElement *getSubmoduleElement(const char *submoduleName) const;
00199
00201 ConnectionElement *getConnectionElement(long id) const;
00202
00204 ParamElement *findLocalParamDecl(const char *name) const;
00205
00207 ParamElement *findParamDecl(const char *name) const;
00208
00210 GateElement *findLocalGateDecl(const char *name) const;
00211
00213 GateElement *findGateDecl(const char *name) const;
00215 };
00216
00217 NAMESPACE_END
00218
00219
00220 #endif
00221