blob: dcf310cc8f992a80968461a7d852a0121678689b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
// **********************************************************************
//
// Copyright (c) 2001
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************
#include <Ice/ProxyFactory.h>
#include <Ice/Instance.h>
#include <Ice/Proxy.h>
#include <Ice/ReferenceFactory.h>
#include <Ice/BasicStream.h>
using namespace std;
using namespace Ice;
using namespace IceInternal;
void IceInternal::incRef(ProxyFactory* p) { p->__incRef(); }
void IceInternal::decRef(ProxyFactory* p) { p->__decRef(); }
ObjectPrx
IceInternal::ProxyFactory::stringToProxy(const string& str) const
{
ReferencePtr ref = _instance->referenceFactory()->create(str);
return referenceToProxy(ref);
}
string
IceInternal::ProxyFactory::proxyToString(const ObjectPrx& proxy) const
{
return proxy->__reference()->toString();
}
ObjectPrx
IceInternal::ProxyFactory::streamToProxy(BasicStream* s) const
{
Identity ident;
ident.__read(s);
if (ident.name.empty())
{
return 0;
}
else
{
ReferencePtr ref = _instance->referenceFactory()->create(ident, s);
return referenceToProxy(ref);
}
}
void
IceInternal::ProxyFactory::proxyToStream(const ObjectPrx& proxy, BasicStream* s) const
{
if (proxy)
{
proxy->__reference()->identity.__write(s);
proxy->__reference()->streamWrite(s);
}
else
{
Identity ident;
ident.__write(s);
}
}
ObjectPrx
IceInternal::ProxyFactory::referenceToProxy(const ReferencePtr& ref) const
{
ObjectPrx proxy = new ::IceProxy::Ice::Object;
proxy->setup(ref);
return proxy;
}
IceInternal::ProxyFactory::ProxyFactory(const InstancePtr& instance) :
_instance(instance)
{
}
IceInternal::ProxyFactory::~ProxyFactory()
{
}
|