NEDTypeInfo Class Reference
[NED Resources]

#include <nedtypeinfo.h>

List of all members.


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.

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 * implementationClassName () 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


Member Typedef Documentation

typedef std::vector<std::string> NEDTypeInfo::StringVector [protected]

typedef std::map<std::string,int> NEDTypeInfo::StringToIntMap [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::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.


Member Data Documentation

Type NEDTypeInfo::type [protected]

std::string NEDTypeInfo::qualifiedName [protected]

bool NEDTypeInfo::isInner [protected]

std::string NEDTypeInfo::enclosingTypeName [protected]

std::string NEDTypeInfo::implClassName [protected]


The documentation for this class was generated from the following file:

Generated on Wed Apr 3 14:40:29 2013 for OMNeT++ NEDXML by  doxygen 1.5.5