Circular Buffer Implementation #6
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Circular Buffer is implemented with compile time fixed size and static memory allocation.
Supports Generic Data type,as template is used.
It has two put data behavior,
-Override
-Discard
The function 'PushBack' has two arguments:
-data
-override flag(which is set to true by Default).
If the user wants to override old data, when the circular buffer is full, PushBack shall be called with 'data' as argument to be pushed back.
If the user wants to discard new data, when the circular buffer is full, PushBack shall be called with two arguments 'data' and 'false'.
Test cases:
Google Test framework is used for test cases.
Test cases are implemented as Value Parameterised test cases.
GTest chooses the given values and automatically forms the test cases and executes them.
TYPED_TEST cannot be implemented, as GTest shows valid compile errors as keyword 'auto' is not supported.
Test cases are written to support all int,long data types,eventhough the Circular buffer supports all generic data types.
There is an using directive to change 'Type' in testcases.