NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
procedurelibrary.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2017 Erik Haenel et al.
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, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19#include "procedureelement.hpp"
20#include <string>
21#include <fstream>
22#include <map>
23#include <vector>
24
25#ifndef PROCEDURELIBRARY_HPP
26#define PROCEDURELIBRARY_HPP
27
34{
35 private:
36 std::map<std::string, ProcedureElement*> mLibraryEntries;
37
38 ProcedureElement* constructProcedureElement(const std::string& sProcedureFileName);
39 StyledTextFile getFileContents(const std::string& sProcedureFileName);
40
41 public:
43
44 ProcedureElement* getProcedureContents(const std::string& sProcedureFileName);
45 void updateLibrary();
46};
47
48#endif
49
This class contains the pre-parsed contents of a single procedure file.
This class manages all already read and possibly pre-parsed procedure files for easier and faster acc...
std::map< std::string, ProcedureElement * > mLibraryEntries
StyledTextFile getFileContents(const std::string &sProcedureFileName)
Reads the contents of the passed file and returns it as a std::vector.
void updateLibrary()
Perform an update, e.g. if a procedure was deleted.
ProcedureElement * getProcedureContents(const std::string &sProcedureFileName)
Returns the ProcedureElement pointer to the desired procedure file. It also creates the element,...
ProcedureElement * constructProcedureElement(const std::string &sProcedureFileName)
Constructs a new ProcedureElement, if the file exists. Otherwise returns a nullptr.
~ProcedureLibrary()
Destructor avoiding memory leaks. Releases the memory allocated for each ProcedureElement.
This class represents a text file in memory (e.g. a code file). This class will try to lex the loaded...