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

Char Stream Request - Optimized for high rate #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EdDev
Copy link
Owner

@EdDev EdDev commented Nov 15, 2014

Receive a stream of characters (ASCII), accumulate them and
provide the means to output them in an acceding sorted manner.

Limitations:

  • Sorted based on the ASCII table, no special care has been done to handle upper and lower characters.
  • It can accumulate between 2^(sizeof(int)) to 256 * (2^(sizeof(int))) characters.

Note: It is up to the application that uses this module to specify how many characters to recv
until a print is performed, followed by a clear to reset the data.

Receive a stream of characters (ASCII), accumulate them and
provide the means to output them in an acceding sorted manner.

Limitations:
- Sorted based on the ASCII table, no special care has been done to handle upper and lower characters.
- It can accumulate between 2^(sizeof(int)) to 256 * (2^(sizeof(int))) characters.

Note: It is up to the application that uses this module to specify how many characters to recv
      until a print is performed, followed by a clear to reset the data.

CharStreamReq::CharStreamReq()
{
this->max_num_of_unique_chars = (unsigned char)~0 + 1;
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is constant, therefore can be a member of the class without the need to use new/delete in the const/destr.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Use std::numeric_limits::max() instead of this trick.
(From #include )

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.

1 participant