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