3.0
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 | |
---|
14 | BCGatewayManager* BCGatewayManager::instance_=0; |
---|
15 | BCGatewayManager* BCGatewayManager::instance(){ |
---|
16 | return instance_ ? instance_ : (instance_ = new BCGatewayManager); |
---|
17 | } |
---|
18 | |
---|
19 | |
---|
20 | void 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 | |
---|
28 | IGateway* BCGatewayManager::getGateway(const QString& gatewayName) { |
---|
29 | return gatewayList_[gatewayName]; |
---|
30 | } |
---|
31 | |
---|
32 | QList<IGateway*> BCGatewayManager::getGatewayList() { |
---|
33 | return gatewayList_.values(); |
---|
34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.