S11nObject.cpp

Go to the documentation of this file.
00001 /*
00002 
00003 $Header$
00004 
00005 */
00006 
00007 #include "S11nObject.h"
00008 
00009 template<>
00010 int S11n<ObjectPtr>::toString(const ObjectPtr &value, String &str)
00011 {
00012   if (value)
00013     str.setNum(value->id());
00014   else
00015     str.clear();
00016   return OK;
00017 }
00018 
00019 template<>
00020 int S11n<ObjectPtr>::fromString(const String &str, ObjectPtr &value)
00021 {
00022   long long id;
00023   int res;
00024 
00025   if (FAILED(res = str.toLongLong(id)))
00026     return ERROR_BACKTRACE(res);
00027 
00028   if (FAILED(res = Object::get((ObjectId)id, &value)))
00029     return ERROR_BACKTRACE(res);
00030 
00031   return OK;
00032 }
00033 
00034 template<>
00035 int S11n<ObjectPtr>::toXml(const ObjectPtr &value, XmlElement *element)
00036 {
00037   int res;
00038 
00039   if (FAILED(res = toXmlAttrValue(value, element)))
00040     return ERROR_BACKTRACE(res);
00041   return OK;
00042 }
00043 
00044 template<>
00045 int S11n<ObjectPtr>::fromXml(const XmlElement *element, ObjectPtr &value)
00046 {
00047   int res;
00048 
00049   if (FAILED(res = fromXmlAttrValue(element, value)))
00050     return ERROR_BACKTRACE(res);
00051   return OK;
00052 }

Generated on Thu Sep 6 20:11:25 2007 for Pylon Application Platform by  doxygen 1.5.1