1 s.kodali 1.1 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 s.kodali 1.1 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //////////////////////////////////////////////////////////////////////////
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #include "ProviderManagerModule.h"
33
34 PEGASUS_NAMESPACE_BEGIN
35
36 ProviderManagerModule::ProviderManagerModule()
37 : DynamicLibrary(),
38 _createProviderManager(0)
39 {
40 }
41
42 ProviderManagerModule::ProviderManagerModule(
43 s.kodali 1.1 const ProviderManagerModule& module)
44 : DynamicLibrary(module),
45 _createProviderManager(module._createProviderManager)
46 {
47 }
48
49 ProviderManagerModule::ProviderManagerModule(
50 const String& fileName)
51 : DynamicLibrary(fileName),
52 _createProviderManager(0)
53 {
54 }
55
56 ProviderManagerModule::~ProviderManagerModule()
57 {
58 }
59
60 ProviderManagerModule& ProviderManagerModule::operator=(
61 const ProviderManagerModule& module)
62 {
63 if (this == &module)
64 s.kodali 1.1 {
65 return *this;
66 }
67
68 DynamicLibrary::operator=(module);
69
70 _createProviderManager = module._createProviderManager;
71
72 return *this;
73 }
74
75 Boolean ProviderManagerModule::load()
76 {
77 if (DynamicLibrary::load())
78 {
79 // export entry points
80 _createProviderManager = (CREATE_PROVIDER_MANAGER_FUNCTION)
81 getSymbol("PegasusCreateProviderManager");
82
83 if (_createProviderManager != 0)
84 {
85 s.kodali 1.1 return true;
86 }
87
88 DynamicLibrary::unload();
89 }
90
91 return false;
92 }
93
94 void ProviderManagerModule::unload()
95 {
96 DynamicLibrary::unload();
97 }
98
99 ProviderManager* ProviderManagerModule::getProviderManager(
100 const String& s) const
101 {
102 if (!isLoaded())
103 {
104 return 0;
105 }
106 s.kodali 1.1
107 return _createProviderManager(s);
108 }
109
110 PEGASUS_NAMESPACE_END
|