MAK RTIspy API Documentation for HLA 1.3
joinRespMsg.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 1998 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: joinRespMsg.h,v $ $Revision: 1.39 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef DtJoinResponseMsg_H_
00013 #define DtJoinResponseMsg_H_
00014 
00015 #include "rtiMsg.h"
00016 #include "netRtiMsgHdr.h"
00017 #include "netJoRespMsg.h"
00018 #include <vlutil/vlString.h>
00019 
00020 class DtConnectionMgr;
00021 class DtJoinResponseMsg;
00022 class DtFederateHandleSet;
00023 typedef void (*DtJoinResponseCb)(const DtJoinResponseMsg& inter, void* usr);
00024 
00025 typedef std::map< MAKRti::DtString, DtFederateHandle > DtFederateNameAndHdlMap;
00026 
00027 class DT_DLL_LRC DtJoinResponseMsg : public DtRtiMsg
00028 {
00029 public:
00031    enum errorCodes {
00032       DT_NO_ERROR = 0,
00033       DT_FEDEX_DOES_NOT_EXIST,
00034       DT_SAVE_IN_PROGRESS,
00035       DT_RESTORE_IN_PROGRESS,
00036       DT_FED_FILE_NOT_READY,
00037       DT_MAX_FEDERATES_JOINED,
00038       DT_FED_FILE_MERGE_PROBLEM,
00039       DT_FAILED_TO_GET_LICENSE,
00040       DT_RTIEXEC_LICENSING_PARAM_MISMATCH,
00041       DT_PARTNER_TAKEN,
00042       DT_TYPE_CONFLICT,
00043       DT_NAME_IN_USE,
00044       DT_UNKNOWN_ERROR,
00045       DT_WAITING,  
00046       DT_CRC_FAILURE
00047    };
00048       
00049 public:
00050 
00052    DtJoinResponseMsg(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
00053 
00054    DtJoinResponseMsg(
00055       unsigned long destinationIDValue,
00056       unsigned short requestIDValue,
00057       DtFederateHandle federateHandleValue,
00058       MAKRti::DtString federateNameValue,
00059       unsigned short fedExHandleValue,
00060       MAKRti::DtString const & fedExNameValue,
00061       MAKRti::DtString const & timeImplNameValue,
00062       unsigned int crcOfFedFileValue,
00063       const MAKRti::DtString& momModule,
00064       const std::vector<MAKRti::DtString >& moduleNames,
00065       unsigned long flagsValue,
00066       bool allowNetworkTestValue,
00067       bool enableNetworkTestValue,
00068       const DtFederateNameAndHdlMap* namesAndHdls,
00069       errorCodes errorValue = DT_NO_ERROR,
00070       const DtString& errorString = DtString::nullString(),
00071       DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
00072 
00074    DtJoinResponseMsg(const DtNetJoinResponseMsg* netRepMsg,
00075       DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
00076 
00078    virtual ~DtJoinResponseMsg();
00079 
00081    virtual DtRtiMsg* clone(bool copy = true) const; 
00082 
00084    virtual void set(
00085       unsigned long destinationIDValue,
00086       unsigned short requestIDValue,
00087       DtFederateHandle federateHandleValue,
00088       MAKRti::DtString federateNameValue,
00089       unsigned short fedExHandleValue,
00090       MAKRti::DtString const & fedExNameValue,
00091       MAKRti::DtString const & timeImplNameValue,
00092       unsigned int crcOfFedFileValue,
00093       const MAKRti::DtString& momModule,
00094       const std::vector<MAKRti::DtString>& moduleNames,
00095       unsigned long flagsValue,
00096       bool allowNetworkTestValue,
00097       bool enableNetworkTestValue,
00098       const DtFederateNameAndHdlMap* namesAndHdls,
00099       errorCodes errorValue = DT_NO_ERROR,
00100       const DtString& errorString = DtString::nullString());
00101 
00106    virtual unsigned long destinationID() const;
00107    virtual void setDestinationID(unsigned long destinationIDValue);
00108 
00110    virtual unsigned short requestID() const;
00111    virtual void setRequestID(unsigned short requestIDValue);
00112 
00114    virtual MAKRti::DtString fullFedExName() const;
00115    virtual void setFullFedExName(MAKRti::DtString const & name);
00116 
00118    virtual unsigned short fedexHandleToUse() const;
00119    virtual void setFedexHandleToUse(unsigned short handle);
00120 
00122    virtual MAKRti::DtString federateName() const;
00123    virtual void setFederateName(MAKRti::DtString const & name);
00124 
00126    virtual MAKRti::DtString timeImplName() const;
00127    virtual void setTimeImplName(MAKRti::DtString const & name);
00128 
00130    virtual MAKRti::DtString momModuleName() const;
00131    virtual void setMomModuleName(MAKRti::DtString const & name);
00132 
00134    virtual void setfomModuleNames( const std::vector<MAKRti::DtString> & moduleNames);
00135    virtual void getFomModuleNames( std::vector<MAKRti::DtString>& modules ) const;
00136 
00138    virtual DtFederateHandle federateHandleToUse() const;
00139    virtual void setFederateHandleToUse(DtFederateHandle handle);
00140 
00142    virtual unsigned int crcOfFedFile() const;
00143    virtual void setCrcOfFedFile(unsigned int crc );
00144 
00146    virtual void setErrorValue( errorCodes value );
00147    virtual errorCodes errorValue() const;
00148 
00150    virtual void setErrorString( MAKRti::DtString const & errorStr );
00151    virtual MAKRti::DtString errorString() const;
00152 
00154    virtual void setFlags( unsigned long value );
00155    virtual unsigned long flags() const;
00156 
00158    virtual void setAllowNetworkTest( bool value );
00159    virtual bool allowNetworkTest() const;
00160 
00162    virtual void setNetworkTestEnabled( bool value );
00163    virtual bool networkTestEnabled() const;
00164 
00166    virtual void setFederateNamesAndHandles( const std::map< MAKRti::DtString, DtFederateHandle >& );
00167    virtual void getFederateNamesAndHandles( std::map< MAKRti::DtString, DtFederateHandle >& namesAndHdls ) const;
00168 
00170    virtual void setFederateNamesSize( unsigned long size );
00171    virtual unsigned long federateNamesSize() const;
00172 
00174    virtual unsigned numFederates() const;
00175    virtual void setNumFederates(unsigned num);
00176 
00178    virtual void printData(DtLogicalTimeFactory* logicalTimeFactory) const;
00179 
00180 public:
00181 
00183    static DtRtiMsg* create(const DtNetMsgHeader* initial,
00184       DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
00185 
00187    static DtRtiMsg* create(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
00188 
00190    static void addCallback(DtConnectionMgr* conn,
00191       DtJoinResponseCb cb, void* usr);
00192    static void removeCallback(DtConnectionMgr* conn,
00193       DtJoinResponseCb cb, void* usr);
00194 
00195 protected:
00196 
00198    virtual DtNetJoinResponseMsg* netJoinResponseMsg();
00199    virtual const DtNetJoinResponseMsg* netJoinResponseMsg() const;
00200 
00202    virtual DtRtiMsgKind internalDtRtiMsgKind();
00203 
00205    virtual int minSize() const;
00206 
00210    virtual int setMinSizes(const MAKRti::DtString& fedExNameVal,
00211       const MAKRti::DtString& federateNameVal,
00212       const MAKRti::DtString& timeImplNameVal,
00213       const std::vector<MAKRti::DtString>& fomModuleNamesVal,
00214       const DtFederateNameAndHdlMap* namesAndHdls,
00215       const MAKRti::DtString& errorString);
00216 
00218    virtual void setFedExNameSize( unsigned long size );
00219    virtual unsigned long fedExNameSize() const;
00220 
00222    virtual void setFederateNameSize( unsigned long size );
00223    virtual unsigned long federateNameSize() const;
00224 
00225 
00227    virtual void setErrorStringSize( unsigned long size );
00228    virtual unsigned long errorStringSize() const;
00229 
00231    virtual void setTimeImplNameSize( unsigned long size );
00232    virtual unsigned long timeImplNameSize() const;
00233 
00235    virtual void setMomModuleNameSize( unsigned long size );
00236    virtual unsigned long momModuleNameSize() const;
00237 
00239    virtual void setfomModuleNameSize( unsigned long size );
00240    virtual unsigned long fomModuleNameSize() const;
00241 
00243    virtual char* fedExNamePtr();
00244    virtual char* federateNamePtr();
00245    virtual char* timeImplNamePtr();
00246    virtual char* momModuleNamePtr();
00247    virtual char* fomModuleNamesPtr();
00248    virtual char* federateNamesPtr();
00249    virtual char* errorStringPtr();
00250    virtual DtNetU32* federateHandlesPtr();
00251    
00252    //const
00254    virtual const char* fedExNamePtr() const;
00255    virtual const char* federateNamePtr() const;
00256    virtual const char* timeImplNamePtr() const;
00257    virtual const char* momModuleNamePtr() const;
00258    virtual const char* fomModuleNamesPtr() const;
00259    virtual const char* federateNamesPtr() const;
00260    virtual const char* errorStringPtr() const;
00261    virtual const DtNetU32* federateHandlesPtr() const;
00262 
00264    virtual DtJoinResponseMsg* self() const;
00265 
00267    DtFederateHandleSet* mySet;
00268 };
00269 
00270 
00271 inline DtJoinResponseMsg* DtJoinResponseMsg::self() const
00272 {
00273    return const_cast<DtJoinResponseMsg*>( this );
00274 }
00275 
00276 #endif   //! DtJoinResponseMsg_H_
00277 
00278 

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)