MAK RTIspy API Documentation for HLA 1.3
syncPointMsg.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: syncPointMsg.h,v $ $Revision: 1.25 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtSyncPointMsg_H_
13 #define DtSyncPointMsg_H_
14 
15 #include "rtiMsg.h"
16 #include <vlutil/vlUtil.h>
17 #include "netSyncMsg.h"
18 
19 class DtConnectionMgr;
20 class DtSyncPointMsg;
22 
23 typedef void (*DtSyncPointCb)(const DtSyncPointMsg& msg, void* usr);
24 
26 {
34 };
35 
37 {
44 };
45 
47 {
48 public:
49 
51  DtSyncPointMsg(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
52 
54  DtSyncMsgType kind,
56  DtSyncPointStatus statusValue,
57  char const * name,
58 #ifdef DtIFSPEC1516
59  rti1516::VariableLengthData const* tag,
60 #elif defined(DtIFSPEC1516E)
62 #else
63  char const * tag,
64 #endif
65  const DtFederateHandleSet* set = NULL,
66  const DtFederateHandleSet* unsuccessfulSet = NULL,
67  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
68 
70  DtSyncPointMsg(const DtNetSyncMsg* netRepMsg,
71  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
72 
74  virtual ~DtSyncPointMsg();
75 
77  virtual DtRtiMsg* clone(bool copy = true) const;
78 
80  virtual void set(
81  DtSyncMsgType kind,
83  DtSyncPointStatus statusValue,
84  char const * name,
85 #ifdef DtIFSPEC1516
86  rti1516::VariableLengthData const* tag,
87 #elif defined(DtIFSPEC1516E)
89 #else
90  char const * tag,
91 #endif
92  DtFederateHandleSet const* set = NULL,
93  DtFederateHandleSet const* unsuccessfulSet = NULL);
94 
96  virtual void setSyncMsgKind(DtSyncMsgType kind);
97  virtual DtSyncMsgType syncMsgKind() const;
98 
100  virtual void setFederateId(DtFederateHandle id);
101  virtual DtFederateHandle federateId() const;
102 
104  virtual void setSyncPointStatus(DtSyncPointStatus statusValue);
105  virtual DtSyncPointStatus syncPointStatus() const;
106 
108  virtual void setSyncPointName(char const * name);
109  virtual char const * syncPointName() const;
110 
112 #ifdef DtIFSPEC1516
113  virtual void setTag(rti1516::VariableLengthData const* tag);
114  virtual rti1516::VariableLengthData const* tag() const;
115 #elif defined(DtIFSPEC1516E)
116  virtual void setTag(rti1516e::VariableLengthData const* tag);
117  virtual rti1516e::VariableLengthData const* tag() const;
118 #else
119  virtual void setTag(char const * tag);
120  virtual char const * tag() const;
121 #endif
122 
124  virtual void setFederates(const DtFederateHandleSet* set);
125 
129  virtual DtFederateHandleSet const * federates() const;
130 
134  virtual void getFederates(DtFederateHandleSet* set) const;
135 
137  virtual int numFederates() const;
138 
142  virtual void getUnsuccessfulFederates(DtFederateHandleSet* set) const;
143 
146  virtual void setUnsuccessfulFederates(const DtFederateHandleSet* set);
147 
151  virtual DtFederateHandleSet const * unsuccessfulFederates() const;
152 
154  virtual int numUnsuccessfulFederates() const;
155 
157  virtual void printData(DtLogicalTimeFactory* logicalTimeFactory) const;
158 
159 public:
160 
162  static DtRtiMsg* create(const DtNetMsgHeader* initial,
163  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
164 
166  static DtRtiMsg* create(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
167 
169  static void addCallback(DtConnectionMgr *conn,
170  DtSyncPointCb cb, void *usr);
171  static void removeCallback(DtConnectionMgr *conn,
172  DtSyncPointCb cb, void *usr);
173 
174 protected:
175 
177  virtual DtNetSyncMsg* netSyncMsg();
178  virtual const DtNetSyncMsg* netSyncMsg() const;
179 
181  virtual DtNetU32* handleArray();
182  virtual DtNetU32* unsuccessfulHandleArray();
183  virtual char* tagPtr();
184  virtual char* namePtr();
185 
187  virtual int handleArraySize() const;
188  virtual int unsuccessfulHandleArraySize() const;
189  virtual int tagFieldSize() const;
190  virtual int nameFieldSize() const;
191 
194 
196  virtual int minSize() const;
197 
199  DtSyncPointMsg* self() const;
200 
201 protected:
202 
203 #ifdef DtIFSPEC1516
205 #elif defined(DtIFSPEC1516E)
207 #else
208  char* myTag;
209 #endif
210  MAKRti::DtString myName;
213 };
214 
216 {
217  return const_cast<DtSyncPointMsg*>( this );
218 }
219 
220 #endif
221 
222 
223 
224 
225 
226 
227 
228 
229 
230 
231 

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)