OMNeT++ NEDXML
6.0.3
|
#include <nedtypeinfo.h>
Stores information on a NED type.
This class wraps an ASTNode tree of a NED declaration (module, channel, module interface or channel interface). May be extended by subclassing.
Represents NED declarations of modules, module interfaces, channels and channel interfaces. All instances are created and managed by NedResourceCache.
Public Types | |
enum | Type { SIMPLE_MODULE, COMPOUND_MODULE, MODULEINTERFACE, CHANNEL, CHANNELINTERFACE } |
Public Member Functions | |
NedTypeInfo (NedResourceCache *resolver, const char *qname, bool isInnerType, ASTNode *tree) | |
virtual | ~NedTypeInfo () |
virtual const char * | getName () const |
virtual const char * | getFullName () const |
virtual ASTNode * | getTree () const |
NedResourceCache * | getResolver () const |
virtual Type | getType () const |
virtual const char * | getSourceFileName () const |
virtual std::string | getPackage () const |
virtual std::string | str () const |
virtual std::string | getNedSource () const |
virtual int | numExtendsNames () const |
virtual const char * | getExtendsName (int k) const |
virtual int | numInterfaceNames () const |
virtual const char * | getInterfaceName (int k) const |
virtual bool | supportsInterface (const char *qname) |
virtual bool | isInnerType () const |
virtual const char * | getEnclosingTypeName () const |
virtual bool | isNetwork () const |
virtual const char * | getImplementationClassName () const |
virtual std::string | getPackageProperty (const char *name) const |
virtual std::string | getCxxNamespace () const |
virtual NedTypeInfo * | getSuperDecl () const |
Convenience method to query the tree | |
TypesElement * | getTypesElement () const |
ParametersElement * | getParametersElement () const |
GatesElement * | getGatesElement () const |
SubmodulesElement * | getSubmodulesElement () const |
ConnectionsElement * | getConnectionsElement () const |
SubmoduleElement * | getLocalSubmoduleElement (const char *submoduleName) const |
ConnectionElement * | getLocalConnectionElement (long id) const |
SubmoduleElement * | getSubmoduleElement (const char *submoduleName) const |
ConnectionElement * | getConnectionElement (long id) const |
ParamElement * | findLocalParamDecl (const char *name) const |
ParamElement * | findParamDecl (const char *name) const |
GateElement * | findLocalGateDecl (const char *name) const |
GateElement * | findGateDecl (const char *name) const |
Protected Types | |
typedef std::vector< std::string > | StringVector |
typedef std::map< std::string, ASTNode * > | NameToElementMap |
Protected Member Functions | |
void | checkComplianceToInterface (NedTypeInfo *interfaceDecl) |
void | collectLocalDeclarations () |
void | addToElementMap (NameToElementMap &elementMap, ASTNode *node) |
void | mergeElementMap (NameToElementMap &destMap, const NameToElementMap &elementMap) |
Protected Attributes | |
NedResourceCache * | resolver |
Type | type |
std::string | qualifiedName |
bool | isInner |
ASTNode * | tree |
StringVector | extendsNames |
StringVector | interfaceNames |
std::string | enclosingTypeName |
std::string | implClassName |
NameToElementMap | localInnerTypeDecls |
NameToElementMap | localParamDecls |
NameToElementMap | localGateDecls |
NameToElementMap | localSubmoduleDecls |
NameToElementMap | localConnectionDecls |
NameToElementMap | allLocalDecls |
|
protected |
|
protected |
enum Type |
NedTypeInfo | ( | NedResourceCache * | resolver, |
const char * | qname, | ||
bool | isInnerType, | ||
ASTNode * | tree | ||
) |
Constructor. It expects fully qualified name
|
virtual |
Destructor
|
protected |
|
protected |
|
protected |
|
protected |
|
virtual |
Returns the simple name of the NED type
|
virtual |
Returns the fully qualified name of the NED type
|
inline |
The NED type resolver this type is registered in
|
inlinevirtual |
Returns the type of this declaration: simple module, compound module, channel, etc.
|
virtual |
Returns the path of the source file this NED type was loaded from.
|
virtual |
Returns the package name (from the package declaration of the containing NED file.)
|
virtual |
Returns a one-line summary (base class, implemented interfaces, etc)
|
virtual |
Returns the NED declaration.
|
inlinevirtual |
Returns the number of "extends" names. This includes indirect base types as well (i.e. base types of base types, etc).
|
virtual |
Returns the name of the kth "extends" name (k=0..numExtendsNames()-1), resolved to fully qualified name.
|
inlinevirtual |
Returns the number of interfaces. This includes indirectly implemented interfaces as well. (That is, the list contains interfaces implemented by this type and all its base types, plus base types of all those interfaces).
|
virtual |
Returns the name of the kth interface (k=0..numInterfaceNames()-1), resolved to fully qualified name.
|
virtual |
Returns true if this NED type extends/"is like" the given module interface or channel interface
|
inlinevirtual |
Returns true if this NED type is an inner type
|
virtual |
If this type is an inner type, returns fully qualified name of its enclosing type, otherwise returns nullptr.
|
virtual |
Returns true if this NED type has a local (non-inherited) @network (or @network(true)) property.
|
virtual |
For modules and channels, it returns the name of the C++ class that has to be instantiated (for compound modules this defaults to "cModule"); for interface types it returns nullptr.
|
virtual |
Find a property with the given name in the type's NED file, then in the package.ned file of the NED file, then in parent package.ned files up to the root (the NED source folder this NED file is in). Returns the simple value of the property (1st value of default key), or empty string if not found.
|
virtual |
The C++ namespace for this NED type; implemented as getPackageProperty("namespace").
|
virtual |
Returns the first "extends" clause, or nullptr
TypesElement* getTypesElement | ( | ) | const |
ParametersElement* getParametersElement | ( | ) | const |
GatesElement* getGatesElement | ( | ) | const |
SubmodulesElement* getSubmodulesElement | ( | ) | const |
ConnectionsElement* getConnectionsElement | ( | ) | const |
SubmoduleElement* getLocalSubmoduleElement | ( | const char * | submoduleName | ) | const |
Returns the submodule element with the given name from the local type, or nullptr if not found
ConnectionElement* getLocalConnectionElement | ( | long | id | ) | const |
Returns the connection element with the given id from the local type, or nullptr if not found
SubmoduleElement* getSubmoduleElement | ( | const char * | submoduleName | ) | const |
Returns the submodule element with the given name from the local type and "extends" types, or nullptr if not found
ConnectionElement* getConnectionElement | ( | long | id | ) | const |
Returns the connection element with the given id from the local type and "extends" types, or nullptr if not found
ParamElement* findLocalParamDecl | ( | const char * | name | ) | const |
Searches local type; nullptr if not found
ParamElement* findParamDecl | ( | const char * | name | ) | const |
Searches local type and "extends" types; nullptr if not found
GateElement* findLocalGateDecl | ( | const char * | name | ) | const |
Searches local type; nullptr if not found
GateElement* findGateDecl | ( | const char * | name | ) | const |
Searches local type and "extends" types; nullptr if not found
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |