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" 22 #include "tinyxml/tinyxml.h" 29 #define CFG_OUTPUTHUMAN 0x00000001 30 #define CFG_OUTPUTXML 0x00000002 31 #define CFG_VERBOSE 0x00000004 42 typedef std::multimap<std::string, std::string> FilterMap_t;
50 std::set<std::string> res;
51 for (
auto& i : m_filters )
73 bool doVerbose()
const {
return m_optionBits & CFG_VERBOSE; }
76 void addFilter(
const std::string& name);
84 int setPositionalArg(
int UNUSED(num),
const std::string& arg)
91 int printHelp(
const std::string& UNUSED(arg))
97 int outputVersion(
const std::string& UNUSED(arg))
99 fprintf(stderr,
"SST Release Version %s\n", PACKAGE_VERSION);
103 int setEnableDebug(
const std::string& UNUSED(arg))
105 m_debugEnabled =
true;
109 int setNoDisplay(
const std::string& UNUSED(arg))
111 m_optionBits &= ~CFG_OUTPUTHUMAN;
115 int setInteractive(
const std::string& UNUSED(arg))
117 m_interactive =
true;
121 int setXML(
const std::string& UNUSED(arg))
123 m_optionBits |= CFG_OUTPUTXML;
127 int setXMLOutput(
const std::string& UNUSED(arg))
133 int setLibs(
const std::string& UNUSED(arg))
139 int setQuiet(
const std::string& UNUSED(arg))
141 m_optionBits &= ~CFG_VERBOSE;
147 std::vector<std::string> m_elementsToProcess;
148 unsigned int m_optionBits;
149 std::string m_XMLFilePath;
152 FilterMap_t m_filters;
177 std::string componentName;
178 std::vector<std::string> stringIndexer;
179 std::map<std::string, std::string> infoMap;
183 std::map<std::string, std::vector<ComponentInfo>>
getComponentInfo() {
return m_components; }
197 void outputXML(
int Index, TiXmlNode* XMLParentElement);
200 void setLibraryInfo(std::string baseName, std::string componentName, std::string info);
206 void filterSearch(std::stringstream& outputStream, std::string tag, std::string searchTerm);
220 void resetFilters(
bool libFilter) { m_libraryFilter = libFilter, m_componentFilters.clear(); }
234 for (
auto& pair : m_components ) {
235 for (
auto& comp : pair.second ) {
236 if ( comp.componentName == component ) {
237 m_componentFilters.push_back(component);
245 template <
class BaseType>
247 template <
class BaseType>
249 template <
class BaseType>
252 std::string getLibraryDescription() {
return ""; }
256 std::map<std::string, std::vector<ComponentInfo>> m_components;
257 std::vector<std::string> m_componentNames;
258 bool m_libraryFilter =
false;
259 std::vector<std::string> m_componentFilters;
268 class InteractiveWindow
273 info = newwin(LINES - 3, COLS, 0, 0);
274 console = newwin(3, COLS, LINES - 3, 0);
278 void draw(
bool drawConsole =
true);
281 void toggleAutofillBox();
292 void printConsole(
const char* input)
294 DISABLE_WARN_FORMAT_SECURITY
295 wprintw(console, input);
298 void resetCursor(
int pos) { wmove(console, 1, pos); }
299 int getCursorPos() {
return getcurx(console); }
305 bool autofillEnabled;
312 #endif // SST_CORE_SST_INFO_H void clearHighlights()
Clear highlight characters from info strings.
Definition: sstinfo.cc:956
void setLibraryFilter(bool filter)
Sets the internal library filter status.
Definition: sstinfo.h:226
std::map< std::string, std::vector< ComponentInfo > > getComponentInfo()
Return the map of all component info for the Library.
Definition: sstinfo.h:183
void resetFilters(bool libFilter)
Clears the component filter and sets the internal library filter status.
Definition: sstinfo.h:220
bool processAllElements() const
Definition: sstinfo.h:71
void outputXML(int Index, TiXmlNode *XMLParentElement)
Create the formatted XML data of the Library.
Definition: sstinfo.cc:1077
SSTInfoConfig(bool suppress_print)
Create a new SSTInfo configuration and parse the Command Line.
Definition: sstinfo.cc:708
Class to contain SST Simulation Configuration variables.
Definition: configShared.h:33
bool debugEnabled() const
Definition: sstinfo.h:69
void setLibraryInfo(std::string baseName, std::string componentName, std::string info)
Put text into info map.
Definition: sstinfo.cc:813
Definition: sstinfo.h:175
bool getFilter()
Filter output from info map.
Definition: sstinfo.h:214
The SSTInfo Configuration class.
Definition: sstinfo.h:39
void setAllLibraryInfo()
Store all Library Information.
Definition: sstinfo.cc:997
void clearFilterMap()
Clears the current filter map.
Definition: sstinfo.h:57
int printUsage()
Called to print the help/usage message.
Definition: configBase.cc:174
std::string & getXMLFilePath()
Definition: sstinfo.h:66
SSTLibraryInfo(const std::string &name)
Create a new SSTInfoElement_LibraryInfo object.
Definition: sstinfo.h:168
int setComponentFilter(std::string component)
Adds the component filter string to the end of the internal vector of components. ...
Definition: sstinfo.h:232
bool interactiveEnabled() const
Definition: sstinfo.h:75
unsigned int getOptionBits()
Definition: sstinfo.h:63
std::set< std::string > getElementsToProcessArray()
Return the list of elements to be processed.
Definition: sstinfo.h:48
bool doVerbose() const
Definition: sstinfo.h:73
std::string getLibraryName()
Return the Name of the Library.
Definition: sstinfo.h:172
std::string getUsagePrelude() override
Called to get the prelude for the help/usage message.
Definition: sstinfo.cc:753
The SSTInfo representation of ElementLibraryInfo object.
Definition: sstinfo.h:161
void outputHumanReadable(std::ostream &os, int LibIndex)
Output the Library Information.
Definition: sstinfo.cc:1038
void filterSearch(std::stringstream &outputStream, std::string tag, std::string searchTerm)
Set filters based on search term.
Definition: sstinfo.cc:888
void outputText(std::stringstream &os)
Return text from info map based on filters.
Definition: sstinfo.cc:849
FilterMap_t & getFilterMap()
Definition: sstinfo.h:60