MAK RTIspy API Documentation for HLA 1.3
ownerMsg.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: ownerMsg.h,v $ $Revision: 1.17 $ $State: Exp $
7 *********************************************************************/
8 
11 
12 #ifndef DtOwnershipMsg_H_
13 #define DtOwnershipMsg_H_
14 
15 #include "rtiMsConfig.h"
16 #include "rtiMsg.h"
17 #include "netOwnerMsg.h"
18 #include "attrHandSet.h"
19 
20 class DtConnectionMgr;
21 class DtOwnershipMsg;
22 typedef void (*DtOwnershipCb)(const DtOwnershipMsg& msg, void* usr);
23 
25 {
43 };
44 
46 {
47 public:
48 
50  DtOwnershipMsg(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
51 
54  DtOwnerMsgKind kind,
55  DtObjectInstanceHandle objHand,
56  const DtAttributeHandleSet& attrs,
57  DtFederateHandle targetFed = 0,
58 #ifdef DtIFSPEC1516
59  rti1516::VariableLengthData const& theTag=theDefaultTag,
60 #elif defined(DtIFSPEC1516E)
61  rti1516e::VariableLengthData const& theTag=theDefaultTag,
62 #else
63  char const * theTag=NULL,
64 #endif
65  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
66 
69  DtOwnerMsgKind kind,
70  DtObjectInstanceHandle objHand,
71  const DtAttributeHandle attr,
72  DtFederateHandle targetFed = 0,
73 #ifdef DtIFSPEC1516
74  rti1516::VariableLengthData const& theTag=theDefaultTag,
75 #elif defined(DtIFSPEC1516E)
76  rti1516e::VariableLengthData const& theTag=theDefaultTag,
77 #else
78  char const * theTag=NULL,
79 #endif
80  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
81 
83  DtOwnershipMsg(const DtNetOwnershipMsg* netRepMsg,
84  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
85 
87  virtual ~DtOwnershipMsg();
88 
90  virtual DtRtiMsg* clone(bool copy = true) const;
91 
93  virtual void set(
94  DtOwnerMsgKind kind,
95  DtObjectInstanceHandle objHand,
96  const DtAttributeHandleSet& attrs,
97  DtFederateHandle targetFed = 0,
98 #ifdef DtIFSPEC1516
100 #elif defined(DtIFSPEC1516E)
102 #else
103  char const * theTag=theDefaultTag);
104 #endif
105 
106  virtual void set (
107  DtOwnerMsgKind kind,
108  DtObjectInstanceHandle objHand,
109  const DtAttributeHandle attr,
110  DtFederateHandle targetFed = 0,
111 #ifdef DtIFSPEC1516
113 #elif defined(DtIFSPEC1516E)
115 #else
116  char const * theTag=theDefaultTag);
117 #endif
118 
120  virtual void setOwnerMsgKind(DtOwnerMsgKind kind);
121  virtual DtOwnerMsgKind ownerMsgKind() const;
122 
124  virtual void setObjHandle(DtObjectInstanceHandle id);
125  virtual DtObjectInstanceHandle objHandle() const;
126 
128  virtual void setClassHandle(DtObjectClassHandle handle);
129  virtual DtObjectClassHandle classHandle() const;
130 
132 #ifdef DtIFSPEC1516
133  virtual void setTag(rti1516::VariableLengthData const& tag);
134  virtual rti1516::VariableLengthData const& tag() const;
135 #elif defined(DtIFSPEC1516E)
136  virtual void setTag(rti1516e::VariableLengthData const& tag);
137  virtual rti1516e::VariableLengthData const& tag() const;
138 #else
139  virtual void setTag(char const * tag);
140  virtual char const * tag() const;
141 #endif
142 
144  virtual void setRecipientFederate(DtFederateHandle hand);
145  virtual DtFederateHandle recipientFederate() const;
146 
148  virtual void setAttrHandles(const DtAttributeHandleSet& attrs);
149  virtual const DtAttributeHandleSet& attrHandles() const;
150 
152  virtual void printData(DtLogicalTimeFactory* logicalTimeFactory) const;
153 
154 public:
155 
157  static DtRtiMsg* create(const DtNetMsgHeader* initial,
158  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
159 
161  static DtRtiMsg* create(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
162 
164  static void addCallback(DtConnectionMgr *conn,
165  DtOwnershipCb cb, void *usr);
166  static void removeCallback(DtConnectionMgr *conn,
167  DtOwnershipCb cb, void *usr);
168 
169 protected:
170 
172  virtual char* tagPtr();
173 
175  virtual int tagFieldSize() const;
176 
178  virtual DtNetOwnershipMsg* netOwnershipMsg();
179  virtual const DtNetOwnershipMsg* netOwnershipMsg() const;
180 
183 
185  virtual int minSize() const;
186 
188  virtual DtOwnershipMsg* self() const;
189 
190 protected:
191 
192  int myDirty;
194 #ifdef DtIFSPEC1516
196 #elif defined(DtIFSPEC1516E)
198 #else
199  char* myTag;
200 #endif
201 };
202 
203 
205 {
206  return const_cast<DtOwnershipMsg*>( this );
207 }
208 
209 #endif
210 

Document ID: Generated on Tue May 7 16:26:47 EDT 2013 from SVN revision 126903
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)