forked from sixonionpotatoes/commons
prototyping protocol stuff
This commit is contained in:
24
src/main.cpp
24
src/main.cpp
@@ -1,15 +1,27 @@
|
||||
#include <iostream>
|
||||
#include <boost/asio.hpp>
|
||||
#include "crow.h"
|
||||
|
||||
#include "protocol.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
crow::SimpleApp app;
|
||||
using namespace commons::protocol;
|
||||
auto draw_msg = draw_rectangle{};
|
||||
|
||||
CROW_ROUTE(app, "/")([]() {
|
||||
return "Hello World";
|
||||
});
|
||||
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);
|
||||
|
||||
app.port(18080).run();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user