VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stateEncoder.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2025 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #ifndef stateEncoder_H_
11 #define stateEncoder_H_
12 
13 #if DtDIS
14 
15 #include <vlutil/vlMachineTypes.h>
16 #include <vl/pduEncoder.h>
17 
18 #define DtStateChange_FORCE 0x0001
19 #define DtStateChange_OTHER 0x0002
20 #define DtStateChange_ATTRIBUTES 0x0004
21 
22 class DtEntityIdentifier;
23 class DtPdu;
24 class DtStateRepository;
25 
26 #define DtCLONE_ENCODER(encoderClass) \
27  virtual DtPduEncoder* clone() const \
28 { \
29  return new encoderClass(*this); \
30 }
31 
33 class DT_DLL_VL DtStateEncoder : public DtPduEncoder
34 {
35 public:
37  DtStateEncoder();
38 
40  virtual ~DtStateEncoder();
41 
43  DtStateEncoder(const DtStateEncoder& orig);
44 
46  DtStateEncoder& operator=(const DtStateEncoder& orig);
47 
49  virtual void setSendNeeded();
50 
51  virtual DtU32 changedState() const { return myChangedState; }
52  virtual void clearChangedState() { myChangedState = 0; }
53  virtual bool isChangedStateBit(DtU32 st) const { return myChangedState & st; }
54  virtual void resetChangedStateBit(DtU32 st) { myChangedState &= ~st; }
55  virtual void setChangedStateBit(DtU32 st) { myChangedState |= st; }
56 
59  virtual DtPduEncoder* clone() const = 0;
60 
62  virtual void encode(DtPdu * pdu);
63 
66  virtual void fillOutAttributeRecords(
67  const DtStateRepository& stateRep,
68  DtPduWithAttributeRecordSets* pdu,
69  const DtEntityIdentifier& id, bool clearBeforeAdding = true );
70 
73  virtual bool sendNeededAttributeRecords(
74  const DtStateRepository& stateRep,
75  const DtStateRepository& asSeenByRemote);
76 
77 protected:
78  bool myForceSendNeeded;
79  DtU32 myChangedState;
80 };
81 
82 #endif
83 #endif
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
virtual void encode(DtPdu *pdu)=0
The DtPduEncoder class provides a base class for all DIS encoders.
Definition: pduEncoder.h:18
DtPdu is the base class for all PDU&#39;s in VR-Link.
Definition: pdu.h:69
DtStateRepository is an abstract base class for maintaining state for an object.
Definition: stateRepository.h:50
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
This file declares the DtPduEncoder.
virtual DtPduEncoder * clone() const =0
unsigned long DtU32
A 32 bit unsigned integer value.
Definition: vlMachineTypes.h:153
This file contains typedefs for machine dependant types.

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)