NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
ProcedureLibrary Class Reference

This class manages all already read and possibly pre-parsed procedure files for easier and faster access. More...

#include <procedurelibrary.hpp>

Collaboration diagram for ProcedureLibrary:

Public Member Functions

 ~ProcedureLibrary ()
 Destructor avoiding memory leaks. Releases the memory allocated for each ProcedureElement. More...
 
ProcedureElementgetProcedureContents (const std::string &sProcedureFileName)
 Returns the ProcedureElement pointer to the desired procedure file. It also creates the element, if it doesn't already exist. More...
 
void updateLibrary ()
 Perform an update, e.g. if a procedure was deleted. More...
 

Private Member Functions

ProcedureElementconstructProcedureElement (const std::string &sProcedureFileName)
 Constructs a new ProcedureElement, if the file exists. Otherwise returns a nullptr. More...
 
StyledTextFile getFileContents (const std::string &sProcedureFileName)
 Reads the contents of the passed file and returns it as a std::vector. More...
 

Private Attributes

std::map< std::string, ProcedureElement * > mLibraryEntries
 

Detailed Description

This class manages all already read and possibly pre-parsed procedure files for easier and faster access.

Definition at line 33 of file procedurelibrary.hpp.

Constructor & Destructor Documentation

◆ ~ProcedureLibrary()

ProcedureLibrary::~ProcedureLibrary ( )

Destructor avoiding memory leaks. Releases the memory allocated for each ProcedureElement.

Definition at line 29 of file procedurelibrary.cpp.

References mLibraryEntries.

Member Function Documentation

◆ constructProcedureElement()

ProcedureElement * ProcedureLibrary::constructProcedureElement ( const std::string &  sProcedureFileName)
private

Constructs a new ProcedureElement, if the file exists. Otherwise returns a nullptr.

Parameters
sProcedureFileNameconst std::string&
Returns
ProcedureElement*

Definition at line 44 of file procedurelibrary.cpp.

References fileExists(), and getFileContents().

Referenced by getProcedureContents(), and updateLibrary().

Here is the call graph for this function:

◆ getFileContents()

StyledTextFile ProcedureLibrary::getFileContents ( const std::string &  sProcedureFileName)
private

Reads the contents of the passed file and returns it as a std::vector.

Parameters
sProcedureFileNameconst std::string&
Returns
StyledTextFile

Definition at line 63 of file procedurelibrary.cpp.

References SyntaxError::FILE_NOT_EXIST, StyledTextFile::getLinesCount(), and SyntaxError::invalid_position.

Referenced by constructProcedureElement().

Here is the call graph for this function:

◆ getProcedureContents()

ProcedureElement * ProcedureLibrary::getProcedureContents ( const std::string &  sProcedureFileName)

Returns the ProcedureElement pointer to the desired procedure file. It also creates the element, if it doesn't already exist.

Parameters
sProcedureFileNameconst std::string&
Returns
ProcedureElement*

Definition at line 84 of file procedurelibrary.cpp.

References constructProcedureElement(), SyntaxError::FILE_NOT_EXIST, SyntaxError::invalid_position, and mLibraryEntries.

Referenced by DependencyDialog::calculateDependencies(), Procedure::execute(), PackageDialog::followBranch(), DocumentationGenerator::followBranch(), Procedure::getInlined(), Procedure::isInlineable(), and DocumentationGenerator::parseDocumentation().

Here is the call graph for this function:

◆ updateLibrary()

void ProcedureLibrary::updateLibrary ( )

Perform an update, e.g. if a procedure was deleted.

Returns
void

Definition at line 107 of file procedurelibrary.cpp.

References constructProcedureElement(), and mLibraryEntries.

Referenced by NumeReTerminal::Entry().

Here is the call graph for this function:

Member Data Documentation

◆ mLibraryEntries

std::map<std::string, ProcedureElement*> ProcedureLibrary::mLibraryEntries
private

Definition at line 36 of file procedurelibrary.hpp.

Referenced by getProcedureContents(), updateLibrary(), and ~ProcedureLibrary().


The documentation for this class was generated from the following files: