From 080dc6ecd94142b6dae8ccdc33457e1130bb796e Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Thu, 22 Feb 2007 22:43:40 +0000 Subject: Tape message now defines its members before common message members so that the message type is always the first member. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@414 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkbasecxx/messages/TapeMsg.cpp | 55 +++++++++++++++++++++++++++++++++++++++-- orkbasecxx/messages/TapeMsg.h | 33 ++++++++++++++++++++++++- 2 files changed, 85 insertions(+), 3 deletions(-) (limited to 'orkbasecxx/messages') diff --git a/orkbasecxx/messages/TapeMsg.cpp b/orkbasecxx/messages/TapeMsg.cpp index b624d08..9297973 100644 --- a/orkbasecxx/messages/TapeMsg.cpp +++ b/orkbasecxx/messages/TapeMsg.cpp @@ -10,6 +10,9 @@ * Please refer to http://www.gnu.org/copyleft/gpl.html * */ +#pragma warning( disable: 4786 ) // disables truncated symbols in browse-info warning + +#define _WINSOCKAPI_ // prevents the inclusion of winsock.h #include "Utils.h" #include "TapeMsg.h" @@ -26,8 +29,6 @@ TapeMsg::TapeMsg() void TapeMsg::Define(Serializer* s) { - DefineMessage(s); - CStdString tapeMessageName(TAPE_MESSAGE_NAME); s->StringValue(OBJECT_TYPE_TAG, tapeMessageName, true); s->StringValue(REC_ID_PARAM, m_recId, true); @@ -46,6 +47,8 @@ void TapeMsg::Define(Serializer* s) s->StringValue(REMOTE_IP_PARAM, m_remoteIp); //s->StringValue(LOCAL_MAC_PARAM, m_localMac); //s->StringValue(REMOTE_MAC_PARAM, m_remoteMac); + + DefineMessage(s); } void TapeMsg::Validate() @@ -62,6 +65,10 @@ ObjectRef TapeMsg::NewInstance() return ObjectRef(new TapeMsg); } +ObjectRef TapeMsg::Process() +{ + return ObjectRef(); +} //========================================================== TapeResponse::TapeResponse() @@ -86,3 +93,47 @@ ObjectRef TapeResponse::NewInstance() return ObjectRef(new TapeResponse); } +//==================================================================== +//TapeResponseFwd::TapeResponseFwd() +//{ +// m_boolean2 = false; +//} +// +// +//void TapeResponseFwd::Define(Serializer* s) +//{ +// TapeResponse::Define(s); +// s->BoolValue("boolean2", m_boolean2); +//} +// +//ObjectRef TapeResponseFwd::NewInstance() +//{ +// return ObjectRef(new TapeResponseFwd); +//} + +//==================================================================== +TapeTagMsg::TapeTagMsg() +{ + // Here is where default values are set +} + +void TapeTagMsg::Define(Serializer* s) +{ + CStdString tapeMessageName("tapetagmsg"); + s->StringValue(OBJECT_TYPE_TAG, tapeMessageName, true); + DefineMessage(s); +} + +void TapeTagMsg::Validate() +{ +} + +CStdString TapeTagMsg::GetClassName() +{ + return CStdString("tapetagmsg"); +} + +ObjectRef TapeTagMsg::NewInstance() +{ + return ObjectRef(new TapeTagMsg); +} \ No newline at end of file diff --git a/orkbasecxx/messages/TapeMsg.h b/orkbasecxx/messages/TapeMsg.h index 481bfd3..09a95d8 100644 --- a/orkbasecxx/messages/TapeMsg.h +++ b/orkbasecxx/messages/TapeMsg.h @@ -42,7 +42,7 @@ public: CStdString GetClassName(); ObjectRef NewInstance(); - inline ObjectRef Process() {return ObjectRef();}; + ObjectRef Process(); CStdString m_recId; CStdString m_stage; @@ -81,5 +81,36 @@ public: typedef boost::shared_ptr TapeResponseRef; +//class DLL_IMPORT_EXPORT_ORKBASE TapeResponseFwd : public TapeResponse +//{ +//public: +// TapeResponseFwd(); +// void Define(Serializer* s); +// +// ObjectRef NewInstance(); +// +// bool m_boolean2; +//}; + + +class DLL_IMPORT_EXPORT_ORKBASE TapeTagMsg : public SyncMessage +{ +public: + TapeTagMsg(); + + void Define(Serializer* s); + void Validate(); + + CStdString GetClassName(); + ObjectRef NewInstance(); + inline ObjectRef Process() {return ObjectRef();}; + + CStdString m_orkUid; + time_t m_timestamp; + CStdString m_key; + CStdString m_value; +}; +typedef boost::shared_ptr TapeTagMsgRef; + #endif -- cgit v1.2.3