|
OMNeT++ NEDXML 6.1
Discrete Event Simulation Library
|
|
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;
95 typedef std::map<std::string,std::string>
StringMap;
99 virtual void addFile(NedFileElement *node,
const char *expectedPackage);
100 virtual void registerBuiltinDeclarations();
101 virtual int doLoadNedSourceFolder(
const char *foldername,
const char *expectedPackage,
const std::vector<std::string>& excludedFolders);
102 virtual void doLoadNedFileOrText(
const char *nedfname,
const char *nedtext,
const char *expectedPackage,
bool isXML);
103 virtual NedFileElement *parseAndValidateNedFileOrText(
const char *nedfname,
const char *nedtext,
bool isXML);
104 virtual std::string determineRootPackageName(
const char *nedSourceFolderName);
105 virtual std::string getNedSourceFolderForFolder(
const char *folder)
const;
106 virtual void collectNedTypesFrom(
ASTNode *node,
const std::string& packagePrefix,
bool areInnerTypes);
107 virtual NedTypeInfo *createTypeInfo(
const char *qname,
bool isInnerType,
ASTNode *node);
108 virtual void registerNedType(
const char *qname,
bool isInnerType,
ASTNode *node);
109 virtual bool hasResolvedTypeUnder(
const std::string& packageName)
const;
110 virtual std::string getFirstError(
ErrorStore *errors,
const char *prefix=
nullptr);
131 virtual int loadNedSourceFolder(
const char *foldername,
const char *excludedPackages);
140 virtual void loadNedFile(
const char *nedfname,
const char *expectedPackage,
bool isXML);
152 virtual void loadNedText(
const char *name,
const char *nedtext,
const char *expectedPackage,
bool isXML);
159 virtual void resolveAllNedTypes();
165 virtual void doneLoadingNedFiles();
171 std::vector<NedFileElement*> getPackageNedListForLookup(
const char *packageName)
const;
176 virtual NedTypeInfo *lookup(
const char *qname)
const;
187 virtual std::string lookupNedType(
const NedLookupContext& context,
const char *nedTypeName,
const INedTypeNames& amongQNames);
199 virtual const std::vector<std::string>&
getTypeNames()
const {
return nedTypeNames;}
205 virtual std::string getNedPackageForFolder(
const char *folder)
const;
Stores loaded NED files, and keeps track of components in them.
Definition: nedresourcecache.h:52
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:95
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:114
virtual NedTypeInfo * lookup(const char *qname) const
#define NEDXML_API
Definition: nedxmldefs.h:31
virtual std::string lookupNedType(const NedLookupContext &context, const char *nedTypeName)
Definition: nedresourcecache.h:192
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:91
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
StringMap folderPackages
Definition: nedresourcecache.h:96
NedResourceCache * p
Definition: nedresourcecache.h:72
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
Definition: nedresourcecache.h:199
std::map< std::string, NedTypeInfo * > nedTypes
Definition: nedresourcecache.h:88
CachedTypeNames(NedResourceCache *p)
Definition: nedresourcecache.h:74