KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IOCommunicationsNode.h
Go to the documentation of this file.
1 /*********************************************************************
2 Copyright 2013 Karl Jones
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7 
8 1. Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation
12  and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 For Further Information Please Contact me at
26 Karljj1@yahoo.com
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
29 
30 /********************************************************************
31  class: IOCommunicationsNode
32  created: 21/11/2010
33  author: Karl Jones
34 
35  purpose: Identifies a communications node entity that is part of a
36  simulated communications network.
37  size: 128 bits / 16 octets
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./StandardVariable.h"
43 #include "./CommunicationsNodeID.h"
44 
45 namespace KDIS {
46 namespace DATA_TYPE {
47 
49 {
50 protected:
51 
53 
55 
57 
58 public:
59 
60  static const KUINT16 IO_COMMUNICATIONS_NODE_SIZE = 16;
61 
63 
64  IOCommunicationsNode( KDataStream & stream ) throw( KException );
65 
67 
68  virtual ~IOCommunicationsNode();
69 
70  //************************************
71  // FullName: KDIS::DATA_TYPE::IOCommunicationsNode::SetIOCommunicationsNodeType
72  // KDIS::DATA_TYPE::IOCommunicationsNode::GetIOCommunicationsNodeType
73  //!Description: The type of communication node.
74  // Parameter: IOCommunicationsNodeType T
75  //************************************
76  void SetIOCommunicationsNodeType( KDIS::DATA_TYPE::ENUMS::IOCommunicationsNodeType T );
77  KDIS::DATA_TYPE::ENUMS::IOCommunicationsNodeType GetIOCommunicationsNodeType() const;
78 
79  //************************************
80  // FullName: KDIS::DATA_TYPE::IOCommunicationsNode::SetCommunicationsNodeID
81  // KDIS::DATA_TYPE::IOCommunicationsNode::GetCommunicationsNodeID
82  //!Description: The type of communication node.
83  // Parameter: const CommunicationsNodeID & ID
84  //************************************
85  void SetCommunicationsNodeID( const CommunicationsNodeID & ID );
86  const CommunicationsNodeID & GetCommunicationsNodeID() const;
87  CommunicationsNodeID & GetCommunicationsNodeID();
88 
89  //************************************
90  // FullName: KDIS::DATA_TYPE::IOCommunicationsNode::GetAsString
91  //!Description: Returns a string representation.
92  //************************************
93  virtual KString GetAsString() const;
94 
95  //************************************
96  // FullName: KDIS::DATA_TYPE::IOCommunicationsNode::Decode
97  //!Description: Convert From Network Data.
98  // Parameter: KDataStream & stream
99  //************************************
100  virtual void Decode( KDataStream & stream ) throw( KException );
101 
102  //************************************
103  // FullName: KDIS::DATA_TYPE::IOCommunicationsNode::Encode
104  //!Description: Convert To Network Data.
105  // Parameter: KDataStream & stream
106  //************************************
107  virtual KDataStream Encode() const;
108  virtual void Encode( KDataStream & stream ) const;
109 
110  KBOOL operator == ( const IOCommunicationsNode & Value ) const;
111  KBOOL operator != ( const IOCommunicationsNode & Value ) const;
112 };
113 
114 } // END namespace DATA_TYPES
115 } // END namespace KDIS
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: StandardVariable.h:62
KUINT8 m_ui8Padding
Definition: IOCommunicationsNode.h:54
Definition: IOCommunicationsNode.h:48
Definition: KDefines.h:182
Definition: KDataStream.h:48
CommunicationsNodeID m_CommID
Definition: IOCommunicationsNode.h:56
bool KBOOL
Definition: KDefines.h:119
IOCommunicationsNodeType
Definition: EnumInformationOperations.h:140
Definition: CommunicationsNodeID.h:50
std::string KString
Definition: KDefines.h:116
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT8 m_ui8CommNodeTyp
Definition: IOCommunicationsNode.h:52