12 #ifndef SST_CORE_SST_INFO_H 13 #define SST_CORE_SST_INFO_H 15 #include "sst/core/configShared.h" 16 #include "sst/core/eli/elementinfo.h" 24 #include "tinyxml/tinyxml.h" 31 #define CFG_OUTPUTHUMAN 0x00000001 32 #define CFG_OUTPUTXML 0x00000002 33 #define CFG_VERBOSE 0x00000004 44 using FilterMap_t = std::multimap<std::string, std::string>;
52 std::set<std::string> res;
53 for (
auto& i : m_filters )
71 bool doVerbose()
const {
return m_optionBits & CFG_VERBOSE; }
72 void addFilter(
const std::string& name);
80 int setPositionalArg(
int UNUSED(num),
const std::string& arg)
87 int parseHelp(std::string UNUSED(arg)) {
return printUsage(); }
89 SST_CONFIG_DECLARE_OPTION_NOVAR(help, std::bind(&SSTInfoConfig::parseHelp,
this, std::placeholders::_1));
92 static int parseVersion(std::string UNUSED(arg))
94 fprintf(stderr,
"SST Release Version %s\n", PACKAGE_VERSION);
98 SST_CONFIG_DECLARE_OPTION_NOVAR(version, std::bind(&SSTInfoConfig::parseVersion, std::placeholders::_1));
102 int parseQuiet(
const std::string& UNUSED(arg))
104 m_optionBits &= ~CFG_VERBOSE;
108 SST_CONFIG_DECLARE_OPTION_NOVAR(quiet, std::bind(&SSTInfoConfig::parseQuiet,
this, std::placeholders::_1));
111 SST_CONFIG_DECLARE_OPTION(
bool, debugEnabled,
false, &StandardConfigParsers::flag_set_true);
114 int parseNoDisplay(
const std::string& UNUSED(arg))
116 m_optionBits &= ~CFG_OUTPUTHUMAN;
120 SST_CONFIG_DECLARE_OPTION_NOVAR(no_display, std::bind(&SSTInfoConfig::parseNoDisplay,
this, std::placeholders::_1));
123 SST_CONFIG_DECLARE_OPTION(
bool, interactiveEnabled,
false, &StandardConfigParsers::flag_set_true);
128 int parseXML(
const std::string& UNUSED(arg))
130 m_optionBits |= CFG_OUTPUTXML;
134 SST_CONFIG_DECLARE_OPTION_NOVAR(xml, std::bind(&SSTInfoConfig::parseXML,
this, std::placeholders::_1));
136 SST_CONFIG_DECLARE_OPTION(
137 std::string, XMLFilePath,
"./SSTInfo.xml", &StandardConfigParsers::from_string<std::string>);
142 int parseLibs(
const std::string& arg)
148 SST_CONFIG_DECLARE_OPTION_NOVAR(libs, std::bind(&SSTInfoConfig::parseLibs,
this, std::placeholders::_1));
153 std::vector<std::string> m_elementsToProcess;
154 unsigned int m_optionBits;
155 FilterMap_t m_filters;
181 std::string componentName;
182 std::vector<std::string> stringIndexer;
183 std::map<std::string, std::string> infoMap;
187 std::map<std::string, std::vector<ComponentInfo>>
getComponentInfo() {
return m_components; }
201 void outputXML(
int Index, TiXmlNode* XMLParentElement);
204 void setLibraryInfo(std::string baseName, std::string componentName, std::string info);
210 void filterSearch(std::stringstream& outputStream, std::string tag, std::string searchTerm);
224 void resetFilters(
bool libFilter) { m_libraryFilter = libFilter, m_componentFilters.clear(); }
238 for (
auto& pair : m_components ) {
239 for (
auto& comp : pair.second ) {
240 if ( comp.componentName == component ) {
241 m_componentFilters.push_back(component);
249 template <
class BaseType>
251 template <
class BaseType>
253 template <
class BaseType>
256 std::string getLibraryDescription() {
return ""; }
260 std::map<std::string, std::vector<ComponentInfo>> m_components;
261 std::vector<std::string> m_componentNames;
262 bool m_libraryFilter =
false;
263 std::vector<std::string> m_componentFilters;
272 class InteractiveWindow
277 info = newwin(LINES - 3, COLS, 0, 0);
278 console = newwin(3, COLS, LINES - 3, 0);
282 void draw(
bool drawConsole =
true);
285 void toggleAutofillBox();
296 void printConsole(
const char* input)
298 DISABLE_WARN_FORMAT_SECURITY
299 wprintw(console, input);
302 void resetCursor(
int pos) { wmove(console, 1, pos); }
303 int getCursorPos() {
return getcurx(console); }
309 bool autofillEnabled;
316 #endif // SST_CORE_SST_INFO_H void clearHighlights()
Clear highlight characters from info strings.
Definition: sstinfo.cc:990
void setLibraryFilter(bool filter)
Sets the internal library filter status.
Definition: sstinfo.h:230
std::map< std::string, std::vector< ComponentInfo > > getComponentInfo()
Return the map of all component info for the Library.
Definition: sstinfo.h:187
void resetFilters(bool libFilter)
Clears the component filter and sets the internal library filter status.
Definition: sstinfo.h:224
bool processAllElements() const
Definition: sstinfo.h:69
void outputXML(int Index, TiXmlNode *XMLParentElement)
Create the formatted XML data of the Library.
Definition: sstinfo.cc:1123
SSTInfoConfig(bool suppress_print)
Create a new SSTInfo configuration and parse the Command Line.
Definition: sstinfo.cc:740
Class to contain SST Simulation Configuration variables.
Definition: configShared.h:36
void setLibraryInfo(std::string baseName, std::string componentName, std::string info)
Put text into info map.
Definition: sstinfo.cc:843
Definition: sstinfo.h:179
bool getFilter()
Filter output from info map.
Definition: sstinfo.h:218
The SSTInfo Configuration class.
Definition: sstinfo.h:41
void setAllLibraryInfo()
Store all Library Information.
Definition: sstinfo.cc:1031
void clearFilterMap()
Clears the current filter map.
Definition: sstinfo.h:59
int printUsage()
Called to print the help/usage message.
Definition: configBase.cc:275
SSTLibraryInfo(const std::string &name)
Create a new SSTInfoElement_LibraryInfo object.
Definition: sstinfo.h:171
int setComponentFilter(std::string component)
Adds the component filter string to the end of the internal vector of components. ...
Definition: sstinfo.h:236
unsigned int getOptionBits()
Definition: sstinfo.h:65
std::set< std::string > getElementsToProcessArray()
Return the list of elements to be processed.
Definition: sstinfo.h:50
bool doVerbose() const
Definition: sstinfo.h:71
std::string getLibraryName()
Return the Name of the Library.
Definition: sstinfo.h:176
std::string getUsagePrelude() override
Called to get the prelude for the help/usage message.
Definition: sstinfo.cc:779
The SSTInfo representation of ElementLibraryInfo object.
Definition: sstinfo.h:164
void outputHumanReadable(std::ostream &os, int LibIndex)
Output the Library Information.
Definition: sstinfo.cc:1078
void filterSearch(std::stringstream &outputStream, std::string tag, std::string searchTerm)
Set filters based on search term.
Definition: sstinfo.cc:920
void outputText(std::stringstream &os)
Return text from info map based on filters.
Definition: sstinfo.cc:879
FilterMap_t & getFilterMap()
Definition: sstinfo.h:62