VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
testPdu.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
5 #pragma once
6 
7 #if DtDIS
8 
9 #include <vl/pdu.h>
10 #include <vl/exerciseConnDIS.h>
11 
16 
25 typedef struct NetTestPdu
26 {
30 } NetTestPdu;
31 
36 
40 class TestPdu;
42 typedef void (*TestPduCb)(TestPdu* pdu, void* usr);
43 
46 class TestPdu : public DtPdu
47 {
48 public:
49 
53 
59  TestPdu(const NetTestPdu *initial,
60  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
61 
64  virtual ~TestPdu();
65 
69  TestPdu(const TestPdu& orig);
70 
74  TestPdu& operator=(const TestPdu& orig);
75 
79  virtual void printData() const;
80 
85 
87  virtual void setA(int val);
88  virtual int a() const;
89 
93  virtual void setB(int index, int val);
94  virtual int b(int index) const;
95 
97  virtual void setC(float val);
98  virtual float c() const;
99 
104  virtual NetTestPdu* netTestPdu();
105  virtual const NetTestPdu* netTestPdu() const;
106 
107 public:
108 
114  static DtPdu* create(const DtNetPacket *initial,
115  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
116 
125  static void addCallback(DtExerciseConn *conn, TestPduCb cb, void *usr);
126  static void removeCallback(DtExerciseConn *conn, TestPduCb cb, void *usr);
127 
128 protected:
129 
133  virtual DtPduKind internalGetPduKind() const;
134 };
135 
136 #endif
virtual void setA(int val)
Inspector and mutator functions for the PDU class&#39; data.
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:61
DtNetPduHeader header
Definition: testPdu.h:27
virtual ~TestPdu()
Destructor - Not required by VR-Link, but should clearly be written if this class has any dynamic dat...
TestPdu & operator=(const TestPdu &orig)
Assignment operator.
virtual float c() const
static void removeCallback(DtExerciseConn *conn, TestPduCb cb, void *usr)
Definition: pduHeader.h:14
The TestPdu class will represent a hypothetical variable-length &quot;Test PDU&quot;.
Definition: testPdu.h:25
class DtPduFactory:
Definition: pduFactory.h:38
struct NetTestPdu NetTestPdu
The TestPdu class will represent a hypothetical variable-length &quot;Test PDU&quot;.
virtual void setB(int index, int val)
Set/Get the index&#39;th element of the &quot;b&quot; array.
static DtPdu * create(const DtNetPacket *initial, DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER, DtPduFactory *pduFactory=0)
Create and return a new TestPdu.
static void addCallback(DtExerciseConn *conn, TestPduCb cb, void *usr)
Wrappers around DtExerciseConn&#39;s add/removeCallback functions.
virtual void setC(float val)
Set/Get the value of c.
Define the TestPdu class.
Definition: testPdu.h:46
DtPdu is the base class for all PDU&#39;s in VR-Link.
Definition: pdu.h:69
TestPdu(DtBufferPtr buffer=DtUSE_INTERNAL_BUFFER)
Blank constructor - constructs a blank TestPdu ready to be filled out and sent by application code...
const DtPduKind TestPduKind
Extend the DtPduKind enumeration, adding our chosen value.
Definition: testPdu.h:35
struct DtBufferPlaceHolder * DtBufferPtr
Definition: vlBaseMsg.h:17
#define DtUSE_INTERNAL_BUFFER
Definition: vlBaseMsg.h:22
virtual int a() const
void(* TestPduCb)(TestPdu *pdu, void *usr)
Definition: testPdu.h:42
virtual NetTestPdu * netTestPdu()
Returns a pointer to the PDU&#39;s network representation by casting the value returned by the base class...
virtual void printData() const
Virtual function override.
DtPduKind
([UID 4]) - PDU Type
Definition: disEnums.h:238
virtual int b(int index) const
Network-order signed 32-bit quantity.
Definition: vlNetTypes.h:123
virtual DtPduKind internalGetPduKind() const
Virtual function override.
DtNetInt32 a
Definition: testPdu.h:28
DtNetInt32 b[1]
Definition: testPdu.h:29

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)