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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
// **********************************************************************
//
// Copyright (c) 2001
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************
#include <Ice/Object.h>
#include <Ice/Incoming.h>
using namespace std;
using namespace Ice;
using namespace IceInternal;
void IceInternal::incRef(Object* p) { p->__incRef(); }
void IceInternal::decRef(Object* p) { p->__decRef(); }
Ice::LocationForward::LocationForward(const LocationForward& p) :
_prx(p._prx)
{
}
Ice::LocationForward::LocationForward(const ObjectPrx& p) :
_prx(p)
{
}
bool
Ice::Object::_isA(const string& s)
{
return s == "::Ice::Object";
}
void
Ice::Object::_ping()
{
// Nothing to do.
}
DispatchStatus
Ice::Object::____isA(Incoming& __in)
{
BasicStream* __is = __in.is();
BasicStream* __os = __in.os();
string s;
__is->read(s);
bool __ret = _isA(s);
__os->write(__ret);
return DispatchOK;
}
DispatchStatus
Ice::Object::____ping(Incoming&)
{
_ping();
return DispatchOK;
}
const char* Ice::Object::__all[] =
{
"_isA"
"_ping"
};
DispatchStatus
Ice::Object::__dispatch(Incoming& in, const string& s)
{
const char** b = __all;
const char** e = __all + sizeof(__all) / sizeof(const char*);
pair<const char**, const char**> r = equal_range(b, e, s);
if (r.first == r.second)
{
return DispatchOperationNotExist;
}
switch (r.first - __all)
{
case 0:
{
return ____isA(in);
}
case 1:
{
return ____ping(in);
}
}
assert(false);
return DispatchOperationNotExist;
}
bool
Ice::Object::__isMutating(const std::string& s)
{
//
// None of the Ice::Object operations accessible via __dispatch()
// is mutating.
//
return false;
}
void
Ice::Object::_addFacet(const ObjectPtr& facet, const string& name)
{
JTCSyncT<JTCMutex> sync(_activeFacetMapMutex);
_activeFacetMapHint = _activeFacetMap.insert(_activeFacetMapHint, make_pair(name, facet));
}
void
Ice::Object::_removeFacet(const string& name)
{
JTCSyncT<JTCMutex> sync(_activeFacetMapMutex);
map<string, ObjectPtr>::iterator p = _activeFacetMap.end();
if (_activeFacetMapHint != _activeFacetMap.end())
{
if (_activeFacetMapHint->first == name)
{
p = _activeFacetMapHint;
}
}
if (p == _activeFacetMap.end())
{
p = _activeFacetMap.find(name);
}
if (p != _activeFacetMap.end())
{
_activeFacetMap.erase(p);
_activeFacetMapHint = _activeFacetMap.end();
}
}
void
Ice::Object::_removeAllFacets(const string& name)
{
JTCSyncT<JTCMutex> sync(_activeFacetMapMutex);
_activeFacetMap.clear();
_activeFacetMapHint = _activeFacetMap.end();
}
ObjectPtr
Ice::Object::_findFacet(const string& name)
{
JTCSyncT<JTCMutex> sync(_activeFacetMapMutex);
map<string, ObjectPtr>::iterator p = _activeFacetMap.end();
if (_activeFacetMapHint != _activeFacetMap.end())
{
if (_activeFacetMapHint->first == name)
{
p = _activeFacetMapHint;
}
}
if (p == _activeFacetMap.end())
{
p = _activeFacetMap.find(name);
}
if (p != _activeFacetMap.end())
{
_activeFacetMapHint = p;
return p->second;
}
else
{
return 0;
}
}
|