SST  15.1.0
StructuralSimulationToolkit
elemLoader.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_ELEMLOADER_H
13 #define SST_CORE_ELEMLOADER_H
14 
15 #include <string>
16 #include <vector>
17 
18 namespace SST {
19 
20 struct ElementInfoGenerator;
21 
22 /** Class to load Element Libraries */
24 {
25 public:
26  /** Create a new ElementLoader with a given searchpath of directories */
27  explicit ElemLoader(const std::string& searchPaths);
28  ~ElemLoader();
29 
30  /**
31  Update the search paths
32  @param searchPaths New search paths to use
33  */
34  void updateSearchPaths(const std::string& paths);
35 
36  /** Attempt to load a library
37  * @param elemlib - The name of the Element Library to load
38  * @param err_os - Where to print errors associated with attempting to find and load the library
39  * @return Informational structure of the library, or nullptr if it failed to load.
40  */
41  void loadLibrary(const std::string& elemlib, std::ostream& err_os);
42 
43  /**
44  * Search paths for potential elements and add them to the provided vector
45  *
46  * @param potElems - vector of potential elements that could contain elements
47  * @return void
48  */
49  void getPotentialElements(std::vector<std::string>& potElems);
50 
51 private:
52  std::string searchPaths;
53  bool verbose;
54  int bindPolicy;
55 };
56 
57 } // namespace SST
58 
59 #endif // SST_CORE_ELEMLOADER_H
Definition: action.cc:18
ElemLoader(const std::string &searchPaths)
Create a new ElementLoader with a given searchpath of directories.
Definition: elemLoader.cc:125
void loadLibrary(const std::string &elemlib, std::ostream &err_os)
Attempt to load a library.
Definition: elemLoader.cc:151
Class to load Element Libraries.
Definition: elemLoader.h:23
void updateSearchPaths(const std::string &paths)
Update the search paths.
Definition: elemLoader.cc:145
void getPotentialElements(std::vector< std::string > &potElems)
Search paths for potential elements and add them to the provided vector.
Definition: elemLoader.cc:297