Menu

#216 Create an internal procedure library

v1.1.x
closed
None
v1.1.0
New Functionality
2017-08-25
2017-07-05
Erik Hänel
No

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.

Discussion

  • Erik Hänel

    Erik Hänel - 2017-07-05
    • status: open --> accepted
     
  • Erik Hänel

    Erik Hänel - 2017-07-05
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1,9 @@
     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:**
    +
    +**Implementation:**
    +
    +**Documentation:**
    +
    +**Tests:**
    
    • status: accepted --> analyzing
     
  • Erik Hänel

    Erik Hänel - 2017-07-05
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,12 @@
     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:**
    
    • status: analyzing --> implementing
     
  • Erik Hänel

    Erik Hänel - 2017-07-06
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -9,7 +9,9 @@
     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:**
    
    • status: implementing --> testing
     
  • Erik Hänel

    Erik Hänel - 2017-08-25
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -15,3 +15,4 @@
     Not needed - internal feature.
    
     **Tests:**
    +Occured issue was solved in revision #192. No further deviations detected. Functionality implemented successfully.
    
    • status: testing --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB