summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/ObjectFactory.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-09-14 15:30:12 -0700
committerMark Spruiell <mes@zeroc.com>2012-09-14 15:30:12 -0700
commitc912d30d47799bbba77d0f2532704d8aaba12a4a (patch)
tree8611fdb0b73a9a78f7c319ca4bb08f1f9d2e9cd0 /py/modules/IcePy/ObjectFactory.cpp
parentFixed optional test issues (diff)
downloadice-c912d30d47799bbba77d0f2532704d8aaba12a4a.tar.bz2
ice-c912d30d47799bbba77d0f2532704d8aaba12a4a.tar.xz
ice-c912d30d47799bbba77d0f2532704d8aaba12a4a.zip
Python support for optionals
Diffstat (limited to 'py/modules/IcePy/ObjectFactory.cpp')
-rw-r--r--py/modules/IcePy/ObjectFactory.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/py/modules/IcePy/ObjectFactory.cpp b/py/modules/IcePy/ObjectFactory.cpp
index 4af8965349a..336ca9dc902 100644
--- a/py/modules/IcePy/ObjectFactory.cpp
+++ b/py/modules/IcePy/ObjectFactory.cpp
@@ -49,7 +49,20 @@ IcePy::ObjectFactory::create(const string& id)
//
// Get the type information.
//
- ClassInfoPtr info = lookupClassInfo(id);
+ ClassInfoPtr info;
+ if(id == Ice::Object::ice_staticId())
+ {
+ //
+ // When the ID is that of Ice::Object, it indicates that the stream has not
+ // found a factory and is providing us an opportunity to preserve the object.
+ //
+ info = lookupClassInfo("::Ice::UnknownSlicedObject");
+ }
+ else
+ {
+ info = lookupClassInfo(id);
+ }
+
if(!info)
{
return 0;