Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General changes to Stream classes #1496

Merged
merged 2 commits into from
Oct 21, 2018

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Oct 18, 2018

  • Move trivial code into header
  • Use member variable initialisers instead of setting defaults in constructor
  • Change int to unsigned/size_t as appropriate
  • Change appropriate methods to const (except where there's a risk of breaking other code)
  • Amend comments to clarify operation
  • Mark inherited methods with virtual (if not already)
  • Add ReadWriteStream::write(uint8_t) implementation to call write(const char*, size_t) method by default

@mikee47 mikee47 force-pushed the fix/Stream_improvements branch from dde9e56 to 4d88b92 Compare October 18, 2018 15:18
@slaff slaff added this to the 3.7.0 milestone Oct 20, 2018
/** @brief Write chars to stream
* @param buffer Pointer to buffer to write to the stream
* @param size Quantity of chars to write
* @retval size_t Quantity of chars written to stream
*/
virtual size_t write(const uint8_t* buffer, size_t size);

virtual bool isFinished();
/** @todo is this behaviour consistent with DataSourceStream ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the todo comment and leave the return value as it is for now.

* Move trivial code into header
* Use member variable initialisers instead of setting defaults in constructor
* Change int to unsigned/size_t as appropriate
* Change appropriate methods to const (except where there's a risk of breaking other code)
* Amend comments to clarify operation
* Mark inherited methods with virtual (if not already)
* Add ReadWriteStream::write(uint8_t) implementation to call write(const char*, size_t) method by default
@mikee47 mikee47 force-pushed the fix/Stream_improvements branch from c30bf51 to 15f7622 Compare October 21, 2018 17:03
@slaff slaff removed the 3 - Review label Oct 21, 2018
@slaff slaff merged commit 701433a into SmingHub:develop Oct 21, 2018
@mikee47 mikee47 deleted the fix/Stream_improvements branch October 21, 2018 19:57
@slaff slaff mentioned this pull request Oct 23, 2018
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants