KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IO_Header.h
Go to the documentation of this file.
1 /*********************************************************************
2 
3 Copyright 2013 Karl Jones
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8 
9 1. Redistributions of source code must retain the above copyright notice, this
10  list of conditions and the following disclaimer.
11 2. Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 For Further Information Please Contact me at
27 Karljj1@yahoo.com
28 http://p.sf.net/kdis/UserGuide
29 *********************************************************************/
30 
31 /********************************************************************
32  class: IO_Header
33  DIS: (7) 1278.1-2012
34  created: 12/11/2010
35  author: Karl Jones
36 
37  purpose: Contains common fields found in information operations PDU.
38  Information operations (IO) are the integrated employment of electronic warfare (EW),
39  computer network operations (CNO), psychological operations (PSYOP),
40  military deception (MILDEC), and operations security (OPSEC), along with
41  specific supporting capabilities, to influence, disrupt, corrupt, or otherwise
42  affect enemy information and decision making while protecting friendly information
43  operations.
44 
45  Size: 144 bits / 18 octets
46 *********************************************************************/
47 
48 #pragma once
49 
50 #include "./../Header.h"
51 #include "./../../DataTypes/EntityIdentifier.h"
52 #include "./../../DataTypes/StandardVariable.h"
53 #include "./../../Extras/KRef_Ptr.h"
54 
55 namespace KDIS {
56 namespace PDU {
57 
59 {
60 protected:
61 
63 
64 public:
65 
66  static const KUINT16 IO_HEADER_SIZE = 18;
67 
68  IO_Header();
69 
70  IO_Header( const Header & H );
71 
72  IO_Header( KDataStream & stream ) throw( KException );
73 
74  IO_Header( const Header & H, KDataStream & stream ) throw( KException );
75 
77 
78  virtual ~IO_Header();
79 
80  //************************************
81  // FullName: KDIS::PDU::IO_Header::SetOriginatingEntityID
82  // KDIS::PDU::IO_Header::GetOriginatingEntityID
83  //!Description: Originating Entity ID, the simulation that is issuing the PDU.
84  // Parameter: const EntityIdentifier & ID
85  //************************************
86  void SetOriginatingEntityID ( const KDIS::DATA_TYPE::EntityIdentifier & ID );
87  const KDIS::DATA_TYPE::EntityIdentifier & GetOriginatingEntityID() const;
88  KDIS::DATA_TYPE::EntityIdentifier & GetOriginatingEntityID();
89 
90  //************************************
91  // FullName: KDIS::PDU::IO_Header::GetAsString
92  //!Description: Returns a string representation of the PDU.
93  //************************************
94  virtual KString GetAsString() const;
95 
96  //************************************
97  // FullName: KDIS::PDU::IO_Header::Decode
98  //!Description: Convert From Network Data.
99  // Parameter: KDataStream & stream
100  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
101  //************************************
102  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
103 
104  //************************************
105  // FullName: KDIS::PDU::IO_Header::Encode
106  //!Description: Convert To Network Data.
107  // Parameter: KDataStream & stream
108  //************************************
109  virtual KDataStream Encode() const;
110  virtual void Encode( KDataStream & stream ) const;
111 
112  KBOOL operator == ( const IO_Header & Value ) const;
113  KBOOL operator != ( const IO_Header & Value ) const;
114 };
115 
116 } // END namespace PDU
117 } // END namespace KDIS
KDIS::DATA_TYPE::EntityIdentifier m_OriginatingEntityID
Definition: IO_Header.h:62
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: IO_Header.h:58
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: EntityIdentifier.h:49
Definition: Header7.h:142
#define KDIS_EXPORT
Definition: KDefines.h:82