00001 // Copyright 2009-2015 Sandia Corporation. Under the terms 00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. 00003 // Government retains certain rights in this software. 00004 // 00005 // Copyright (c) 2009-2015, Sandia Corporation 00006 // All rights reserved. 00007 // 00008 // This file is part of the SST software package. For license 00009 // information, see the LICENSE file in the top level directory of the 00010 // distribution. 00011 00012 #ifndef _SST_CORE_ELEMLOADER_H 00013 #define _SST_CORE_ELEMLOADER_H 00014 00015 #include <string> 00016 #include <sst/core/element.h> 00017 00018 namespace SST { 00019 00020 struct LoaderData; 00021 00022 /** Class to load Element Libraries */ 00023 class ElemLoader { 00024 LoaderData *loaderData; 00025 std::string searchPaths; 00026 public: 00027 /** Create a new ElementLoader with a given searchpath of directories */ 00028 ElemLoader(const std::string &searchPaths); 00029 ~ElemLoader(); 00030 00031 /** Attempt to load a library 00032 * @param elemlib - The name of the Element Library to load 00033 * @param showErrors - Print errors associated with attempting to find and load the library 00034 * @return Informational structure of the library, or NULL if it failed to load. 00035 */ 00036 const ElementLibraryInfo* loadLibrary(const std::string &elemlib, bool showErrors); 00037 }; 00038 00039 } 00040 00041 #endif /* _SST_CORE_ELEMLOADER_H */