29 #ifndef TRM_SERVER_MESSAGE_PROCESSOR_H_
30 #define TRM_SERVER_MESSAGE_PROCESSOR_H_
38 #include "trm/TunerReservation.h"
39 #include "trm/MessageProcessor.h"
40 #include "trm/AsyncNotification.h"
43 #include "Executors.h"
44 #include "Connection.h"
53 connection(connection), clientId(clientId) {};
56 void process(
const MsgT &msg) {
61 std::vector<uint8_t> out(Header::kHeaderLength, 0);
62 JsonEncoder().encode(exec.getResponse(), out);
64 std::cout << (
const char *)(&out[Header::kHeaderLength]) <<
"\r\n";
68 std::vector<uint8_t> headerBytes;
69 Header header(Response, clientId, out.size() - Header::kHeaderLength);
70 header.serialize(headerBytes);
71 memcpy(&out[0], &headerBytes[0], Header::kHeaderLength);
72 connection->
send(out);
78 void operator() (
const ReserveTuner &msg);
79 void operator() (
const ReleaseTunerReservation &msg);
80 void operator() (
const ValidateTunerReservation &msg);
81 void operator() (
const CancelRecording &msg);
82 void operator() (
const CancelRecordingResponse &msg);
83 void operator() (
const GetAllTunerIds &msg);
84 void operator() (
const GetAllTunerStates &msg);
85 void operator() (
const GetAllReservations &msg);
86 void operator() (
const GetVersion &msg);
87 void operator() (
const CancelLive &msg);
88 void operator() (
const CancelLiveResponse &msg);
89 void operator() (
const UpdateTunerActivityStatus &msg);