VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
timeAndDatePdu.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
5 
8 
9 #pragma once
10 
11 #if DtDIS
12 
13 #include <vl/packets/aerodromeP.h>
14 #include <vlutil/vlMachineTypes.h>
15 #include <vl/stateMsg.h>
16 #include <vl/exerciseConn.h>
17 #include <vlutil/vlUuid.h>
18 #include <vlpi/aerodromeEnums.h>
19 
20 
21 
22 class DtTimeAndDatePdu;
23 
25 typedef void (*DtTimeAndDatePduCb)(DtTimeAndDatePdu* pdu, void* usr);
26 
29 class DT_DLL_VL DtTimeAndDatePdu : public DtStateMsg
30 {
31 public:
33  DtTimeAndDatePdu(DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER);
34  DtTimeAndDatePdu(const DtNetPacket* initial,
35  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
36 
37 
39  virtual ~DtTimeAndDatePdu();
40 
41 private:
43  DtTimeAndDatePdu(const DtTimeAndDatePdu& orig);
44 
46  DtTimeAndDatePdu& operator=(const DtTimeAndDatePdu& orig);
47 
48 public:
49 
51  virtual void setVersion(DtU16 val);
53  virtual DtU16 version() const;
54 
56  virtual void setSimulationIdentifier(DtEntityIdentifier identifier);
57 
59  virtual const DtEntityIdentifier simulationIdentifier() const;
60 
62  virtual void setTimeAndDate(const DtTime time);
63 
65  virtual DtTime timeAndDate() const;
66 
68  virtual void setTimeOfDayAdvancementSpeed(double speed);
69 
71  virtual double timeOfDayAdvancementSpeed() const;
72 
74  virtual void setSunPositionLockedToObserver(bool locked);
75 
77  virtual bool sunPositionLockedToObserver() const;
78 
80  void printData() const;
81  void printDataToStream(std::ostream& stream) const;
82 
83  // Returns a unique Key for this PDU class to be used with
84  // reflected objects and reflected lists. Because the Entity ID
85  // may not be unique, this should be a combination of the minimal
86  // number of attributes required for uniqueness.
87  DtString uniqueKey() const;
88 public:
89 
92  static DtPdu* create(const DtNetPduHeader *initial,
93  DtBufferPtr buffer = DtUSE_INTERNAL_BUFFER, DtPduFactory* pduFactory = 0);
94 
97  static void addCallback(DtExerciseConn* conn,
98  DtTimeAndDatePduCb cb, void* usr);
99  static void removeCallback(DtExerciseConn* conn,
100  DtTimeAndDatePduCb cb, void* usr);
101 
102 protected:
103 
104  // Returns the number of bytes in the fixed length portion of this PDU
105  // This is the initial size of the PDU before any variabe datums are added
106  virtual unsigned int fixedBytesSize() const;
107  // A pointer to the first byte of variable datums. If there are no variable
108  // datums this points to the first byte out-of-bounds. This address should
109  // only be used if you know the PDU has been resized correctly.
110  virtual char *firstVarDatumStart() const;
111  static DtPduKind internalGetPduKindImpl() {return DtTimeAndDatePduKind;}
112  DtPduKind internalGetPduKind() const {return internalGetPduKindImpl();}
113 
114 };
115 
116 
117 
118 #endif
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnHLA.h:61
#define DT_DLL_VL
Definition: vlMachineTypes.h:108
Definition: pduHeader.h:14
DtStateMsg & operator=(const DtStateMsg &orig)
assignment operator
DtPdu is the base class for all PDU&#39;s in VR-Link.
Definition: pdu.h:69
Instances of DtEntityIdentifier are used as a unique ID for entities in DIS.
Definition: entityIdentifier.h:31
This file provides protocol to independence DtExerciseConn.
struct DtBufferPlaceHolder * DtBufferPtr
Definition: vlBaseMsg.h:17
unsigned short DtU16
A 16 bit unsigned integer value.
Definition: vlMachineTypes.h:140
#define DtUSE_INTERNAL_BUFFER
Definition: vlBaseMsg.h:22
DtReal DtTime
A definition of DtTime.
Definition: vlTime.h:19
DtPduKind
([UID 4]) - PDU Type
Definition: disEnums.h:238
Instances of DtString are used to represent strings.
Definition: vlString.h:29
class DtStateMsg:
Definition: stateMsgHLA.h:32
Contains the DtVrlUuid class declaration/definition.
This file contains typedefs for machine dependant types.
Definition: disEnums.h:324

Document ID: Generated on Wed Mar 27 02:04:30 EDT 2024 from SVN revision 264570
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)