#include #include #include "protocol.hpp" int main() { using namespace commons::protocol; auto draw_msg = draw_rectangle{}; for(int i = 0; i < 3; ++i) { std::cout << "Size of " << i << " is " << get_size(static_cast(i)) << "\n"; } auto rectangle = std::make_unique(); void* void_ptr = reinterpret_cast(rectangle.get()); generic_message_base* rectangle_ptr = reinterpret_cast(void_ptr); std::cout << "Type: " << static_cast(rectangle_ptr->get_type()) << "\n"; std::cout << "Size: " << static_cast(rectangle_ptr->get_size()) << "\n"; auto* final_msg = get_object(rectangle_ptr->get_type(), rectangle_ptr); return 0; }