open-dis-cpp
SignalPdu.h
1 #pragma once
2 
3 #include "dis6/RadioCommunicationsFamilyPdu.h"
4 #include "dis6/opendis6_export.h"
5 #include "dis6/utils/DataStream.h"
6 #include <cstdint>
7 #include <vector>
8 
9 namespace DIS
10 {
11  // Section 5.3.8.2. Detailed information about a radio transmitter. This PDU
12  // requires manually written code to complete. The encodingScheme field
13  // can be used in multiple ways, which requires hand-written code to
14  // finish. UNFINISHED
15 
16  // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All
17  // rights reserved.
18  //
19  // @author DMcG, jkg
20 
21  class OPENDIS6_EXPORT SignalPdu : public RadioCommunicationsFamilyPdu
22  {
23  protected:
25  unsigned short _encodingScheme;
26 
28  unsigned short _tdlType;
29 
31  unsigned int _sampleRate;
32 
34  short _dataLength;
35 
37  short _samples;
38 
40  std::vector<uint8_t> _data;
41 
42  public:
43  SignalPdu();
44  virtual ~SignalPdu();
45 
46  virtual void marshal(DataStream &dataStream) const;
47  virtual void unmarshal(DataStream &dataStream);
48 
49  unsigned short getEncodingScheme() const;
50  void setEncodingScheme(unsigned short pX);
51 
52  unsigned short getTdlType() const;
53  void setTdlType(unsigned short pX);
54 
55  unsigned int getSampleRate() const;
56  void setSampleRate(unsigned int pX);
57 
58  short getDataLength() const;
59  void setDataLength(short pX);
60 
61  short getSamples() const;
62  void setSamples(short pX);
63 
64  std::vector<uint8_t> &getData();
65  const std::vector<uint8_t> &getData() const;
66  void setData(const std::vector<uint8_t> &pX);
67 
68  virtual int getMarshalledSize() const;
69 
70  bool operator==(const SignalPdu &rhs) const;
71  };
72 } // namespace DIS
73 
74 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
75 // Redistribution and use in source and binary forms, with or without
76 // modification, are permitted provided that the following conditions
77 // are met:
78 //
79 // * Redistributions of source code must retain the above copyright
80 // notice, this list of conditions and the following disclaimer.
81 // * Redistributions in binary form must reproduce the above copyright
82 // notice, this list of conditions and the following disclaimer
83 // in the documentation and/or other materials provided with the
84 // distribution.
85 // * Neither the names of the Naval Postgraduate School (NPS)
86 // Modeling Virtual Environments and Simulation (MOVES) Institute
87 // (http://www.nps.edu and http://www.MovesInstitute.org)
88 // nor the names of its contributors may be used to endorse or
89 // promote products derived from this software without specific
90 // prior written permission.
91 //
92 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
93 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
94 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
95 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
96 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
97 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
98 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
100 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
101 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
102 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
103 // POSSIBILITY OF SUCH DAMAGE.
short _dataLength
length od data
Definition: SignalPdu.h:34
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
unsigned short _encodingScheme
encoding scheme used, and enumeration
Definition: SignalPdu.h:25
Definition: RadioCommunicationsFamilyPdu.h:17
Definition: SignalPdu.h:21
a class to support managing a network buffer.
Definition: DataStream.h:28
short _samples
number of samples
Definition: SignalPdu.h:37
unsigned short _tdlType
tdl type
Definition: SignalPdu.h:28
std::vector< uint8_t > _data
list of eight bit values
Definition: SignalPdu.h:40
unsigned int _sampleRate
sample rate
Definition: SignalPdu.h:31