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