12 #ifndef SST_CORE_COMPONENTINFO_H
13 #define SST_CORE_COMPONENTINFO_H
15 #include <sst/core/sst_types.h>
17 #include <unordered_set>
41 const ComponentId_t id;
42 const std::string name;
43 const std::string type;
47 inline void setComponent(
Component* comp) { component = comp; }
68 inline ComponentId_t getID()
const {
return id; }
70 inline const std::string& getName()
const {
return name; }
72 inline const std::string& getType()
const {
return type; }
74 inline Component* getComponent()
const {
return component; }
76 inline LinkMap* getLinkMap()
const {
return link_map; }
81 std::hash<std::string> hash;
82 return hash(info->name);
88 return lhs->name == rhs->name;
94 std::hash<ComponentId_t> hash;
95 return hash(info->id);
101 return lhs->id == rhs->id;
110 std::unordered_set<ComponentInfo*, ComponentInfo::HashName, ComponentInfo::EqualsName> dataByName;
111 std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID> dataByID;
114 typedef std::unordered_set<ComponentInfo*, ComponentInfo::HashName, ComponentInfo::EqualsName>::const_iterator const_iterator;
116 const_iterator begin()
const {
117 return dataByName.begin();
120 const_iterator end()
const {
121 return dataByName.end();
127 dataByName.insert(info);
128 dataByID.insert(info);
133 auto value = dataByName.find(&infoKey);
134 if ( value == dataByName.end() )
return NULL;
140 auto value = dataByID.find(&infoKey);
141 if ( value == dataByID.end() )
return NULL;
146 return dataByName.empty();
150 for (
auto i : dataByName ) {
160 #endif // SST_CORE_COMPONENTINFO_H
Main control class for a SST Simulation.
Definition: simulation.h:75
Maps port names to the Links that are connected to it.
Definition: linkMap.h:28
Main component object for the simulation.
Definition: component.h:56
Definition: componentInfo.h:99
Definition: componentInfo.h:108
Definition: componentInfo.h:79
Definition: componentInfo.h:92
Definition: componentInfo.h:86
Definition: componentInfo.h:36