KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PerimeterPointCoordinate.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: PerimeterPointCoordinate
32  created: 09/05/2010
33  author: Karl Jones
34 
35  purpose: The location of each perimeter point, relative to the Minefield Location field.
36  size: 64 bits / 8 octets
37 *********************************************************************/
38 
39 #pragma once
40 
41 #include "./DataTypeBase.h"
42 
43 namespace KDIS {
44 namespace DATA_TYPE {
45 
47 {
48 protected:
49 
51 
53 
54 public:
55 
56  static const KUINT16 PERIMETER_POINT_COORDINATE_SIZE = 8;
57 
59 
61 
62  PerimeterPointCoordinate( KDataStream & stream ) throw( KException );
63 
64  virtual ~PerimeterPointCoordinate();
65 
66  //************************************
67  // FullName: KDIS::DATA_TYPE::PerimeterPointCoordinate::SetX
68  // KDIS::DATA_TYPE::PerimeterPointCoordinate::GetX
69  //!Description: First Value / X
70  // Parameter: KFLOAT32 X, void
71  //************************************
72  void SetX( KFLOAT32 X );
73  KFLOAT32 GetX() const;
74 
75  //************************************
76  // FullName: KDIS::DATA_TYPE::PerimeterPointCoordinate::SetY
77  // KDIS::DATA_TYPE::PerimeterPointCoordinate::GetY
78  //!Description: Second Value / Y
79  // Parameter: KFLOAT32 Y, void
80  //************************************
81  void SetY( KFLOAT32 Y );
82  KFLOAT32 GetY() const;
83 
84  //************************************
85  // FullName: KDIS::DATA_TYPE::PerimeterPointCoordinate::GetAsString
86  //!Description: Returns a string representation
87  //************************************
88  virtual KString GetAsString() const;
89 
90  //************************************
91  // FullName: KDIS::DATA_TYPE::PerimeterPointCoordinate::Decode
92  //!Description: Convert From Network Data.
93  // Parameter: KDataStream & stream
94  //************************************
95  virtual void Decode( KDataStream & stream ) throw( KException );
96 
97  //************************************
98  // FullName: KDIS::DATA_TYPE::PerimeterPointCoordinate::Encode
99  //!Description: Convert To Network Data.
100  // Parameter: KDataStream & stream
101  //************************************
102  virtual KDataStream Encode() const;
103  virtual void Encode( KDataStream & stream ) const;
104 
105  KBOOL operator == ( const PerimeterPointCoordinate & Value ) const;
106  KBOOL operator != ( const PerimeterPointCoordinate & Value ) const;
107 
108  // Valid values 0 - X, 1 - Y. throws OUT_OF_BOUNDS exception for any other value.
109  KFLOAT32 & operator[] ( KUINT16 i ) throw( KException );
110  const KFLOAT32 & operator[] ( KUINT16 i ) const throw( KException );
111 };
112 
113 } // END namespace DATA_TYPES
114 } // END namespace KDIS
unsigned short int KUINT16
Definition: KDefines.h:101
KFLOAT32 m_f32Y
Definition: PerimeterPointCoordinate.h:52
float KFLOAT32
Definition: KDefines.h:113
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
KFLOAT32 m_f32X
Definition: PerimeterPointCoordinate.h:50
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: PerimeterPointCoordinate.h:46