00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : XMLMessage 00006 * Package : Zeus.ZeusBase.Messaging 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 #ifndef XMLMessageH 00033 #define XMLMessageH 00034 00035 #include <zeusbase/Messaging/Interfaces/IXMLMessage.hpp> 00036 #include <zeusbase/Messaging/AbstractMessage.h> 00037 00038 00039 BEGIN_NAMESPACE_Zeus 00040 00041 /***************************************************************************/ 00045 /***************************************************************************/ 00046 zeusbase_class TXMLMessage : public TAbstractMessage, public IXMLMessage 00047 { 00048 public: 00049 TXMLMessage(); 00050 TXMLMessage(const TString& rstrStream); 00051 TXMLMessage(NAMESPACE_Zeus::IXMLDocument& rDocu); 00052 00053 //Methods of IXMLMessage; 00054 virtual Retval MQUALIFIER getXMLDocument(NAMESPACE_Zeus::IXMLDocument*& rpDocument); 00055 virtual Retval MQUALIFIER getXMLMainNode(NAMESPACE_Zeus::IXMLNode*& rpNode); 00056 virtual void MQUALIFIER setXMLDocument(NAMESPACE_Zeus::IXMLDocument& rDocument); 00057 00058 //Methods of IMessage 00059 virtual void MQUALIFIER clearBody(); 00060 virtual void MQUALIFIER clearProperties() { TAbstractMessage::clearProperties(); } 00061 virtual void MQUALIFIER getInterfaceID(InterfaceID& rIID) const; 00062 virtual Uint MQUALIFIER getMessageID() const { return TAbstractMessage::getMessageID(); } 00063 virtual Uint MQUALIFIER getPriority() const { return TAbstractMessage::getPriority(); } 00064 virtual void MQUALIFIER getSender(TypGUID& rValue) const { TAbstractMessage::getSender(rValue); } 00065 virtual void MQUALIFIER getRecipients(IList<TypGUID>& rlstValue) const { TAbstractMessage::getRecipients(rlstValue); } 00066 virtual Retval MQUALIFIER getPropertyValue(const IString& rName, IString& rValue) const { return TAbstractMessage::getPropertyValue(rName, rValue); } 00067 virtual Uint64 MQUALIFIER getTimeStamp() const { return TAbstractMessage::getTimeStamp(); } 00068 virtual void MQUALIFIER setMessageID(Uint uiValue) { TAbstractMessage::setMessageID(uiValue); } 00069 virtual void MQUALIFIER setPropertyValue(const IString& rName, const IString& rValue) { TAbstractMessage::setPropertyValue(rName, rValue); } 00070 virtual void MQUALIFIER setPriority(Uint uiValue) { TAbstractMessage::setPriority(uiValue); } 00071 virtual void MQUALIFIER setSender(const TypGUID& rValue) { TAbstractMessage::setSender(rValue); } 00072 virtual void MQUALIFIER setRecipient(const TypGUID& rValue) { TAbstractMessage::setRecipient(rValue); } 00073 virtual void MQUALIFIER setRecipients(const IList<TypGUID>& rlstValue) { TAbstractMessage::setRecipients(rlstValue); } 00074 virtual void MQUALIFIER setTimeStamp(const Uint64& rui64Value) { TAbstractMessage::setTimeStamp(rui64Value); } 00075 00076 //Methods of ISerializable 00077 SERIAL_START(TXMLMessage, L"TXMLMessage") 00078 //Message header 00079 SERIAL_PARENTCLASS(TAbstractMessage) 00080 //Message body 00081 SERIAL_XMLDOCUMENT(m_pXMLDocument) 00082 SERIAL_END 00083 00084 //Methods of IZUnknown 00085 MEMORY_MANAGER_DECL 00086 00087 protected: 00088 virtual ~TXMLMessage(); 00089 00090 private: 00092 NAMESPACE_Zeus::IXMLDocument* m_pXMLDocument; 00093 }; 00094 00095 //INLINE METHODS 00096 /***************************************************************************/ 00099 /***************************************************************************/ 00100 inline void MQUALIFIER TXMLMessage::getInterfaceID(InterfaceID& rIID) const 00101 { 00102 rIID = INTERFACE_IXMLMessage; 00103 } 00104 00105 00106 00107 00108 END_NAMESPACE_Zeus 00109 00110 #endif