12 #ifndef SST_CORE_PORTS_INFO_H
13 #define SST_CORE_PORTS_INFO_H
18 #include "sst/core/eli/elibase.h"
24 template <
class T,
class Enable=
void>
26 static const std::vector<SST::ElementInfoPort2>&
get() {
27 static std::vector<SST::ElementInfoPort2> var = { };
34 typename
MethodDetect<decltype(T::ELI_getPorts())>::type> {
35 static const std::vector<SST::ElementInfoPort2>&
get() {
36 return T::ELI_getPorts();
43 const std::vector<std::string>& getPortnames() {
return portnames; }
44 const std::vector<ElementInfoPort2>& getValidPorts()
const {
48 void toString(std::ostream& os)
const;
50 template <
class XMLNode>
void outputXML(XMLNode* node)
const {
53 for (
auto& port : ports_){
54 auto* XMLPortElement =
new XMLNode(
"Port");
55 XMLPortElement->SetAttribute(
"Index", idx);
56 XMLPortElement->SetAttribute(
"Name", port.name);
57 XMLPortElement->SetAttribute(
"Description", port.description ? port.description :
"none");
58 node->LinkEndChild(XMLPortElement);
73 std::vector<std::string> portnames;
74 std::vector<ElementInfoPort2> ports_;
81 #define SST_ELI_DOCUMENT_PORTS(...) \
82 static const std::vector<SST::ElementInfoPort2>& ELI_getPorts() { \
83 static std::vector<SST::ElementInfoPort2> var = { __VA_ARGS__ } ; \
Definition: portsInfo.h:25
Definition: portsInfo.h:41
Definition: elibase.h:105