source: SMSSender/src/business/BCGatewayManager.cpp @ 40:c3db2b42695b

3.0
Last change on this file since 40:c3db2b42695b was 40:c3db2b42695b, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
File size: 815 bytes
Line 
1/*
2 * BCGatewayManager.cpp
3 *
4 *  Created on: Aug 30, 2009
5 *      Author: saemy
6 */
7
8#include "BCGatewayManager.h"
9
10#include <QDir>
11
12#include "BCLibraryLoader.h"
13
14BCGatewayManager* BCGatewayManager::instance_=0;
15BCGatewayManager* BCGatewayManager::instance(){
16    return instance_ ? instance_ : (instance_ = new BCGatewayManager);
17}
18
19
20void BCGatewayManager::loadGatewaysFromLibraryPath(const QDir& libraryPath) {
21    BCLibraryLoader::instance()->loadLibraries(libraryPath);
22
23    foreach (IGateway* gateway, BCLibraryLoader::instance()->gateways()) {
24        gatewayList_.insert(gateway->name(), gateway);
25    }
26}
27
28IGateway* BCGatewayManager::getGateway(const QString& gatewayName) {
29    return gatewayList_[gatewayName];
30}
31
32QList<IGateway*> BCGatewayManager::getGatewayList() {
33    return gatewayList_.values();
34}
Note: See TracBrowser for help on using the repository browser.