SST  10.1.0
StructuralSimulationToolkit
elemLoader.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_ELEMLOADER_H
13 #define _SST_CORE_ELEMLOADER_H
14 
15 #include <string>
16 #include <vector>
17 #include <map>
18 
19 namespace SST {
20 
21 struct LoaderData;
22 struct ElementInfoGenerator;
23 
24 /** Class to load Element Libraries */
25 class ElemLoader {
26  LoaderData *loaderData;
27  std::string searchPaths;
28 public:
29  /** Create a new ElementLoader with a given searchpath of directories */
30  ElemLoader(const std::string& searchPaths);
31  ~ElemLoader();
32 
33  /** Attempt to load a library
34  * @param elemlib - The name of the Element Library to load
35  * @param err_os - Where to print errors associated with attempting to find and load the library
36  * @return Informational structure of the library, or nullptr if it failed to load.
37  */
38  void loadLibrary(const std::string& elemlib, std::ostream& err_os);
39 
40  /**
41  * Returns a list of potential element libraries in the search path
42  */
43  std::vector<std::string> getPotentialElements();
44 };
45 
46 }
47 
48 #endif /* _SST_CORE_ELEMLOADER_H */
This structure exists so that we don&#39;t need to have any libtool-specific code (and therefore need the...
Definition: elemLoader.cc:63
ElemLoader(const std::string &searchPaths)
Create a new ElementLoader with a given searchpath of directories.
Definition: elemLoader.cc:69
void loadLibrary(const std::string &elemlib, std::ostream &err_os)
Attempt to load a library.
Definition: elemLoader.cc:175
Class to load Element Libraries.
Definition: elemLoader.h:25
std::vector< std::string > getPotentialElements()
Returns a list of potential element libraries in the search path.
Definition: elemLoader.cc:221