NEDTypeInfo Class Reference
[NED Resources]

Wraps a NEDElement tree of a NED declaration (module, channel, module interface or channel interface), or declaration in a msg file (enum, class, struct). More...

#include <nedtypeinfo.h>

List of all members.

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 NEDElementgetTree () const
NEDResourceCachegetResolver () 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 * getImplementationClassName () const
virtual std::string getPackageProperty (const char *name) const
virtual std::string getCxxNamespace () const
virtual NEDTypeInfogetSuperDecl () const
Convenience method to query the tree

ParametersElementgetParametersElement () const
GatesElementgetGatesElement () const
SubmodulesElementgetSubmodulesElement () const
ConnectionsElementgetConnectionsElement () const
SubmoduleElementgetLocalSubmoduleElement (const char *submoduleName) const
ConnectionElementgetLocalConnectionElement (long id) const
SubmoduleElementgetSubmoduleElement (const char *submoduleName) const
ConnectionElementgetConnectionElement (long id) const
ParamElementfindLocalParamDecl (const char *name) const
ParamElementfindParamDecl (const char *name) const
GateElementfindLocalGateDecl (const char *name) const
GateElementfindGateDecl (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

NEDResourceCacheresolver
Type type
std::string qualifiedName
bool isInner
NEDElementtree
StringVector extendsnames
StringVector interfacenames
std::string enclosingTypeName
std::string implClassName

Detailed Description

Wraps a NEDElement tree of a NED declaration (module, channel, module interface or channel interface), or declaration in a msg file (enum, class, struct).

May be extended by subclassing.

Represents NED declarations of modules, module interfaces, channels and channel interfaces. All instances are created and managed by NEDResourceCache.


Member Typedef Documentation

typedef std::map<std::string,int> NEDTypeInfo::StringToIntMap [protected]
typedef std::vector<std::string> NEDTypeInfo::StringVector [protected]

Member Enumeration Documentation

Enumerator:
SIMPLE_MODULE 
COMPOUND_MODULE 
MODULEINTERFACE 
CHANNEL 
CHANNELINTERFACE 

Constructor & Destructor Documentation

NEDTypeInfo::NEDTypeInfo ( NEDResourceCache resolver,
const char *  qname,
bool  isInnerType,
NEDElement tree 
)

Constructor.

It expects fully qualified name

virtual NEDTypeInfo::~NEDTypeInfo (  )  [virtual]

Destructor.


Member Function Documentation

void NEDTypeInfo::checkComplianceToInterface ( NEDTypeInfo interfaceDecl  )  [protected]
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.

GateElement* NEDTypeInfo::findGateDecl ( 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.

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.

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.

ConnectionsElement* NEDTypeInfo::getConnectionsElement (  )  const
virtual std::string NEDTypeInfo::getCxxNamespace (  )  const [virtual]

The C++ namespace for this NED type; implemented as getPackageProperty("namespace").

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 const char* NEDTypeInfo::getFullName (  )  const [virtual]

Returns the fully qualified name of the NED type.

GatesElement* NEDTypeInfo::getGatesElement (  )  const
virtual const char* NEDTypeInfo::getImplementationClassName (  )  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 "cModule"); for interface types it returns NULL.

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::getLocalSubmoduleElement ( const char *  submoduleName  )  const

Returns the submodule element with the given name from the local type, or NULL if not found.

virtual const char* NEDTypeInfo::getName (  )  const [virtual]

Returns the simple name of the NED type.

virtual std::string NEDTypeInfo::getPackage (  )  const [virtual]

Returns the package name (from the package declaration of the containing NED file.

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.

ParametersElement* NEDTypeInfo::getParametersElement (  )  const
NEDResourceCache* NEDTypeInfo::getResolver (  )  const [inline]

The NED type resolver this type is registered in.

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.

SubmodulesElement* NEDTypeInfo::getSubmodulesElement (  )  const
virtual NEDTypeInfo* NEDTypeInfo::getSuperDecl (  )  const [virtual]

Returns the first "extends" clause, or NULL.

virtual NEDElement* NEDTypeInfo::getTree (  )  const [virtual]

Returns the raw NEDElement tree representing the component.

virtual Type NEDTypeInfo::getType (  )  const [inline, virtual]

Returns the type of this declaration: simple module, compound module, channel, etc.

virtual std::string NEDTypeInfo::info (  )  const [virtual]

Returns a one-line summary (base class, implemented interfaces, etc).

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::isInnerType (  )  const [inline, virtual]

Returns true if this NED type is an inner type.

virtual bool NEDTypeInfo::isNetwork (  )  const [virtual]

Returns true if this NED type has a local (non-inherited) @network (or @network(true)) property.

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 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 bool NEDTypeInfo::supportsInterface ( const char *  qname  )  [virtual]

Returns true if this NED type extends/"is like" the given module interface or channel interface.


Member Data Documentation

std::string NEDTypeInfo::enclosingTypeName [protected]
std::string NEDTypeInfo::implClassName [protected]
bool NEDTypeInfo::isInner [protected]
std::string NEDTypeInfo::qualifiedName [protected]
Type NEDTypeInfo::type [protected]

The documentation for this class was generated from the following file:
Generated on Tue Dec 2 11:16:31 2014 for OMNeT++ NEDXML by  doxygen 1.6.3