RDK Documentation (Open Sourced RDK Components)
MessageProcessor.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 
21 /**
22 * @defgroup trm
23 * @{
24 * @defgroup common
25 * @{
26 **/
27 
28 
29 #ifndef TRM_MESSAGE_PROCESSOR_H_
30 #define TRM_MESSAGE_PROCESSOR_H_
31 
32 #include <iostream>
33 
34 #include "TRM.h"
35 #include "Messages.h"
36 
37 TRM_BEGIN_NAMESPACE
38 
40 {
41 public:
42  MessageProcessor(void) {}
43 
44  virtual void operator() (const ReserveTuner &msg) {process(msg);}
45  virtual void operator() (const ReserveTunerResponse &msg) {process(msg);}
46  virtual void operator() (const ReleaseTunerReservation &msg) {process(msg);}
47  virtual void operator() (const ReleaseTunerReservationResponse &msg) {process(msg);}
48  virtual void operator() (const ValidateTunerReservation &msg) {process(msg);}
49  virtual void operator() (const ValidateTunerReservationResponse &msg){process(msg);}
50  virtual void operator() (const CancelRecording &msg) {process(msg);}
51  virtual void operator() (const CancelRecordingResponse &msg) {process(msg);}
52  virtual void operator() (const CancelLive &msg) {process(msg);}
53  virtual void operator() (const CancelLiveResponse &msg) {process(msg);}
54  virtual void operator() (const GetAllTunerIds &msg) {process(msg);}
55  virtual void operator() (const GetAllTunerIdsResponse &msg) {process(msg);}
56  virtual void operator() (const GetAllTunerStates &msg) {process(msg);}
57  virtual void operator() (const GetAllTunerStatesResponse &msg) {process(msg);}
58  virtual void operator() (const GetAllReservations &msg) {process(msg);}
59  virtual void operator() (const GetAllReservationsResponse &msg) {process(msg);}
60  virtual void operator() (const GetAllConnectedDeviceIdsResponse &msg){process(msg);}
61  virtual void operator() (const GetVersion &msg) {process(msg);}
62  virtual void operator() (const GetVersionResponse &msg) {process(msg);}
63  virtual void operator() (const NotifyTunerReservationUpdate &msg) {process(msg);}
64  virtual void operator() (const NotifyTunerReservationRelease &msg) {process(msg);}
65  virtual void operator() (const NotifyTunerReservationConflicts &msg) {process(msg);}
66  virtual void operator() (const NotifyTunerStatesUpdate &msg) {process(msg);}
67  virtual void operator() (const NotifyTunerPretune &msg) {process(msg);}
68  virtual void operator() (const NotifyClientConnectionEvent &msg) {process(msg);}
69  virtual void operator() (const GetTRMConnectionEvents &msg) {process(msg);}
70  virtual void operator() (const UpdateTunerActivityStatus &msg) {process(msg);}
71 
72 
73  virtual ~MessageProcessor(void) {}
74 
75 private:
76 
77  template<class MsgT>
78  void process(const MsgT &msg) {
79  /* Default Implementation */
80  msg.print();
81  }
82 
83 };
84 
85 TRM_END_NAMESPACE
86 #endif
87 
88 
89 /** @} */
90 /** @} */
TRM::ValidateTunerReservation
Implements the message format for client to validate an existing tuner reservation.
Definition: Messages.h:1168
TRM::ValidateTunerReservationResponse
Implements the response message payload for Tuner reservation validation requests.
Definition: Messages.h:1118
TRM::CancelRecording
Implements a message to cancel the recording.
Definition: Messages.h:1241
TRM::MessageProcessor
Definition: MessageProcessor.h:39
TRM::ReleaseTunerReservation
Implements the message payload for releasing tuner reservation.
Definition: Messages.h:1094
TRM::ReserveTuner
Class implementing a Tuner reservation request, the client uses this message to request,...
Definition: Messages.h:972
TRM::UpdateTunerActivityStatus
Definition: Messages.h:2246
TRM::GetAllConnectedDeviceIdsResponse
Definition: Messages.h:2178
TRM::NotifyClientConnectionEvent
Definition: Messages.h:2099
TRM::CancelRecordingResponse
Implements payload for a response message against cancel recording request.
Definition: Messages.h:1194
TRM::NotifyTunerPretune
Implements a Notification message when a pre tune has performed.
Definition: Messages.h:2076
TRM::ReleaseTunerReservationResponse
Class implementing the response message payload for releasing Tuner reservation.
Definition: Messages.h:1046
TRM::GetAllTunerStates
Implements a request message for getting the state of all tuners in the system.
Definition: Messages.h:1668
TRM::CancelLive
Implements a message to cancel the live streaming.
Definition: Messages.h:1334
TRM::NotifyTunerReservationConflicts
Class for implementing asynchronous notification from TRM to the owner of a token that a tuner reserv...
Definition: Messages.h:1945
TRM::ReserveTunerResponse
Class implementing the response message to a ReserveTuner request.
Definition: Messages.h:858
Messages.h
TRM::GetTRMConnectionEvents
Definition: Messages.h:2139
TRM::GetAllTunerIdsResponse
Implements the response message payload against a Tuner Id request.
Definition: Messages.h:1378
TRM::GetAllTunerStatesResponse
Implements the response payload against a Get tuner state request.
Definition: Messages.h:1563
TRM::GetAllReservationsResponse
Implements the response message for the request to get All tuner reservation details.
Definition: Messages.h:1692
TRM::NotifyTunerStatesUpdate
Class for implementing an asynchronous Notification from TRM whenever a tuner has changed it state.
Definition: Messages.h:2037
TRM::GetAllTunerIds
Implements the message payload format for requesting the system allocated Unique Id of tuner....
Definition: Messages.h:1439
TRM::GetAllReservations
Implements a request message to get reservation detail of all the tuners that are valid at that time.
Definition: Messages.h:1727
TRM::CancelLiveResponse
Implements payload for a response message against cancel live streaming request.
Definition: Messages.h:1265
TRM::NotifyTunerReservationUpdate
Implements the asynchronous Notification from TRM whenever a reservation has changed its usage by its...
Definition: Messages.h:1892
TRM::NotifyTunerReservationRelease
Class to implement asynchronous Notification from TRM to the owner of a token that its tuner reservat...
Definition: Messages.h:1845
TRM::GetVersion
Implements a message to request for getting TRM server version.
Definition: Messages.h:1820
TRM::GetVersionResponse
Implements the response message for the queries that request TRM server version.
Definition: Messages.h:1783