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