00001 // 00002 // CascadeMessage.h - header file for class CascadeMessage 00003 // 00004 // Copyright (c) 2003, Roku, LLC. All rights reserved. 00005 // 00008 00009 #ifndef _ROKU_INCLUDE_CASCADE_INTERPROCESS_CASCADEMESSAGE_H 00010 #define _ROKU_INCLUDE_CASCADE_INTERPROCESS_CASCADEMESSAGE_H 00011 00012 #include <cascade/CascadeObject.h> 00013 #include <cascade/util/CascadeTime.h> 00014 00039 class CascadeMessage : public CascadeObject 00040 { 00041 public: 00042 static u32 FindOrCreateMessage(const char * pMessageName); 00050 00051 static u32 FindMessage(const char * pMessageName); 00058 00059 static bool GetMessageNameFromID(u32 nID, char * pBuff, u32 nBuffLen); 00071 00072 public: 00073 // dealing with the time sent and received 00074 const CascadeTime::TimeBase & GetTimeSent() const; 00079 const CascadeTime::TimeBase & GetTimeReceived() const; 00084 // dealing with the message source and destination 00085 const char * GetSourceWormholeURL() const; 00093 const char * GetTargetWormholeURL() const; 00104 00105 // dealing with whether or not a reply to this message is required 00106 bool IsReplyRequired() const; 00117 00118 // dealing with the message id - people always misspell ID so make a few versions 00119 u32 GetMessageID() const; 00126 inline u32 GetMessageId() const { return GetMessageID(); } 00133 inline u32 ID() const { return GetMessageID(); } 00140 inline u32 Id() const { return GetMessageID(); } 00147 00148 // dealing with the message data 00149 void * GetData() const; 00157 u32 GetDataSize() const; 00165 00166 private: // constructors are private to prevent you from manufacturing messages yourself 00167 00168 #ifndef DOXY_SKIP 00169 friend class CascadeWormhole; 00170 #endif 00171 00172 CascadeMessage(); 00173 virtual ~CascadeMessage(); 00174 00175 private: 00176 void * m_pMessageInternal; 00177 }; 00178 00179 #endif // #ifndef _ROKU_INCLUDE_CASCADE_INTERPROCESS_CASCADEMESSAGE_H 00180 00182 // LOG 00184 // 14-Jan-03 dwoodward created 00185 // 20-Jan-01 dwoodward 1.0 STATUS: about 80% complete - needs refinement 00186 // 03-Feb-03 dwoodward refined! 00187 // 05-May-03 dwoodward doxygenated 00188 // 18-May-05 dwoodward GetTimeSent() and GetTimeReceived() now return a CascadeTime::TimeBase reference 00189 // instead of a CascadeTime reference