zeromq / zmqpp

0mq 'highlevel' C++ bindings
http://zeromq.github.io/zmqpp
Mozilla Public License 2.0
438 stars 195 forks source link

New Feature: zmqpp::message template #163

Open sunkin351 opened 8 years ago

sunkin351 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

messagebase 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 commented 8 years ago

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 :(