12 #ifndef SST_CORE_ELI_ELIBASE_H
13 #define SST_CORE_ELI_ELIBASE_H
15 #include "sst/core/sst_types.h"
27 #define COMPONENT_CATEGORY_UNCATEGORIZED 0x00
28 #define COMPONENT_CATEGORY_PROCESSOR 0x01
29 #define COMPONENT_CATEGORY_MEMORY 0x02
30 #define COMPONENT_CATEGORY_NETWORK 0x04
31 #define COMPONENT_CATEGORY_SYSTEM 0x08
62 const std::vector<std::string>
69 const char* description;
70 const char* superclass;
90 combineEliInfo(std::vector<T>& base, std::vector<T>& add)
92 std::vector<T> combined;
94 for (
auto x : add ) {
96 for (
auto y : base ) {
97 if ( !strcmp(x.name, y.name) ) {
102 if ( add ) combined.emplace_back(x);
107 for (
auto x : base ) {
108 if ( x.description !=
nullptr ) { combined.emplace_back(x); }
121 virtual void load() = 0;
128 using InfoMap = std::map<std::string, std::list<LibraryLoader*>>;
129 using LibraryMap = std::map<std::string, InfoMap>;
131 static bool isLoaded(
const std::string& name);
138 static const LibraryMap& getLoaders();
141 static std::unique_ptr<LibraryMap> loaders_;
147 #define ELI_FORWARD_AS_ONE(...) __VA_ARGS__
163 #define SST_ELI_DECLARE_BASE(Base) \
164 using __LocalEliBase = Base; \
165 using __ParentEliBase = void; \
166 static constexpr int __EliBaseLevel = 0; \
167 static constexpr int __EliDerivedLevel = 0; \
168 static const char* ELI_baseName() { return #Base; }
170 #define SST_ELI_DECLARE_INFO_COMMON() \
171 using InfoLibrary = ::SST::ELI::InfoLibrary<__LocalEliBase>; \
172 template <class __TT> \
173 static bool addDerivedInfo(const std::string& lib, const std::string& elem) \
175 return addInfo(lib, elem, new BuilderInfo(lib, elem, (__TT*)nullptr)); \
184 #define SST_ELI_DECLARE_NEW_BASE(OldBase, NewBase) \
185 using __LocalEliBase = NewBase; \
186 using __ParentEliBase = OldBase; \
187 static constexpr int __EliBaseLevel = OldBase::__EliBaseLevel + 2; \
188 SST_ELI_DECLARE_INFO_COMMON() \
189 static const char* ELI_baseName() { return #NewBase; } \
190 template <class InfoImpl> \
191 static bool addInfo(const std::string& elemlib, const std::string& elem, InfoImpl* info) \
193 return OldBase::addInfo(elemlib, elem, info) && \
194 ::SST::ELI::InfoDatabase::getLibrary<NewBase>(elemlib)->addInfo(elem, info); \
197 #endif // SST_CORE_ELI_ELIBASE_H
Definition: elibase.h:125
const char * defaultValue
Definition: elibase.h:51
const char * description
Definition: elibase.h:50
Definition: elibase.h:114
Describes Statistics used by a Component.
Definition: elibase.h:37
Definition: elibase.h:119
const char * description
Definition: elibase.h:61
const char * name
Definition: elibase.h:49
const std::vector< std::string > validEvents
Definition: elibase.h:63
const char * name
Definition: elibase.h:39
Describes Parameters to a Component.
Definition: elibase.h:47
const char * description
Definition: elibase.h:40
const char * name
Definition: elibase.h:59
const uint8_t enableLevel
Definition: elibase.h:42
Describes Ports that the Component can use.
Definition: elibase.h:57
static bool addLoader(const std::string &lib, const std::string &name, LibraryLoader *loader)
Definition: elibase.cc:28
const char * units
Definition: elibase.h:41