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

New Feature: zmqpp::message template #163

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

New Feature: zmqpp::message template #163

wants to merge 3 commits into from

Conversation

sunkin351
Copy link
Contributor

@sunkin351 sunkin351 commented May 23, 2016

The goal of this is to allow interchangability of the base container of zmqpp::message. Currently, the only supported containers are std::vector (Its original) and std::deque.

P.S. Sorry for making message.hpp 700+ lines long (XD) and exposing the implementation. I couldn't find a way to keep the member functions out of the header. If someone could figure that out, I would love to hear it.

P.S.S. This is my first time creating templates on a large scale, I would not be surprised if I made a mistake or two, but I did test it on both ends of compilation, to make sure it worked as before. (Windows only)

Edit: It also didn't affect compile time as much as I was expecting.

sunkin351 added 2 commits May 22, 2016 20:35
Renamed message to message_base and redefined message to `typedef
message_base<std::vector> message` to avoid breaking the current API.
This commit is to allow the ability of changing the container without
changing the base class. Currently, it only supports `std::vector` and
`std::deque`.
Solution: Clean up unwanted changes.
@sunkin351
Copy link
Contributor Author

sunkin351 commented May 23, 2016

This is in response to #162, I also forgot to mention that I added a clear() member function to the class, and that I did make sure I didn't break the current API or previous functionality by using typedef message_base<std::vector> message.

@Spartan322
Copy link

Spartan322 commented May 23, 2016

message_base would probably be better named like the std library way of doing templates with default behavior so basic_ which would make it basic_message which would become

typedef basic_message<std::vector> message;

@benjamg
Copy link
Member

benjamg commented Jun 14, 2016

This is giving me lots of errors locally, I will try and find time to check it and work through it but my free time for the next month is looking pretty bad sorry :(

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.

3 participants