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;
76 const char* description;
77 const char* superclass;
101 combineEliInfo(std::vector<T>& base, std::vector<T>& add)
103 std::vector<T> combined;
105 for (
auto x : add ) {
107 for (
auto y : base ) {
108 if ( !strcmp(x.name, y.name) ) {
113 if ( add ) combined.emplace_back(x);
118 for (
auto x : base ) {
119 if ( x.description !=
nullptr ) { combined.emplace_back(x); }
126 void combineEliInfo(std::vector<ElementInfoAttribute>& base, std::vector<ElementInfoAttribute>& add);
136 virtual void load() = 0;
143 using InfoMap = std::map<std::string, std::list<LibraryLoader*>>;
144 using LibraryMap = std::map<std::string, InfoMap>;
146 static bool isLoaded(
const std::string& name);
153 static const LibraryMap& getLoaders();
156 static std::unique_ptr<LibraryMap> loaders_;
162 #define ELI_FORWARD_AS_ONE(...) __VA_ARGS__
178 #define SST_ELI_DECLARE_BASE(Base) \
179 using __LocalEliBase = Base; \
180 using __ParentEliBase = void; \
181 static constexpr int __EliBaseLevel = 0; \
182 static constexpr int __EliDerivedLevel = 0; \
183 static const char* ELI_baseName() { return #Base; }
185 #define SST_ELI_DECLARE_INFO_COMMON() \
186 using InfoLibrary = ::SST::ELI::InfoLibrary<__LocalEliBase>; \
187 template <class __TT> \
188 static bool addDerivedInfo(const std::string& lib, const std::string& elem) \
190 using BuilderInfo = typename __LocalEliBase::BuilderInfo; \
191 return addInfo(lib, elem, new BuilderInfo(lib, elem, (__TT*)nullptr)); \
200 #define SST_ELI_DECLARE_NEW_BASE(OldBase, NewBase) \
201 using __LocalEliBase = NewBase; \
202 using __ParentEliBase = OldBase; \
203 static constexpr int __EliBaseLevel = OldBase::__EliBaseLevel + 2; \
204 SST_ELI_DECLARE_INFO_COMMON() \
205 static const char* ELI_baseName() { return #NewBase; } \
206 template <class InfoImpl> \
207 static bool addInfo(const std::string& elemlib, const std::string& elem, InfoImpl* info) \
209 return OldBase::addInfo(elemlib, elem, info) && \
210 ::SST::ELI::InfoDatabase::getLibrary<NewBase>(elemlib)->addInfo(elem, info); \
Definition: elibase.h:141
static bool addLoader(const std::string &lib, const std::string &name, LibraryLoader *loader)
Definition: elibase.cc:28
Definition: elibase.h:135
Definition: elibase.h:130
Describes Parameters to a Component.
Definition: elibase.h:48
const char * name
Definition: elibase.h:49
const char * description
Definition: elibase.h:50
const char * defaultValue
Definition: elibase.h:51
Describes Ports that the Component can use.
Definition: elibase.h:58
const char * name
Definition: elibase.h:59
const char * description
Definition: elibase.h:61
const std::vector< std::string > validEvents
Definition: elibase.h:63
Describes Statistics used by a Component.
Definition: elibase.h:38
const char * name
Definition: elibase.h:39
const char * units
Definition: elibase.h:41
const uint8_t enableLevel
Definition: elibase.h:42
const char * description
Definition: elibase.h:40