![]() |
MAK RTIspy API Documentation for HLA Evolved
|
00001 /********************************************************************* 00002 ** Copyright (c) 1998 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: resBegMsg.h,v $ $Revision: 1.6 $ $State: Exp $ 00007 *********************************************************************/ 00008 00011 00012 #ifndef DtRestoreBegunMsg_H_ 00013 #define DtRestoreBegunMsg_H_ 00014 00015 #include "rtiMsg.h" 00016 #include "netSavRespMsg.h" 00017 00018 class DtConnectionMgr; 00019 class DtRestoreBegunMsg; 00020 typedef void (*DtRestoreBegunCb)(const DtRestoreBegunMsg& inter, void* usr); 00021 00022 enum DtResponseFlag 00023 { 00024 DtResponseSuccess, 00025 DtResponseFail 00026 }; 00027 00028 class DT_DLL_LRC DtRestoreBegunMsg : public DtRtiMsg 00029 { 00030 public: 00031 00033 DtRestoreBegunMsg(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00034 00035 DtRestoreBegunMsg(DtFederateHandle requestingFederateVal, 00036 const char* labelVal, 00037 DtResponseFlag flag, 00038 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00039 00041 DtRestoreBegunMsg(const DtNetSaveResponseMsg* netRepMsg, 00042 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00043 00045 virtual ~DtRestoreBegunMsg(); 00046 00048 virtual DtRtiMsg* clone(bool copy = true) const; 00049 00051 virtual void set(DtFederateHandle requestingFederateVal, 00052 const char* theLabel, DtResponseFlag flag); 00053 00055 void setRequestingFederate(DtFederateHandle requestingFederateVal); 00056 DtFederateHandle requestingFederate() const; 00057 00059 virtual void setLabel(const char* label); 00060 virtual const char* label() const; 00061 00063 void setResponseFlag(DtResponseFlag flag); 00064 DtResponseFlag responseFlag() const; 00065 00067 virtual void printData(DtLogicalTimeFactory* logicalTimeFactory) const; 00068 00069 public: 00070 00072 static DtRtiMsg* create(const DtNetMsgHeader* initial, 00073 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00074 00076 static DtRtiMsg* create(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00077 00079 static void addCallback(DtConnectionMgr* conn, 00080 DtRestoreBegunCb cb, void* usr); 00081 static void removeCallback(DtConnectionMgr* conn, 00082 DtRestoreBegunCb cb, void* usr); 00083 00084 protected: 00085 00087 virtual DtNetSaveResponseMsg* netRestoreBegunMsg(); 00088 virtual const DtNetSaveResponseMsg* netRestoreBegunMsg() const; 00089 00091 virtual DtRtiMsgKind internalDtRtiMsgKind(); 00092 00094 virtual char* labelPtr(); 00095 00097 virtual int labelFieldSize() const; 00098 00100 virtual void setLabelSize(int size); 00101 virtual int labelSize() const; 00102 00104 virtual int minSize(const char* theLabel=NULL) const; 00105 00107 virtual DtRestoreBegunMsg* self() const; 00108 00109 protected: 00110 00111 char* myLabel; 00112 }; 00113 00114 00115 inline DtRestoreBegunMsg* DtRestoreBegunMsg::self() const 00116 { 00117 return const_cast<DtRestoreBegunMsg*>( this ); 00118 } 00119 00120 #endif 00121