diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-09-14 15:30:12 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-09-14 15:30:12 -0700 |
commit | c912d30d47799bbba77d0f2532704d8aaba12a4a (patch) | |
tree | 8611fdb0b73a9a78f7c319ca4bb08f1f9d2e9cd0 /py/modules/IcePy/ObjectFactory.cpp | |
parent | Fixed optional test issues (diff) | |
download | ice-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.cpp | 15 |
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; |