KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CommunicationsChannelType.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: CommunicationsChannelType
32  created: 2009/01/24
33  author: Karl Jones
34 
35  purpose: Identifies the type of communications channel
36  size: 8 bits / 1 octets
37 *********************************************************************/
38 
39 #pragma once
40 
41 #include "./DataTypeBase.h"
42 
43 namespace KDIS {
44 namespace DATA_TYPE {
45 
47 {
48 protected:
49 
50  union
51  {
52  struct
53  {
54  KUINT8 m_ui8Type : 7;
55  KUINT8 m_ui8Class : 1;
56  };
57 
59  };
60 
61 public:
62 
63  static const KUINT16 COMM_CHANNEL_TYPE_SIZE = 1;
64 
66 
68 
70 
71  virtual ~CommunicationsChannelType();
72 
73  //************************************
74  // FullName: KDIS::DATA_TYPE::CommunicationsChannelType::SetType
75  // KDIS::DATA_TYPE::CommunicationsChannelType::GetType
76  //!Description: Type of channel.
77  // Parameter: ChannelType CT, void
78  //************************************
79  void SetType( KDIS::DATA_TYPE::ENUMS::ChannelType CT );
81 
82  //************************************
83  // FullName: KDIS::DATA_TYPE::CommunicationsChannelType::SetClass
84  // KDIS::DATA_TYPE::CommunicationsChannelType::GetClass
85  //!Description: Communications class.
86  // Parameter: ChannelClass CC, void
87  //************************************
88  void SetClass( KDIS::DATA_TYPE::ENUMS::ChannelClass CC );
89  KDIS::DATA_TYPE::ENUMS::ChannelClass GetClass() const;
90 
91  //************************************
92  // FullName: KDIS::DATA_TYPE::CommunicationsChannelType::GetAsString
93  //!Description: Returns a string representation
94  //************************************
95  virtual KString GetAsString() const;
96 
97  //************************************
98  // FullName: KDIS::DATA_TYPE::CommunicationsChannelType::Decode
99  //!Description: Convert From Network Data.
100  // Parameter: KDataStream & stream
101  //************************************
102  virtual void Decode( KDataStream & stream ) throw( KException );
103 
104  //************************************
105  // FullName: KDIS::DATA_TYPE::CommunicationsChannelType::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 CommunicationsChannelType & Value ) const;
113  KBOOL operator != ( const CommunicationsChannelType & Value ) const;
114 };
115 
116 } // END namespace DATA_TYPES
117 } // END namespace KDIS
118 
ChannelType
Definition: EnumRadio.h:462
Definition: CommunicationsChannelType.h:46
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8CommChannelType
Definition: CommunicationsChannelType.h:58
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
ChannelClass
Definition: EnumRadio.h:477