#include <nedtypeinfo.h>
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, NEDElement *tree) | |
| virtual | ~NEDTypeInfo () |
| virtual const char * | getName () const |
| virtual const char * | getFullName () const |
| virtual NEDElement * | getTree () const |
| NEDResourceCache * | getResolver () const |
| virtual Type | getType () const |
| virtual std::string | getPackage () const |
| virtual std::string | info () const |
| virtual std::string | nedSource () const |
| virtual int | numExtendsNames () const |
| virtual const char * | extendsName (int k) const |
| virtual int | numInterfaceNames () const |
| virtual const char * | interfaceName (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 * | implementationClassName () const |
| virtual std::string | getPackageProperty (const char *name) const |
| virtual std::string | getCxxNamespace () const |
| virtual NEDTypeInfo * | getSuperDecl () const |
Convenience method to query the tree | |
| 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, int > | StringToIntMap |
Protected Member Functions | |
| void | checkComplianceToInterface (NEDTypeInfo *interfaceDecl) |
Protected Attributes | |
| NEDResourceCache * | resolver |
| Type | type |
| std::string | qualifiedName |
| bool | isInner |
| NEDElement * | tree |
| StringVector | extendsnames |
| StringVector | interfacenames |
| std::string | enclosingTypeName |
| std::string | implClassName |
typedef std::vector<std::string> NEDTypeInfo::StringVector [protected] |
typedef std::map<std::string,int> NEDTypeInfo::StringToIntMap [protected] |
| enum NEDTypeInfo::Type |
| NEDTypeInfo::NEDTypeInfo | ( | NEDResourceCache * | resolver, | |
| const char * | qname, | |||
| bool | isInnerType, | |||
| NEDElement * | tree | |||
| ) |
Constructor.
It expects fully qualified name
| virtual NEDTypeInfo::~NEDTypeInfo | ( | ) | [virtual] |
Destructor.
| void NEDTypeInfo::checkComplianceToInterface | ( | NEDTypeInfo * | interfaceDecl | ) | [protected] |
| virtual const char* NEDTypeInfo::getName | ( | ) | const [virtual] |
Returns the simple name of the NED type.
| virtual const char* NEDTypeInfo::getFullName | ( | ) | const [virtual] |
Returns the fully qualified name of the NED type.
| virtual NEDElement* NEDTypeInfo::getTree | ( | ) | const [virtual] |
Returns the raw NEDElement tree representing the component.
| NEDResourceCache* NEDTypeInfo::getResolver | ( | ) | const [inline] |
The NED type resolver this type is registered in.
| virtual Type NEDTypeInfo::getType | ( | ) | const [inline, virtual] |
Returns the type of this declaration: simple module, compound module, channel, etc.
| virtual std::string NEDTypeInfo::getPackage | ( | ) | const [virtual] |
Returns the package name (from the package declaration of the containing NED file.
| virtual std::string NEDTypeInfo::info | ( | ) | const [virtual] |
Returns a one-line summary (base class, implemented interfaces, etc).
| virtual std::string NEDTypeInfo::nedSource | ( | ) | const [virtual] |
Returns the NED declaration.
| virtual int NEDTypeInfo::numExtendsNames | ( | ) | const [inline, virtual] |
Returns the number of "extends" names.
This includes indirect base types as well (i.e. base types of base types, etc).
| virtual const char* NEDTypeInfo::extendsName | ( | int | k | ) | const [virtual] |
Returns the name of the kth "extends" name (k=0.
.numExtendsNames()-1), resolved to fully qualified name.
| virtual int NEDTypeInfo::numInterfaceNames | ( | ) | const [inline, virtual] |
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 const char* NEDTypeInfo::interfaceName | ( | int | k | ) | const [virtual] |
Returns the name of the kth interface (k=0.
.numInterfaceNames()-1), resolved to fully qualified name.
| virtual bool NEDTypeInfo::supportsInterface | ( | const char * | qname | ) | [virtual] |
Returns true if this NED type extends/"is like" the given module interface or channel interface.
| virtual bool NEDTypeInfo::isInnerType | ( | ) | const [inline, virtual] |
Returns true if this NED type is an inner type.
| virtual const char* NEDTypeInfo::getEnclosingTypeName | ( | ) | const [virtual] |
If this type is an inner type, returns fully qualified name of its enclosing type, otherwise returns NULL.
| virtual bool NEDTypeInfo::isNetwork | ( | ) | const [virtual] |
Returns true if this NED type has a local (non-inherited) @network (or @network(true)) property.
| virtual const char* NEDTypeInfo::implementationClassName | ( | ) | const [virtual] |
For modules and channels, it returns the name of the C++ class that has to be instantiated (for compound modules this defaults to "cCompoundModule"); for interface types it returns NULL.
| virtual std::string NEDTypeInfo::getPackageProperty | ( | const char * | name | ) | const [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 std::string NEDTypeInfo::getCxxNamespace | ( | ) | const [virtual] |
The C++ namespace for this NED type; implemented as getPackageProperty("namespace").
| virtual NEDTypeInfo* NEDTypeInfo::getSuperDecl | ( | ) | const [virtual] |
Returns the first "extends" clause, or NULL.
| ParametersElement* NEDTypeInfo::getParametersElement | ( | ) | const |
| GatesElement* NEDTypeInfo::getGatesElement | ( | ) | const |
| SubmodulesElement* NEDTypeInfo::getSubmodulesElement | ( | ) | const |
| ConnectionsElement* NEDTypeInfo::getConnectionsElement | ( | ) | const |
| SubmoduleElement* NEDTypeInfo::getLocalSubmoduleElement | ( | const char * | submoduleName | ) | const |
Returns the submodule element with the given name from the local type, or NULL if not found.
| ConnectionElement* NEDTypeInfo::getLocalConnectionElement | ( | long | id | ) | const |
Returns the connection element with the given id from the local type, or NULL if not found.
| SubmoduleElement* NEDTypeInfo::getSubmoduleElement | ( | const char * | submoduleName | ) | const |
Returns the submodule element with the given name from the local type and "extends" types, or NULL if not found.
| ConnectionElement* NEDTypeInfo::getConnectionElement | ( | long | id | ) | const |
Returns the connection element with the given id from the local type and "extends" types, or NULL if not found.
| ParamElement* NEDTypeInfo::findLocalParamDecl | ( | const char * | name | ) | const |
Searches local type; NULL if not found.
| ParamElement* NEDTypeInfo::findParamDecl | ( | const char * | name | ) | const |
Searches local type and "extends" types; NULL if not found.
| GateElement* NEDTypeInfo::findLocalGateDecl | ( | const char * | name | ) | const |
Searches local type; NULL if not found.
| GateElement* NEDTypeInfo::findGateDecl | ( | const char * | name | ) | const |
Searches local type and "extends" types; NULL if not found.
NEDResourceCache* NEDTypeInfo::resolver [protected] |
Type NEDTypeInfo::type [protected] |
std::string NEDTypeInfo::qualifiedName [protected] |
bool NEDTypeInfo::isInner [protected] |
NEDElement* NEDTypeInfo::tree [protected] |
StringVector NEDTypeInfo::extendsnames [protected] |
StringVector NEDTypeInfo::interfacenames [protected] |
std::string NEDTypeInfo::enclosingTypeName [protected] |
std::string NEDTypeInfo::implClassName [protected] |
1.5.5