KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IntercomCommunicationParameters.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: IntercomCommunicationParameters
32  created: 2009/02/01
33  author: Karl Jones
34 
35  purpose: Additional parameters for the Intercom Control PDU.
36  size: 4 bits / 4 octets - header only
37 *********************************************************************/
38 
39 #pragma once
40 
41 #include "./DataTypeBase.h"
45 
46 namespace KDIS {
47 namespace DATA_TYPE {
48 
50 {
51 protected:
52 
54 
56 
58 
59  KBOOL m_bMemoryManage; // If we create the pointer we should delete it
60 
61 public:
62 
63  static const KUINT16 INTERCOM_COMMS_PARAM_SIZE = 4;
64 
66 
68 
70 
72 
74 
76 
77  //************************************
78  // FullName: KDIS::DATA_TYPE::IntercomCommunicationParameters::GetRecordType
79  //!Description: Identifies the additional parameters type.
80  //************************************
82 
83  //************************************
84  // FullName: KDIS::DATA_TYPE::IntercomCommunicationParameters::GetLength
85  //!Description: Length of the RECORD parameters, does not include size of type and
86  //! length field.
87  //************************************
88  KUINT16 GetLength() const;
89 
90  //************************************
91  // FullName: KDIS::DATA_TYPE::IntercomCommunicationParameters::SetRecord
92  // KDIS::DATA_TYPE::IntercomCommunicationParameters::GetRecord
93  //!Description: Set the record. GetRecord will return NULL if no record is stored.
94  //! Use GetType to know what record type to cast the returned pointer to.
95  // Parameter: ...Record *
96  //************************************
97  void SetRecord( EntityDestinationRecord * EDR );
98  void SetRecord( GroupDestinationRecord * GDR );
99  void SetRecord( GroupAssignmentRecord * GAR );
100  const DataTypeBase * GetRecord() const;
101  DataTypeBase * GetRecord();
102 
103  //************************************
104  // FullName: KDIS::DATA_TYPE::IntercomCommunicationParameters::GetAsString
105  //!Description: Returns a string representation
106  //************************************
107  virtual KString GetAsString() const;
108 
109  //************************************
110  // FullName: KDIS::DATA_TYPE::IntercomCommunicationParameters::Decode
111  //!Description: Convert From Network Data.
112  // Parameter: KDataStream & stream
113  //************************************
114  virtual void Decode( KDataStream & stream ) throw( KException );
115 
116  //************************************
117  // FullName: KDIS::DATA_TYPE::IntercomCommunicationParameters::Encode
118  //!Description: Convert To Network Data.
119  // Parameter: KDataStream & stream
120  //************************************
121  virtual KDataStream Encode() const;
122  virtual void Encode( KDataStream & stream ) const;
123 
124  KBOOL operator == ( const IntercomCommunicationParameters & Value ) const;
125  KBOOL operator != ( const IntercomCommunicationParameters & Value ) const;
126 };
127 
128 } // END namespace DATA_TYPES
129 } // END namespace KDIS
Definition: GroupDestinationRecord.h:47
AdditionalIntrCommParamType
Definition: EnumRadio.h:538
unsigned short int KUINT16
Definition: KDefines.h:101
DataTypeBase * m_pRecord
Definition: IntercomCommunicationParameters.h:57
Definition: GroupAssignmentRecord.h:50
Definition: KDefines.h:182
KUINT16 m_ui16Length
Definition: IntercomCommunicationParameters.h:55
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: EntityDestinationRecord.h:47
KUINT16 m_ui16Type
Definition: IntercomCommunicationParameters.h:53
KBOOL m_bMemoryManage
Definition: IntercomCommunicationParameters.h:59
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: IntercomCommunicationParameters.h:49