Files
commons/src/main.cpp
2022-04-23 03:04:41 +02:00

28 lines
724 B
C++

#include <iostream>
#include <boost/asio.hpp>
#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<Type>(i)) << "\n";
}
auto rectangle = std::make_unique<draw_pixel>();
void* void_ptr = reinterpret_cast<void*>(rectangle.get());
generic_message_base* rectangle_ptr = reinterpret_cast<generic_message_base*>(void_ptr);
std::cout << "Type: " << static_cast<int>(rectangle_ptr->get_type()) << "\n";
std::cout << "Size: " << static_cast<int>(rectangle_ptr->get_size()) << "\n";
auto* final_msg = get_object(rectangle_ptr->get_type(), rectangle_ptr);
return 0;
}