xref: /aosp_15_r20/external/google-fruit/examples/server/server.h (revision a65addddcf69f38db5b288d787b6b7571a57bb8f)
1*a65addddSAndroid Build Coastguard Worker /*
2*a65addddSAndroid Build Coastguard Worker  * Copyright 2014 Google Inc. All rights reserved.
3*a65addddSAndroid Build Coastguard Worker  *
4*a65addddSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*a65addddSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*a65addddSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*a65addddSAndroid Build Coastguard Worker  *
8*a65addddSAndroid Build Coastguard Worker  *     http://www.apache.org/licenses/LICENSE-2.0
9*a65addddSAndroid Build Coastguard Worker  *
10*a65addddSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*a65addddSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*a65addddSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*a65addddSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*a65addddSAndroid Build Coastguard Worker  * limitations under the License.
15*a65addddSAndroid Build Coastguard Worker  */
16*a65addddSAndroid Build Coastguard Worker 
17*a65addddSAndroid Build Coastguard Worker #ifndef SERVER_H
18*a65addddSAndroid Build Coastguard Worker #define SERVER_H
19*a65addddSAndroid Build Coastguard Worker 
20*a65addddSAndroid Build Coastguard Worker #include "request.h"
21*a65addddSAndroid Build Coastguard Worker #include "request_dispatcher.h"
22*a65addddSAndroid Build Coastguard Worker #include "server_context.h"
23*a65addddSAndroid Build Coastguard Worker 
24*a65addddSAndroid Build Coastguard Worker #include <fruit/fruit.h>
25*a65addddSAndroid Build Coastguard Worker #include <string>
26*a65addddSAndroid Build Coastguard Worker 
27*a65addddSAndroid Build Coastguard Worker class Server {
28*a65addddSAndroid Build Coastguard Worker public:
29*a65addddSAndroid Build Coastguard Worker   virtual void run(fruit::Component<fruit::Required<Request, ServerContext>, RequestDispatcher> (
30*a65addddSAndroid Build Coastguard Worker       *getrequestDispatcherComponent)()) = 0;
31*a65addddSAndroid Build Coastguard Worker };
32*a65addddSAndroid Build Coastguard Worker 
33*a65addddSAndroid Build Coastguard Worker fruit::Component<Server> getServerComponent();
34*a65addddSAndroid Build Coastguard Worker 
35*a65addddSAndroid Build Coastguard Worker #endif // SERVER_H
36