SST  15.1.0
StructuralSimulationToolkit
interfaceInfo.h
1 // Copyright 2009-2025 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2025, NTESS
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 #ifndef SST_CORE_ELI_INTERFACE_INFO_H
13 #define SST_CORE_ELI_INTERFACE_INFO_H
14 
15 #include <iostream>
16 #include <string>
17 
18 namespace SST::ELI {
19 
21 {
22 public:
23  const std::string& getInterface() const { return iface_; }
24 
25  void toString(std::ostream& os) const { os << " Interface: " << iface_ << "\n"; }
26 
27  template <class XMLNode>
28  void outputXML(XMLNode* node) const
29  {
30  node->SetAttribute("Interface", iface_.c_str());
31  }
32 
33 protected:
34  template <class T>
35  explicit ProvidesInterface(T* UNUSED(t)) :
36  iface_(T::ELI_getInterface())
37  {}
38 
39 private:
40  std::string iface_;
41 };
42 
43 } // namespace SST::ELI
44 
45 #define SST_ELI_INTERFACE_INFO(interface) \
46  static const std::string ELI_getInterface() \
47  { \
48  return interface; \
49  }
50 
51 #endif // SST_CORE_ELI_INTERFACE_INFO_H
Definition: attributeInfo.h:22
Definition: interfaceInfo.h:20