SST  12.0.0
StructuralSimulationToolkit
interfaceInfo.h
1 // Copyright 2009-2022 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-2022, 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 namespace SST {
16 namespace ELI {
17 
19 {
20 public:
21  const std::string& getInterface() const { return iface_; }
22 
23  void toString(std::ostream& os) const { os << " Interface: " << iface_ << "\n"; }
24 
25  template <class XMLNode>
26  void outputXML(XMLNode* node) const
27  {
28  node->SetAttribute("Interface", iface_.c_str());
29  }
30 
31 protected:
32  template <class T>
33  ProvidesInterface(T* UNUSED(t)) : iface_(T::ELI_getInterface())
34  {}
35 
36 private:
37  std::string iface_;
38 };
39 
40 } // namespace ELI
41 } // namespace SST
42 
43 #define SST_ELI_INTERFACE_INFO(interface) \
44  static const std::string ELI_getInterface() { return interface; }
45 
46 #endif // SST_CORE_ELI_INTERFACE_INFO_H
Definition: interfaceInfo.h:18