Create an internal procedure library management. This functionality shall manage the code of the procedures so that only one file operation is necessary for each procedure, even if it is called recursively. Instead of opening the procedure files frpm each procedure instance, the content of the file shall be returned from the procedure library. This should be much faster, because file operations are quite slow, and also it will allow an arbitrary number of recursions (instead of the fixed number of file pointers, which are the current upper limit).
Analysis:
The procedure library is probably best implemented as a global object, which may be accessed from every procedure. The libraries central management can be something like a combination of mulitple maps, e.g.
std::map<std::string,std::map<int,std::string> >
where the outermost map references the procedure with its contents and the inner map connects the actual line in the file with its contents. The call to a procedure's contents should return an instance of the innermost map contained in an corresponding object, so that multiple lookups are avoided. The corresponding object shall store the iterator pointing at the current line, so that a simple increment will point to the next line.
It has to be decided, when an update of the already loaded procedures occures: this is either possible on idle times or event-driven, if one procedure has been updated.
Implementation:
The functionality was implemented as proposed by the analysis except of the way the content of the procedure is shared to the evaluation code. Now the code is managed centrally and the code only gets a pointer to the content of the procedure.
Documentation:
Not needed - internal feature.
Tests:
Occured issue was solved in revision #192. No further deviations detected. Functionality implemented successfully.
Anonymous
Diff:
Diff:
Diff:
Diff: