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 )
75 bool doVerbose()
const {
return m_optionBits & CFG_VERBOSE; }
78 void addFilter(
const std::string& name);
86 int setPositionalArg(
int UNUSED(num),
const std::string& arg)
93 int printHelp(
const std::string& UNUSED(arg))
99 int outputVersion(
const std::string& UNUSED(arg))
101 fprintf(stderr,
"SST Release Version %s\n", PACKAGE_VERSION);
105 int setEnableDebug(
const std::string& UNUSED(arg))
107 m_debugEnabled =
true;
111 int setNoDisplay(
const std::string& UNUSED(arg))
113 m_optionBits &= ~CFG_OUTPUTHUMAN;
117 int setInteractive(
const std::string& UNUSED(arg))
119 m_interactive =
true;
123 int setXML(
const std::string& UNUSED(arg))
125 m_optionBits |= CFG_OUTPUTXML;
129 int setXMLOutput(
const std::string& arg)
135 int setLibs(
const std::string& arg)
141 int setQuiet(
const std::string& UNUSED(arg))
143 m_optionBits &= ~CFG_VERBOSE;
149 std::vector<std::string> m_elementsToProcess;
150 unsigned int m_optionBits;
151 std::string m_XMLFilePath;
154 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;
272class 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;
int printUsage()
Called to print the help/usage message.
Definition configBase.cc:195
ConfigShared(bool suppress_print, bool include_libpath, bool include_env, bool include_verbose)
ConfigShared constructor that it meant to be used when needing a stand alone ConfigShared (i....
Definition configShared.cc:23
bool interactiveEnabled() const
Definition sstinfo.h:77
FilterMap_t & getFilterMap()
Definition sstinfo.h:62
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 debugEnabled() const
Definition sstinfo.h:71
void clearFilterMap()
Clears the current filter map.
Definition sstinfo.h:59
std::string getUsagePrelude() override
Called to get the prelude for the help/usage message.
Definition sstinfo.cc:775
SSTInfoConfig(bool suppress_print)
Create a new SSTInfo configuration and parse the Command Line.
Definition sstinfo.cc:734
bool doVerbose() const
Definition sstinfo.h:75
bool processAllElements() const
Definition sstinfo.h:73
std::string & getXMLFilePath()
Definition sstinfo.h:68
std::string getLibraryName()
Return the Name of the Library.
Definition sstinfo.h:176
void setAllLibraryInfo()
Store all Library Information.
Definition sstinfo.cc:1027
void outputText(std::stringstream &os)
Return text from info map based on filters.
Definition sstinfo.cc:875
bool getFilter()
Filter output from info map.
Definition sstinfo.h:218
SSTLibraryInfo(const std::string &name)
Create a new SSTInfoElement_LibraryInfo object.
Definition sstinfo.h:170
void setLibraryInfo(std::string baseName, std::string componentName, std::string info)
Put text into info map.
Definition sstinfo.cc:839
void filterSearch(std::stringstream &outputStream, std::string tag, std::string searchTerm)
Set filters based on search term.
Definition sstinfo.cc:916
void setLibraryFilter(bool filter)
Sets the internal library filter status.
Definition sstinfo.h:230
void clearHighlights()
Clear highlight characters from info strings.
Definition sstinfo.cc:986
int setComponentFilter(std::string component)
Adds the component filter string to the end of the internal vector of components.
Definition sstinfo.h:236
void resetFilters(bool libFilter)
Clears the component filter and sets the internal library filter status.
Definition sstinfo.h:224
void outputHumanReadable(std::ostream &os, int LibIndex)
Output the Library Information.
Definition sstinfo.cc:1073
void outputXML(int Index, TiXmlNode *XMLParentElement)
Create the formatted XML data of the Library.
Definition sstinfo.cc:1117
std::map< std::string, std::vector< ComponentInfo > > getComponentInfo()
Return the map of all component info for the Library.
Definition sstinfo.h:187