1 #ifndef SST_CORE_PORTS_INFO_H
2 #define SST_CORE_PORTS_INFO_H
7 #include <sst/core/eli/elibase.h>
13 template <
class T,
class Enable=
void>
15 static const std::vector<SST::ElementInfoPort2>&
get() {
16 static std::vector<SST::ElementInfoPort2> var = { };
23 typename
MethodDetect<decltype(T::ELI_getPorts())>::type> {
24 static const std::vector<SST::ElementInfoPort2>&
get() {
25 return T::ELI_getPorts();
32 const std::vector<std::string>& getPortnames() {
return portnames; }
33 const std::vector<ElementInfoPort2>& getValidPorts()
const {
37 void toString(std::ostream& os)
const;
39 template <
class XMLNode>
void outputXML(XMLNode* node)
const {
42 for (
auto& port : ports_){
43 auto* XMLPortElement =
new XMLNode(
"Port");
44 XMLPortElement->SetAttribute(
"Index", idx);
45 XMLPortElement->SetAttribute(
"Name", port.name);
46 XMLPortElement->SetAttribute(
"Description", port.description ? port.description :
"none");
47 node->LinkEndChild(XMLPortElement);
62 std::vector<std::string> portnames;
63 std::vector<ElementInfoPort2> ports_;
70 #define SST_ELI_DOCUMENT_PORTS(...) \
71 static const std::vector<SST::ElementInfoPort2>& ELI_getPorts() { \
72 static std::vector<SST::ElementInfoPort2> var = { __VA_ARGS__ } ; \
Definition: portsInfo.h:14
Definition: portsInfo.h:30
Definition: elibase.h:105