![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /******************************************************************************* 00002 ** Copyright (c) 1998 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: resRepMsg.h,v $ $Revision: 1.10 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00012 #ifndef DtRestoreReplyMsg_H_ 00013 #define DtRestoreReplyMsg_H_ 00014 00015 #include "rtiMsg.h" 00016 #include "netResRep.h" 00017 00018 00019 class DtConnectionMgr; 00020 class DtRestoreReplyMsg; 00021 typedef void (*DtRestoreReplyCb)(const DtRestoreReplyMsg& msg, void* usr); 00022 00023 00024 class DT_DLL_LRC DtRestoreReplyMsg : public DtRtiMsg 00025 { 00026 public: 00027 00028 enum replyCodes 00029 { 00030 DT_RESTORE_OK = 0, 00031 DT_RESTORE_NO_LABEL = 1, 00032 DT_RESTORE_WRONG_CONFIG = 2, 00033 DT_RESTORE_IN_PROCESS = 3 00034 }; 00035 00037 DtRestoreReplyMsg(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00038 00040 DtRestoreReplyMsg( 00041 const char* theLabel, 00042 const replyCodes response, 00043 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00044 00046 DtRestoreReplyMsg(const DtNetRestoreReplyMsg* netRepMsg, 00047 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00048 00050 virtual ~DtRestoreReplyMsg(); 00051 00053 virtual DtRtiMsg* clone(bool copy = true) const; 00054 00056 virtual void setLabel(const char* label); 00057 virtual const char* label() const; 00058 00060 virtual void setReply(const replyCodes value); 00061 virtual replyCodes reply() const; 00062 00064 virtual void printData(DtLogicalTimeFactory* logicalTimeFactory) const; 00065 00070 virtual unsigned long destinationID() const; 00071 virtual void setDestinationID(unsigned long destinationIDValue); 00072 00073 public: 00074 00076 static DtRtiMsg* create(const DtNetMsgHeader* initial, 00077 DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00079 static DtRtiMsg* create(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER); 00080 00082 static void addCallback(DtConnectionMgr *conn, 00083 DtRestoreReplyCb cb, void *usr); 00084 static void removeCallback(DtConnectionMgr *conn, 00085 DtRestoreReplyCb cb, void *usr); 00086 00087 protected: 00089 virtual char* labelPtr(); 00090 00092 virtual int labelFieldSize() const; 00093 00095 virtual DtNetRestoreReplyMsg* netRestoreReplyMsg(); 00096 virtual const DtNetRestoreReplyMsg* netRestoreReplyMsg() const; 00097 00099 virtual DtRtiMsgKind internalDtRtiMsgKind(); 00100 00102 virtual int minSize(const char* theLabel=NULL) const; 00103 00105 virtual void setLabelSize(int size); 00106 virtual int labelSize() const; 00107 00109 virtual DtRestoreReplyMsg* self() const; 00110 00111 00112 00113 protected: 00114 00115 char* myLabel; 00116 }; 00117 00118 inline DtRestoreReplyMsg* DtRestoreReplyMsg::self() const 00119 { 00120 return const_cast<DtRestoreReplyMsg*>( this ); 00121 } 00122 00123 #endif