MAK RTIspy API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
joinRespMsg.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: joinRespMsg.h,v $ $Revision: 1.39 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef DtJoinResponseMsg_H_
13 #define DtJoinResponseMsg_H_
14 
15 #include "rtiMsg.h"
16 #include "netRtiMsgHdr.h"
17 #include "netJoRespMsg.h"
18 
19 #include <vlutil/vlString.h>
20 
21 class DtConnectionMgr;
22 class DtJoinResponseMsg;
24 typedef void (*DtJoinResponseCb)(const DtJoinResponseMsg& inter, void* usr);
25 
26 typedef std::map< MAKRti::DtString, DtFederateHandle > DtFederateNameAndHdlMap;
27 
29 {
30 public:
32  enum errorCodes {
33  DT_NO_ERROR = 0,
49  DT_UNAUTHORIZED
50  };
51 
52 public:
53 
55 
56  DtJoinResponseMsg(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
57 
58  DtJoinResponseMsg(unsigned long destinationIDValue, unsigned short requestIDValue, DtFederateHandle federateHandleValue,
59  MAKRti::DtString federateNameValue, unsigned short fedExHandleValue, MAKRti::DtString const & fedExNameValue,
60  MAKRti::DtString const & timeImplNameValue, unsigned int crcOfFedFileValue, const MAKRti::DtString& momModule,
61  const std::vector<MAKRti::DtString >& moduleNames, unsigned long flagsValue, bool allowNetworkTestValue,
62  bool enableNetworkTestValue, const DtFederateNameAndHdlMap* namesAndHdls, errorCodes errorValue = DT_NO_ERROR,
63  const DtString& errorString = DtString::nullString(), DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
64 
65  DtJoinResponseMsg(const DtNetJoinResponseMsg* netRepMsg, DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
67 
69  virtual ~DtJoinResponseMsg();
70 
72  virtual DtRtiMsg* clone(bool copy = true) const;
73 
75  virtual void set(unsigned long destinationIDValue, unsigned short requestIDValue, DtFederateHandle federateHandleValue,
76  MAKRti::DtString federateNameValue, unsigned short fedExHandleValue, MAKRti::DtString const & fedExNameValue,
77  MAKRti::DtString const & timeImplNameValue, unsigned int crcOfFedFileValue, const MAKRti::DtString& momModule,
78  const std::vector<MAKRti::DtString>& moduleNames, unsigned long flagsValue, bool allowNetworkTestValue,
79  bool enableNetworkTestValue, const DtFederateNameAndHdlMap* namesAndHdls, errorCodes errorValue = DT_NO_ERROR,
80  const DtString& errorString = DtString::nullString(), bool adjustBufferSize = true);
81 
83 
84 
87  virtual unsigned long destinationID() const;
88  virtual void setDestinationID(unsigned long destinationIDValue);
89 
90  virtual unsigned short requestID() const;
91  virtual void setRequestID(unsigned short requestIDValue);
92 
93  virtual MAKRti::DtString fullFedExName() const;
94  virtual void setFullFedExName(MAKRti::DtString const & name, bool adjustBufferSize = true);
95 
96  virtual unsigned short fedexHandleToUse() const;
97  virtual void setFedexHandleToUse(unsigned short handle);
98 
99  virtual MAKRti::DtString federateName() const;
100  virtual void setFederateName(MAKRti::DtString const & name, bool adjustBufferSize = true);
101 
102  virtual MAKRti::DtString timeImplName() const;
103  virtual void setTimeImplName(MAKRti::DtString const & name, bool adjustBufferSize = true);
104 
105  virtual MAKRti::DtString momModuleName() const;
106  virtual void setMomModuleName(MAKRti::DtString const & name, bool adjustBufferSize = true);
107 
108  virtual void setfomModuleNames( const std::vector<MAKRti::DtString> & moduleNames, bool adjustBufferSize = true);
109  virtual void getFomModuleNames( std::vector<MAKRti::DtString>& modules ) const;
110 
111  virtual DtFederateHandle federateHandleToUse() const;
112  virtual void setFederateHandleToUse(DtFederateHandle handle);
113 
114  virtual unsigned int crcOfFedFile() const;
115  virtual void setCrcOfFedFile(unsigned int crc );
116 
117  virtual void setErrorValue( errorCodes value );
118  virtual errorCodes errorValue() const;
119 
120  virtual void setErrorString(MAKRti::DtString const & errorStr, bool adjustBufferSize = true);
121  virtual MAKRti::DtString errorString() const;
122 
123  virtual void setFlags( unsigned long value );
124  virtual unsigned long flags() const;
125 
126  virtual void setAllowNetworkTest( bool value );
127  virtual bool allowNetworkTest() const;
128 
129  virtual void setNetworkTestEnabled( bool value );
130  virtual bool networkTestEnabled() const;
131 
132  virtual void setFederateNamesAndHandles(const std::map< MAKRti::DtString, DtFederateHandle >& namesAndHandles, bool adjustBufferSize = true);
133  virtual void getFederateNamesAndHandles(std::map< MAKRti::DtString, DtFederateHandle >& namesAndHdls) const;
134 
135  virtual void setFederateNamesSize( unsigned long size );
136  virtual unsigned long federateNamesSize() const;
137 
138  virtual unsigned numFederates() const;
139  virtual void setNumFederates(unsigned num);
141 
143  virtual void printData(DtLogicalTimeFactory* logicalTimeFactory) const;
144 
145 public:
146 
148  static DtRtiMsg* create(const DtNetMsgHeader* initial, DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
149 
151  static DtRtiMsg* create(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
152 
154 
155  static void addCallback(DtConnectionMgr* conn, DtJoinResponseCb cb, void* usr, bool isMomCallback=false);
156  static void removeCallback(DtConnectionMgr* conn, DtJoinResponseCb cb, void* usr, bool isMomCallback=false);
158 
159 protected:
160 
162 
163  virtual DtNetJoinResponseMsg* netJoinResponseMsg();
164  virtual const DtNetJoinResponseMsg* netJoinResponseMsg() const;
166 
169 
171  virtual int minSize() const;
172 
174  virtual int minSize(const MAKRti::DtString& fedExNameVal, const MAKRti::DtString& federateNameVal,
175  const MAKRti::DtString& timeImplNameVal, const std::vector<MAKRti::DtString>& fomModuleNamesVal,
176  const MAKRti::DtString& momModuleNameVal, const DtFederateNameAndHdlMap* namesAndHdls, const MAKRti::DtString& errorString);
177 
179 
180  virtual void setFedExNameSize( unsigned long size );
181  virtual unsigned long fedExNameSize() const;
182 
183  virtual void setFederateNameSize( unsigned long size );
184  virtual unsigned long federateNameSize() const;
185 
186  virtual void setErrorStringSize( unsigned long size );
187  virtual unsigned long errorStringSize() const;
188 
189  virtual void setTimeImplNameSize( unsigned long size );
190  virtual unsigned long timeImplNameSize() const;
191 
192  virtual void setMomModuleNameSize( unsigned long size );
193  virtual unsigned long momModuleNameSize() const;
194 
195  virtual void setfomModuleNameSize( unsigned long size );
196  virtual unsigned long fomModuleNameSize() const;
198 
200 
201  virtual char* fedExNamePtr();
202  virtual const char* fedExNamePtr() const;
203 
204  virtual char* federateNamePtr();
205  virtual const char* federateNamePtr() const;
206 
207  virtual char* timeImplNamePtr();
208  virtual const char* timeImplNamePtr() const;
209 
210  virtual char* momModuleNamePtr();
211  virtual const char* momModuleNamePtr() const;
212 
213  virtual char* fomModuleNamesPtr();
214  virtual const char* fomModuleNamesPtr() const;
215 
216  virtual char* federateNamesPtr();
217  virtual const char* federateNamesPtr() const;
218 
219  virtual char* errorStringPtr();
220  virtual const char* errorStringPtr() const;
221 
222  virtual DtNetU32* federateHandlesPtr();
223  virtual const DtNetU32* federateHandlesPtr() const;
225 
227  virtual DtJoinResponseMsg* self() const;
228 
229  protected:
230 
233 };
234 
235 
237 {
238  return const_cast<DtJoinResponseMsg*>( this );
239 }
240 
241 #endif
242 
243 
Definition: joinRespMsg.h:37
DtRtiMsgKind
Definition: rtiMsgKind.h:9
DtFederateHandleSet * mySet
Our federate handle set.
Definition: joinRespMsg.h:232
Definition: joinRespMsg.h:46
Definition: netRtiMsgHdr.h:23
Definition: joinRespMsg.h:28
Definition: fedTimeFactory.h:73
Definition: joinRespMsg.h:45
virtual void printData(DtLogicalTimeFactory *logicalTimeFactory) const
Used as a invalid value while waiting for a response.
Definition: joinRespMsg.h:47
Definition: fedHandleSet.h:61
Definition: joinRespMsg.h:43
Definition: joinRespMsg.h:42
errorCodes
error codes for the errorValue flag
Definition: joinRespMsg.h:32
virtual DtJoinResponseMsg * self() const
Casts away const-ness.
Definition: joinRespMsg.h:236
Definition: joinRespMsg.h:44
Instances of DtConnectionMgr manage the communication objects that the RTI will use to either communi...
Definition: connectMgr.h:67
DtRtiMsg is the base class for messages between RTI components.
Definition: rtiMsg.h:34
DtHandle DtFederateHandle
Definition: internalTypes.h:46
Definition: joinRespMsg.h:36
Definition: netJoRespMsg.h:19
Definition: joinRespMsg.h:38
virtual DtRtiMsg * clone(bool copy=true) const =0
Return a copy/empty object of the same type as this.
virtual DtRtiMsgKind internalDtRtiMsgKind()=0
Definition: joinRespMsg.h:35
std::map< MAKRti::DtString, DtFederateHandle > DtFederateNameAndHdlMap
Definition: joinRespMsg.h:26
Definition: joinRespMsg.h:34
Definition: joinRespMsg.h:48
#define DT_DLL_LRC
Definition: rtiMsConfig.h:155
void(* DtJoinResponseCb)(const DtJoinResponseMsg &inter, void *usr)
Definition: joinRespMsg.h:24
static unsigned char flags(const void *buffer)
Extracts the message flags form the given buffer.

Document ID: Generated on Sun Jul 20 16:15:30 EDT 2025 from SVN revision 277985
Copyright © 2005-2025 MAK Technologies Inc. All Rights Reserved (www.mak.com)