12 #ifndef SST_CORE_ELIBASE_H
13 #define SST_CORE_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
69 std::vector<std::string> createVector(
const char** events) {
70 std::vector<std::string> vec;
71 if ( events == NULL )
return vec;
72 const char** ev = events;
73 while ( NULL != *ev ) {
90 description(description),
91 validEvents(validEvents)
97 const char * description;
98 const char * superclass;
109 using InfoMap=std::map<std::string, std::function<void()>>;
110 using LibraryMap=std::map<std::string,InfoMap>;
112 static bool isLoaded(
const std::string& name);
117 static bool addLoader(
const std::string& lib,
const std::string& name,
118 std::function<
void()>&& loader);
120 static const LibraryMap& getLoaders();
123 static std::unique_ptr<LibraryMap> loaders_;
130 #define ELI_FORWARD_AS_ONE(...) __VA_ARGS__
132 #define SST_ELI_DECLARE_BASE(Base) \
133 using __LocalEliBase = Base; \
134 static const char* ELI_baseName(){ return #Base; }
136 #define SST_ELI_DECLARE_INFO_COMMON() \
137 using InfoLibrary = ::SST::ELI::InfoLibrary<__LocalEliBase>; \
138 template <class __TT> static bool addDerivedInfo(const std::string& lib, const std::string& elem){ \
139 return addInfo(lib,elem,new BuilderInfo(lib,elem,(__TT*)nullptr)); \
142 #define SST_ELI_DECLARE_NEW_BASE(OldBase,NewBase) \
143 using __LocalEliBase = NewBase; \
144 using __ParentEliBase = OldBase; \
145 SST_ELI_DECLARE_INFO_COMMON() \
146 static const char* ELI_baseName(){ return #NewBase; } \
147 template <class InfoImpl> static bool addInfo(const std::string& elemlib, const std::string& elem, \
149 return OldBase::addInfo(elemlib, elem, info) \
150 && ::SST::ELI::InfoDatabase::getLibrary<NewBase>(elemlib)->addInfo(elem,info); \
154 #endif // SST_CORE_ELIBASE_H
static bool addLoader(const std::string &lib, const std::string &name, std::function< void()> &&loader)
Definition: elibase.cc:32
Definition: elibase.h:107
const char * defaultValue
Definition: elibase.h:49
const char * description
Definition: elibase.h:48
const char * description
Definition: elibase.h:64
const char ** validEvents
Definition: elibase.h:57
Describes Ports that the Component can use.
Definition: elibase.h:62
Definition: elibase.h:105
Describes Statistics used by a Component.
Definition: elibase.h:37
const char * description
Definition: elibase.h:56
const char * name
Definition: elibase.h:47
const char * name
Definition: elibase.h:38
Describes Parameters to a Component.
Definition: elibase.h:46
const char * description
Definition: elibase.h:39
const char * name
Definition: elibase.h:55
const uint8_t enableLevel
Definition: elibase.h:41
const char * name
Definition: elibase.h:63
Describes Ports that the Component can use.
Definition: elibase.h:54
const std::vector< std::string > validEvents
Definition: elibase.h:65
const char * units
Definition: elibase.h:40