Menu

#76 Change meaning of "clear string()"

v1.0.x
closed
None
v1.0.9
Change Request
2016-07-11
2016-07-05
Erik Hänel
No

The command sequence clear string() should have a similar effect to clear cache(): remove all string elements and reset the string() object. Add another command for the current meaning, e.g.

delete string(i)
remove string(i)

Analysis:
To achieve this change request, implement a new inline function like removeStringElements(unsigned int) and copy the code from clearStringElements() there. clearStringElements() shall have the following content:

inline bool clearStringElements()
{
    if (sStrings.size())
        sStrings.clear();
    return;
}

Finally, implement a UI to the old and the new function. The command shall be remove string(i).

Implementation:
Change was implemented as proposed by the analysis. Because delete string() already existed, the command was merged and changed to delete string(i). Implementation tests were successful.

Tests:
Tests were passed successfully. Remark: syntax might be a bit difficult to remember/to use.

Discussion

  • Erik Hänel

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

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

    Diff:

    --- old
    +++ new
    @@ -3,3 +3,9 @@
     delete string(i)
     remove string(i)
     ~~~
    +
    +**Analysis:**
    +
    +**Implementation:**
    +
    +**Tests:**
    
    • status: accepted --> analyzing
     
  • Erik Hänel

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

    Diff:

    --- old
    +++ new
    @@ -5,6 +5,16 @@
     ~~~
    
     **Analysis:**
    +To achieve this change request, implement a new inline function like `removeStringElements(unsigned int)` and copy the code from `clearStringElements()` there. `clearStringElements()` shall have the following content:
    +~~~C
    +inline bool clearStringElements()
    +{
    
    +    if (sStrings.size())
    +        sStrings.clear();
    +    return;
    +}
    +~~~
    +Finally, implement a UI to the old and the new function. The command shall be `remove string(i)`.
    
     **Implementation:**
    
    • status: analyzing --> implementing
     
  • Erik Hänel

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

    Diff:

    --- old
    +++ new
    @@ -17,5 +17,6 @@
     Finally, implement a UI to the old and the new function. The command shall be `remove string(i)`.
    
     **Implementation:**
    +Change was implemented as proposed by the analysis. Because `delete string()` already existed, the command was merged and changed to `delete string(i)`. Implementation tests were successful.
    
     **Tests:**
    
    • status: implementing --> testing
     
  • Erik Hänel

    Erik Hänel - 2016-07-11
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -20,3 +20,4 @@
     Change was implemented as proposed by the analysis. Because `delete string()` already existed, the command was merged and changed to `delete string(i)`. Implementation tests were successful.
    
     **Tests:**
    +Tests were passed successfully. *Remark:* syntax might be a bit difficult to remember/to use.
    
    • status: testing --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB