PLaSK library

Loading...
Searching...
No Matches
manager.cpp
Go to the documentation of this file.
1/*
2 * This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3 * Copyright (c) 2022 Lodz University of Technology
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#include "manager.hpp"
15
16#ifdef _MSC_VER
17#include <algorithm>
18#endif
19
20 namespace plask {
21
22 const DynamicLibrary& DynamicLibraries::load(const std::string &file_name, unsigned flags) {
23 return *loaded.emplace(file_name, flags).first;
24}
25
26 void DynamicLibraries::close(const DynamicLibrary &to_close) {
27 loaded.erase(to_close);
28}
29
30 void DynamicLibraries::closeAll() {
31 loaded.clear();
32}
33
34 DynamicLibraries &DynamicLibraries::defaultSet()
35{
36 static DynamicLibraries default_set;
37 return default_set;
38}
39
40
41
42} // namespace plask