1 // Copyright (C) 2019 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //      http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "AidlClient.h"
16 #include "ClientInterface.h"
17 
18 namespace android {
19 namespace automotive {
20 namespace computepipe {
21 namespace runner {
22 namespace client_interface {
23 
24 using aidl_client::AidlClient;
25 
26 namespace {
27 
buildAidlClient(const proto::Options & options,const std::shared_ptr<ClientEngineInterface> & engine)28 std::unique_ptr<AidlClient> buildAidlClient(const proto::Options& options,
29                                             const std::shared_ptr<ClientEngineInterface>& engine) {
30     return std::make_unique<AidlClient>(options, engine);
31 }
32 
33 }  // namespace
34 
createClientInterface(std::string iface,const proto::Options graphOptions,const std::shared_ptr<ClientEngineInterface> & engine)35 std::unique_ptr<ClientInterface> ClientInterfaceFactory::createClientInterface(
36     std::string iface, const proto::Options graphOptions,
37     const std::shared_ptr<ClientEngineInterface>& engine) {
38     if (iface == "aidl") {
39         return buildAidlClient(graphOptions, engine);
40     }
41     return nullptr;
42 }
43 
44 }  // namespace client_interface
45 }  // namespace runner
46 }  // namespace computepipe
47 }  // namespace automotive
48 }  // namespace android
49