File indexing completed on 2024-05-12 05:51:05
0001 /* 0002 SPDX-FileCopyrightText: 2022 Héctor Mesa Jiménez <wmj.py@gmx.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "bus.h" 0008 #include "processbus.h" 0009 #include "socketbus.h" 0010 #include "socketprocessbus.h" 0011 0012 #include "settings.h" 0013 0014 #include "bus_selector.h" 0015 0016 namespace dap 0017 { 0018 Bus *createBus(const settings::BusSettings &configuration) 0019 { 0020 const bool has_command = configuration.hasCommand(); 0021 const bool has_connection = configuration.hasConnection(); 0022 0023 if (has_command && has_connection) { 0024 return new SocketProcessBus(); 0025 } 0026 0027 if (has_command) { 0028 return new ProcessBus(); 0029 } 0030 0031 if (has_connection) { 0032 return new SocketBus(); 0033 } 0034 0035 return nullptr; 0036 } 0037 0038 }