SST  11.1.0
StructuralSimulationToolkit
elemLoader.h
1 // Copyright 2009-2021 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-2021, 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  ElemLoader(const std::string& searchPaths);
28  ~ElemLoader();
29 
30  /** Attempt to load a library
31  * @param elemlib - The name of the Element Library to load
32  * @param err_os - Where to print errors associated with attempting to find and load the library
33  * @return Informational structure of the library, or nullptr if it failed to load.
34  */
35  void loadLibrary(const std::string& elemlib, std::ostream& err_os);
36 
37  /**
38  * Search paths for potential elements and add them to the provided vector
39  *
40  * @param potElems - vector of potential elements that could contain elements
41  * @return void
42  */
43  void getPotentialElements(std::vector<std::string>& potElems);
44 
45 private:
46  std::string searchPaths;
47  bool verbose;
48  int bindPolicy;
49 };
50 
51 } // namespace SST
52 
53 #endif // SST_CORE_ELEMLOADER_H
ElemLoader(const std::string &searchPaths)
Create a new ElementLoader with a given searchpath of directories.
Definition: elemLoader.cc:59
void loadLibrary(const std::string &elemlib, std::ostream &err_os)
Attempt to load a library.
Definition: elemLoader.cc:77
Class to load Element Libraries.
Definition: elemLoader.h:23
void getPotentialElements(std::vector< std::string > &potElems)
Search paths for potential elements and add them to the provided vector.
Definition: elemLoader.cc:147