VR-Link API Documentation for DIS
diGuyCustomPdu.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 
6 #ifndef bdiCustomPdu_H_
7 #define bdiCustomPdu_H_
8 
9 #if DtDIS
10 
11 #include <vl/dStateMsg.h>
12 #include <vl/dExerciseConn.h>
13 #include <vlpi/entityIdentifier.h>
14 
15 
17 typedef struct DtNetDIGuyCustomPdu
18 {
26 
29 {
35 };
36 
37 class DtDIGuyCustomPdu;
38 
41 typedef void (*DtDIGuyCustomPduCb)(DtDIGuyCustomPdu* pdu, void* usr);
42 
47 {
48 public:
50  enum { PduStaticSize = 23 };
51 
52 public:
56 
60 
62  virtual ~DtDIGuyCustomPdu();
63 
65  DtDIGuyCustomPdu(const DtDIGuyCustomPdu& other);
66 
69 
70  //{@
72  virtual DtNetDIGuyCustomPdu* netDIGuyCustomPdu();
73  virtual const DtNetDIGuyCustomPdu* netDIGuyCustomPdu() const;
75 
76  // MJI - I think this should always be 7, according to the SDK
77  // User's Guide. Going to set it to 7 by default for now, and
78  // this probably shouldn't be changed.
79  //{@
82  virtual void setMessageVersion(int version);
83  virtual int messageVersion() const;
85 
86  //{@
88  virtual void setMessageId(DtDIGuyCustomPduMsgId msgId);
89  virtual DtDIGuyCustomPduMsgId messageId() const;
91 
92  //{@
94  virtual void setEntityId(const DtEntityIdentifier& entId);
95  virtual DtEntityIdentifier entityId() const;
97 
98  //{@
100  virtual void setDataSize(unsigned int size);
101  virtual unsigned int dataSize() const;
103 
107  virtual void addShort(short value);
108 
112  virtual void addLong(long value);
113 
117  virtual void addFloat(float value);
118 
123  virtual void addString(const DtString& str);
124 
125  //{@
138  virtual bool pullShort(short& value, unsigned int& byteoffset) const;
139  virtual bool pullLong(long& value, unsigned int& byteoffset) const;
140  virtual bool pullFloat(float& value, unsigned int& byteoffset) const;
141  virtual bool pullString(DtString& value, unsigned int& byteoffset) const;
143 
144  //{@
146  virtual void getData(unsigned char* buff) const;
147  virtual void* data();
148  void setData(unsigned char* data, int numBytes);
150 
152  virtual void printData() const;
153 
155  virtual void printDataToStream(std::ostream& stream) const;
156 
157 
158 public:
160  static DtPdu* create(const DtNetPacket* initial,
162 
164  static void addCallback(DtExerciseConn* conn, DtDIGuyCustomPduCb cb,
165  void* usr);
166 
168  static void removeCallback(DtExerciseConn* conn, DtDIGuyCustomPduCb cb,
169  void* usr);
170 
175  static void setCustomPduKind(DtPduKind pduKind);
176  static DtPduKind customPduKind();
177 
178 protected:
179  virtual DtPduKind internalGetPduKind() const;
180 
181 protected:
183 };
184 
185 
186 #endif
187 #endif
188 
189 

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)