00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : ObjectMessage 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 ObjectMessageH 00033 #define ObjectMessageH 00034 00035 #include <zeusbase/Messaging/Interfaces/IObjectMessage.hpp> 00036 #include <zeusbase/Messaging/AbstractMessage.h> 00037 00038 BEGIN_NAMESPACE_Zeus 00039 00040 00041 /***************************************************************************/ 00044 /***************************************************************************/ 00045 zeusbase_class TObjectMessage : protected TAbstractMessage, public IObjectMessage 00046 { 00047 public: 00048 TObjectMessage(); 00049 TObjectMessage(ISerializable& rObj); 00050 00051 //Methods of IObjectMessage; 00052 virtual Retval MQUALIFIER getObject(ISerializable*& rpObj) const; 00053 virtual Retval MQUALIFIER getCastedObject(const InterfaceID& rIfaceID, IZUnknown*& rpValue) const; 00054 virtual void MQUALIFIER setObject(ISerializable* pObj); 00055 00056 //Methods of IMessage 00057 virtual void MQUALIFIER clearBody(); 00058 virtual void MQUALIFIER clearProperties() { TAbstractMessage::clearProperties(); } 00059 virtual void MQUALIFIER getInterfaceID(InterfaceID& rIID) const; 00060 virtual Uint MQUALIFIER getMessageID() const { return TAbstractMessage::getMessageID(); } 00061 virtual Uint MQUALIFIER getPriority() const { return TAbstractMessage::getPriority(); } 00062 virtual void MQUALIFIER getSender(TypGUID& rValue) const { TAbstractMessage::getSender(rValue); } 00063 virtual void MQUALIFIER getRecipients(IList<TypGUID>& rlstValue) const { TAbstractMessage::getRecipients(rlstValue); } 00064 virtual Retval MQUALIFIER getPropertyValue(const IString& rName, IString& rValue) const { return TAbstractMessage::getPropertyValue(rName, rValue); } 00065 virtual Uint64 MQUALIFIER getTimeStamp() const { return TAbstractMessage::getTimeStamp(); } 00066 virtual void MQUALIFIER setMessageID(Uint uiValue) { TAbstractMessage::setMessageID(uiValue); } 00067 virtual void MQUALIFIER setPropertyValue(const IString& rName, const IString& rValue) { TAbstractMessage::setPropertyValue(rName, rValue); } 00068 virtual void MQUALIFIER setPriority(Uint uiValue) { TAbstractMessage::setPriority(uiValue); } 00069 virtual void MQUALIFIER setSender(const TypGUID& rValue) { TAbstractMessage::setSender(rValue); } 00070 virtual void MQUALIFIER setRecipient(const TypGUID& rValue) { TAbstractMessage::setRecipient(rValue); } 00071 virtual void MQUALIFIER setRecipients(const IList<TypGUID>& rlstValue) { TAbstractMessage::setRecipients(rlstValue); } 00072 virtual void MQUALIFIER setTimeStamp(const Uint64& rui64Value) { TAbstractMessage::setTimeStamp(rui64Value); } 00073 00074 //Methods of ISterializable 00075 SERIAL_START(TObjectMessage, L"TObjectMessage") 00076 //Message header 00077 SERIAL_PARENTCLASS(TAbstractMessage) 00078 //Message body 00079 SERIAL_OBJECT(INTERFACE_ISerializable, m_pStreamObject) 00080 SERIAL_END 00081 00082 //Methods of IZUnknown 00083 MEMORY_MANAGER_DECL 00084 00085 protected: 00086 virtual ~TObjectMessage(); 00087 00089 ISerializable* m_pStreamObject; 00090 00091 private: 00092 00093 }; 00094 00095 /***************************************************************************/ 00098 /***************************************************************************/ 00099 inline void MQUALIFIER TObjectMessage::getInterfaceID(InterfaceID& rIID) const 00100 { 00101 rIID = INTERFACE_IObjectMessage; 00102 } 00103 00104 END_NAMESPACE_Zeus 00105 00106 #endif