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