KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GroupDestinationRecord.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: GroupDestinationRecord
32  created: 2009/02/05
33  author: Karl Jones
34 
35  purpose: Used to send an Intercom Control PDU to an arbitrary group.
36  size: 64 bits / 8 octets
37 *********************************************************************/
38 
39 #pragma once
40 
41 #include "./DataTypeBase.h"
42 #include <bitset>
43 
44 namespace KDIS {
45 namespace DATA_TYPE {
46 
48 {
49 protected:
50 
52 
54 
56 
58 
59 public:
60 
61  static const KUINT16 GROUP_DESTINATION_RECORD_SIZE = 8;
62 
64 
65  GroupDestinationRecord( KDataStream & stream )throw( KException );
66 
68 
69  virtual ~GroupDestinationRecord();
70 
71  //************************************
72  // FullName: KDIS::DATA_TYPE::GroupDestinationRecord::SetGroupBitField
73  // KDIS::DATA_TYPE::GroupDestinationRecord::GetGroupBitField
74  //!Description: Sets the group/s the Intercom PDU applies to.
75  //! Each group is represented by a single bit, 1 indicates the PDU applies to this group.
76  //! Exception thrown if a bit greater than 31 is specified in Group.
77  // Parameter: KUINT32 AllGroups, KUINT8 Group
78  // Parameter: KBOOL InGroup = true
79  //************************************
80  void SetGroupBitField( KUINT32 AllGroups );
81  KUINT32 GetGroupBitField() const;
82  void SetGroupBitField( KUINT8 Group, KBOOL InGroup = true ) throw( KException );
83  KBOOL IsGroupBitSet( KUINT8 Group ) const throw( KException );
84 
85  //************************************
86  // FullName: KDIS::DATA_TYPE::GroupDestinationRecord::SetDestinationPriority
87  // KDIS::DATA_TYPE::GroupDestinationRecord::GetDestinationPriority
88  //!Description: Identifies the priority of this message relative to transmissions
89  //! from other intercom devices on the same channel.
90  //! The value 0 is reserved.
91  //! 1 = highest priority, 255 = lowest priority.
92  // Parameter: KUINT8 TP
93  //************************************
94  void SetDestinationPriority( KUINT8 TP );
95  KUINT8 GetDestinationPriority() const;
96 
97  //************************************
98  // FullName: KDIS::DATA_TYPE::GroupDestinationRecord::SetLineStateCommand
99  // KDIS::DATA_TYPE::GroupDestinationRecord::GetLineStateCommand
100  //!Description: When the Control Type of the Intercom Control PDU is
101  //! request or acknowledge, this field shall specify the
102  //! detailed type requested. Otherwise set to 0.
103  // Parameter: LineStateCommand LSC
104  //************************************
105  void SetLineStateCommand( KDIS::DATA_TYPE::ENUMS::LineStateCommand LSC );
106  KDIS::DATA_TYPE::ENUMS::LineStateCommand GetLineStateCommand() const;
107 
108  //************************************
109  // FullName: KDIS::DATA_TYPE::GroupDestinationRecord::GetAsString
110  //!Description: Returns a string representation
111  //************************************
112  virtual KString GetAsString() const;
113 
114  //************************************
115  // FullName: KDIS::DATA_TYPE::GroupDestinationRecord::Decode
116  //!Description: Convert From Network Data.
117  // Parameter: KDataStream & stream
118  //************************************
119  virtual void Decode( KDataStream & stream ) throw( KException );
120 
121  //************************************
122  // FullName: KDIS::DATA_TYPE::GroupDestinationRecord::Encode
123  //!Description: Convert To Network Data.
124  // Parameter: KDataStream & stream
125  //************************************
126  virtual KDataStream Encode() const;
127  virtual void Encode( KDataStream & stream ) const;
128 
129  KBOOL operator == ( const GroupDestinationRecord & Value ) const;
130  KBOOL operator != ( const GroupDestinationRecord & Value ) const;
131 };
132 
133 } // END namespace DATA_TYPES
134 } // END namespace KDIS
Definition: GroupDestinationRecord.h:47
KUINT8 m_ui8DstPriority
Definition: GroupDestinationRecord.h:53
unsigned int KUINT32
Definition: KDefines.h:103
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT32 m_ui32GrpBtField
Definition: GroupDestinationRecord.h:51
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
KUINT8 m_ui8LnStCmd
Definition: GroupDestinationRecord.h:55
std::string KString
Definition: KDefines.h:116
KUINT16 m_ui16Padding1
Definition: GroupDestinationRecord.h:57
LineStateCommand
Definition: EnumRadio.h:517
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82