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

This class contains the pre-parsed contents of a single procedure file. More...

#include <procedureelement.hpp>

Collaboration diagram for ProcedureElement:

Public Member Functions

 ProcedureElement (const StyledTextFile &procedureContents, const std::string &sFolderPath)
 Procedure element constructor. This class is always heap allocated. More...
 
 ~ProcedureElement ()
 Destructor. Cleares the dependency list. More...
 
std::pair< int, ProcedureCommandLinegetFirstLine ()
 This function returns the first line of the stored file. More...
 
std::pair< int, ProcedureCommandLinegetCurrentLine (int currentLine)
 This function returns the selected line of the stored file. This member function will be used in combination with the the member function "gotoProcedure()". More...
 
std::pair< int, ProcedureCommandLinegetNextLine (int currentline)
 This member function returns the line after the current selected line. This is probably not the same as nCurrentLine++, because line comments and empty lines were omitted during the pre-parsing step. More...
 
int gotoProcedure (const std::string &sProcedureName)
 This member function returns the line of the stored file, where the desired procedure may be found or -1 if the procedure is not found in the current file. More...
 
std::string getFileName () const
 
bool isLastLine (int currentline)
 This member function determines, whether the current line is the last line of the stored procedure file. More...
 
void setByteCode (int _nByteCode, int nCurrentLine)
 This member function can be used to store the created byte code in the current procedure command line. More...
 
DependenciesgetDependencies ()
 This member function returns the first-level dependencies of the current procedure file. The dependencies are only calculated once and refreshed, if the current procedure has been saved. More...
 

Private Member Functions

void cleanCurrentLine (std::string &sProcCommandLine, const std::string &sCurrentCommand, const std::string &sFilePath)
 This member function does the hard work on cleaning the current procedure command line. This includes removing tabulators, definition operators and replacing the "<this>" path placeholder. More...
 

Private Attributes

std::vector< std::pair< int, ProcedureCommandLine > > mProcedureContents
 
std::map< std::string, int > mProcedureList
 
std::string sFileName
 
Dependenciesm_dependencies
 

Detailed Description

This class contains the pre-parsed contents of a single procedure file.

Definition at line 36 of file procedureelement.hpp.

Constructor & Destructor Documentation

◆ ProcedureElement()

◆ ~ProcedureElement()

ProcedureElement::~ProcedureElement ( )

Destructor. Cleares the dependency list.

Definition at line 289 of file procedureelement.cpp.

References m_dependencies.

Member Function Documentation

◆ cleanCurrentLine()

void ProcedureElement::cleanCurrentLine ( std::string &  sProcCommandLine,
const std::string &  sCurrentCommand,
const std::string &  sFolderPath 
)
private

This member function does the hard work on cleaning the current procedure command line. This includes removing tabulators, definition operators and replacing the "<this>" path placeholder.

Parameters
sProcCommandLinestd::string&
sCurrentCommandconst std::string&
sFolderPathconst std::string&
Returns
void

Definition at line 309 of file procedureelement.cpp.

References findCommand(), and StripSpaces().

Referenced by ProcedureElement().

Here is the call graph for this function:

◆ getCurrentLine()

std::pair< int, ProcedureCommandLine > ProcedureElement::getCurrentLine ( int  nCurrentLine)

This function returns the selected line of the stored file. This member function will be used in combination with the the member function "gotoProcedure()".

Parameters
nCurrentLineint
Returns
std::pair<int, ProcedureCommandLine>

Definition at line 369 of file procedureelement.cpp.

References mProcedureContents.

Referenced by Procedure::execute(), Procedure::getInlined(), Dependencies::getProcedureDependencies(), and Procedure::isInlineable().

◆ getDependencies()

Dependencies * ProcedureElement::getDependencies ( )

This member function returns the first-level dependencies of the current procedure file. The dependencies are only calculated once and refreshed, if the current procedure has been saved.

Returns
Dependencies*

Definition at line 495 of file procedureelement.cpp.

References m_dependencies.

Referenced by DependencyDialog::calculateDependencies(), PackageDialog::followBranch(), DocumentationGenerator::followBranch(), and DocumentationGenerator::parseDocumentation().

◆ getFileName()

std::string ProcedureElement::getFileName ( ) const
inline

Definition at line 54 of file procedureelement.hpp.

References sFileName.

Referenced by Dependencies::Dependencies(), and Dependencies::getProcedureDependencies().

◆ getFirstLine()

std::pair< int, ProcedureCommandLine > ProcedureElement::getFirstLine ( )

This function returns the first line of the stored file.

Returns
std::pair<int, ProcedureCommandLine>

Definition at line 353 of file procedureelement.cpp.

References mProcedureContents.

Referenced by Dependencies::walk().

◆ getNextLine()

std::pair< int, ProcedureCommandLine > ProcedureElement::getNextLine ( int  nCurrentLine)

This member function returns the line after the current selected line. This is probably not the same as nCurrentLine++, because line comments and empty lines were omitted during the pre-parsing step.

Parameters
nCurrentLineint
Returns
std::pair<int, ProcedureCommandLine>

Definition at line 397 of file procedureelement.cpp.

References mProcedureContents.

Referenced by Procedure::execute(), Procedure::getInlined(), Dependencies::getProcedureDependencies(), and Procedure::isInlineable().

◆ gotoProcedure()

int ProcedureElement::gotoProcedure ( const std::string &  sProcedureName)

This member function returns the line of the stored file, where the desired procedure may be found or -1 if the procedure is not found in the current file.

Parameters
sProcedureNameconst std::string&
Returns
int
Remarks
The procedure name has to be passed with the dollar sign but without the parentheses.

Definition at line 446 of file procedureelement.cpp.

References mProcedureList.

Referenced by Procedure::execute(), Procedure::getInlined(), and Procedure::isInlineable().

◆ isLastLine()

bool ProcedureElement::isLastLine ( int  nCurrentLine)

This member function determines, whether the current line is the last line of the stored procedure file.

Parameters
nCurrentLineint
Returns
bool

Definition at line 423 of file procedureelement.cpp.

References mProcedureContents.

Referenced by Procedure::execute(), Procedure::getInlined(), Dependencies::getProcedureDependencies(), Procedure::isInlineable(), and Dependencies::walk().

◆ setByteCode()

void ProcedureElement::setByteCode ( int  _nByteCode,
int  nCurrentLine 
)

This member function can be used to store the created byte code in the current procedure command line.

Note that it is not reasonable to store the byte code in the already obtained procedure command line, because this object will be destroyed after its evaluation.

Parameters
_nByteCodeint
nCurrentLineint
Returns
void

Definition at line 472 of file procedureelement.cpp.

References mProcedureContents.

Referenced by Procedure::execute().

Member Data Documentation

◆ m_dependencies

Dependencies* ProcedureElement::m_dependencies
private

Definition at line 42 of file procedureelement.hpp.

Referenced by getDependencies(), and ~ProcedureElement().

◆ mProcedureContents

std::vector<std::pair<int, ProcedureCommandLine> > ProcedureElement::mProcedureContents
private

◆ mProcedureList

std::map<std::string, int> ProcedureElement::mProcedureList
private

Definition at line 40 of file procedureelement.hpp.

Referenced by gotoProcedure(), and ProcedureElement().

◆ sFileName

std::string ProcedureElement::sFileName
private

Definition at line 41 of file procedureelement.hpp.

Referenced by getFileName(), and ProcedureElement().


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