WvStreams
Main Page
Modules
Classes
Files
File List
File Members
xplc
new.cc
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
*
3
* XPLC - Cross-Platform Lightweight Components
4
* Copyright (C) 2002-2003, Pierre Phaneuf
5
* Copyright (C) 2002, Net Integration Technologies, Inc.
6
*
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public License
9
* as published by the Free Software Foundation; either version 2.1 of
10
* the License, or (at your option) any later version.
11
*
12
* This library is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
16
*
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20
* USA
21
*/
22
23
#include <xplc/IFactory.h>
24
#include <xplc/core.h>
25
#include <
xplc/utils.h
>
26
#include "new.h"
27
28
UUID_MAP_BEGIN
(
NewMoniker
)
29
UUID_MAP_ENTRY
(
IObject
)
30
UUID_MAP_ENTRY
(
IMoniker
)
31
UUID_MAP_END
32
33
NewMoniker
::~
NewMoniker
() {
34
}
35
36
IObject
*
NewMoniker::resolve
(
const
char
* aName) {
37
IServiceManager
* servmgr;
38
IMoniker
* monikers;
39
IFactory
* factory;
40
IObject
* obj = 0;
41
42
servmgr = XPLC_getServiceManager();
43
if
(servmgr) {
44
monikers = mutate<IMoniker>(servmgr->
getObject
(XPLC_monikers));
45
46
if
(monikers) {
47
factory = mutate<IFactory>(monikers->
resolve
(aName));
48
49
if
(factory) {
50
obj = factory->
createObject
();
51
factory->
release
();
52
}
53
54
monikers->
release
();
55
}
56
57
servmgr->
release
();
58
}
59
60
return
obj;
61
}
62
Generated on Thu Oct 31 2013 23:17:03 for WvStreams by
1.8.4