Go to the documentation of this file.
18 #ifndef __OMNETPP_NEDXML_NEDRESOURCECACHE_H
19 #define __OMNETPP_NEDXML_NEDRESOURCECACHE_H
24 #include "nedelements.h"
59 virtual bool contains(
const char *qname)
const = 0;
62 virtual int size()
const = 0;
65 virtual const char *get(
int k)
const = 0;
75 virtual bool contains(
const char *qname)
const override {
return p->
lookup(qname)!=
nullptr;}
77 virtual const char *
get(
int k)
const override {
return p->
getTypeNames()[k].c_str();}
82 std::map<std::string,NedFileElement*>
nedFiles;
88 bool doneLoadingNedFilesCalled =
false;
98 typedef std::map<std::string,std::string>
StringMap;
112 virtual void addFile(
const char *fname, NedFileElement *node);
113 virtual void registerBuiltinDeclarations();
114 virtual int doLoadNedSourceFolder(
const char *foldername,
const char *expectedPackage,
const std::vector<std::string>& excludedFolders);
115 virtual void doLoadNedFileOrText(
const char *nedfname,
const char *nedtext,
const char *expectedPackage,
bool isXML);
116 virtual NedFileElement *parseAndValidateNedFileOrText(
const char *nedfname,
const char *nedtext,
bool isXML);
117 virtual std::string determineRootPackageName(
const char *nedSourceFolderName);
118 virtual std::string getNedSourceFolderForFolder(
const char *folder)
const;
119 virtual void collectNedTypesFrom(
ASTNode *node,
const std::string& packagePrefix,
bool areInnerTypes);
120 virtual void collectNedType(
const char *qname,
bool isInnerType,
ASTNode *node);
121 virtual bool areDependenciesResolved(
const char *qname,
ASTNode *node);
122 virtual void registerPendingNedTypes();
123 virtual void registerNedType(
const char *qname,
bool isInnerType,
ASTNode *node);
124 virtual std::string getFirstError(
ErrorStore *errors,
const char *prefix=
nullptr);
145 virtual int loadNedSourceFolder(
const char *foldername,
const char *excludedPackages);
154 virtual void loadNedFile(
const char *nedfname,
const char *expectedPackage,
bool isXML);
166 virtual void loadNedText(
const char *name,
const char *nedtext,
const char *expectedPackage,
bool isXML);
173 virtual void doneLoadingNedFiles();
179 std::vector<NedFileElement*> getPackageNedListForLookup(
const char *packageName)
const;
182 virtual NedTypeInfo *lookup(
const char *qname)
const;
185 virtual NedTypeInfo *getDecl(
const char *qname)
const;
188 virtual std::string resolveNedType(
const NedLookupContext& context,
const char *nedtypename, INedTypeNames *qnames);
193 return resolveNedType(context, nedtypename, &names);
197 virtual const std::vector<std::string>& getTypeNames()
const;
203 virtual std::string getNedPackageForFolder(
const char *folder)
const;
Stores loaded NED files, and keeps track of components in them.
Definition: nedresourcecache.h:52
bool isInnerType
Definition: nedresourcecache.h:103
PendingNedType(const char *q, bool inner, ASTNode *e)
Definition: nedresourcecache.h:105
virtual std::string resolveNedType(const NedLookupContext &context, const char *nedtypename)
Definition: nedresourcecache.h:191
std::string qname
Definition: nedresourcecache.h:102
ASTNode * element
Definition: nedresourcecache.h:39
virtual int size() const override
Definition: nedresourcecache.h:76
std::map< std::string, std::string > StringMap
Definition: nedresourcecache.h:98
std::string qname
Definition: nedresourcecache.h:40
std::map< std::string, NedFileElement * > packageDotNedFiles
Definition: nedresourcecache.h:85
Context of NED type lookup, for NedResourceCache.
Definition: nedresourcecache.h:37
NedResourceCache()
Definition: nedresourcecache.h:128
virtual NedTypeInfo * lookup(const char *qname) const
#define NEDXML_API
Definition: nedxmldefs.h:31
Definition: astbuilder.h:25
Definition: nedresourcecache.h:70
std::map< std::string, NedFileElement * > nedFiles
Definition: nedresourcecache.h:82
std::vector< std::string > nedTypeNames
Definition: nedresourcecache.h:94
virtual bool contains(const char *qname) const override
Definition: nedresourcecache.h:75
NedLookupContext(ASTNode *e, const char *q)
Definition: nedresourcecache.h:41
Stores information on a NED type.
Definition: nedtypeinfo.h:43
Definition: nedresourcecache.h:56
ASTNode * node
Definition: nedresourcecache.h:104
StringMap folderPackages
Definition: nedresourcecache.h:99
NedResourceCache * p
Definition: nedresourcecache.h:72
Definition: nedresourcecache.h:101
std::vector< PendingNedType > pendingList
Definition: nedresourcecache.h:109
Definition: errorstore.h:37
virtual const char * get(int k) const override
Definition: nedresourcecache.h:77
virtual ~INedTypeNames()
Definition: nedresourcecache.h:67
virtual const std::vector< std::string > & getTypeNames() const
std::map< std::string, NedTypeInfo * > nedTypes
Definition: nedresourcecache.h:91
CachedTypeNames(NedResourceCache *p)
Definition: nedresourcecache.h:74