]> git.mxchange.org Git - simgear.git/blobdiff - simgear/timing/timezone.h
Add cloud movement direction and speed
[simgear.git] / simgear / timing / timezone.h
index cac4acadd28d5017bb2e852c88e7660e55a7dd89..e286d857d55ea72bbdc5e7d409b1554187eec062 100644 (file)
  * timezone.h
  * Written by Durk Talsma. Started July 1999.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * Library General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA  02111-1307, USA.
  *
  **************************************************************************/
 
-/*************************************************************************
+/** \file timezone.h
  *
- * Timezone is derived from geocoord, and stores the timezone centerpoint,
- * as well as the countrycode and the timezone descriptor. The latter is 
- * used in order to get the local time. 
+ * Provides SGTimeZone and SGTimeZoneContainer
  *
- ************************************************************************/
+ */
 
 #ifndef _TIMEZONE_H_
 #define _TIMEZONE_H_
 
-#include "geocoord.h"
 #include <stdio.h>
 
-class Timezone : public GeoCoord
+#include <simgear/timing/geocoord.h>
+
+/**
+ * SGTimeZone is derived from geocoord, and stores the timezone centerpoint,
+ * as well as the countrycode and the timezone descriptor. The latter is 
+ * used in order to get the local time. 
+ *
+ */
+
+class SGTimeZone : public SGGeoCoord
 {
+
 private:
-  char* countryCode;
-  char* descriptor;
+
+  string countryCode;
+  string descriptor;
 
 public:
-  Timezone() :
-    GeoCoord()
-    { 
-      countryCode = 0; 
-      descriptor = 0;
+
+    /**
+     * Default constructor.
+     */
+    SGTimeZone() : SGGeoCoord()
+    {
+        countryCode.erase(); 
+        descriptor.erase();
     };
-  Timezone(float la, float lo, char* cc, char* desc);
-  Timezone(const char *infoString);
-  Timezone(const Timezone &other);
-  virtual ~Timezone() { delete [] countryCode; delete [] descriptor; };
+
+    /**
+     * Build a timezone object with a specifed latitude, longitude, country
+     * code, and descriptor
+     * @param la latitude
+     * @param lo longitude
+     * @param cc country code
+     * @param desc descriptor
+     */
+    SGTimeZone(float la, float lo, char* cc, char* desc);
+
+    /**
+     * Build a timezone object from a textline in zone.tab
+     * @param infoString the textline from zone.tab
+     */
+    SGTimeZone(const char *infoString);
+
+    /**
+     * The copy constructor
+     * @param other the source object
+     */
+    SGTimeZone(const SGTimeZone &other);
+
+    /**
+     * Virutal destructor 
+     */
+    virtual ~SGTimeZone() { };
   
+    /**
+     * Print the descriptor string
+     */
+    virtual void print() { printf("%s", descriptor.c_str()); }
 
-  virtual void print() { printf("%s", descriptor);};
-  virtual char * getDescription() { return descriptor; };
+    /**
+     * Return the descriptor string
+     * @return descriptor string (char array)
+     */
+    virtual const char * getDescription() { return descriptor.c_str(); };
 };
 
-/************************************************************************
- * Timezone container is derived from GeoCoordContainer, and has some 
+/**
+ * SGTimeZoneContainer is derived from SGGeoCoordContainer, and has some 
  * added functionality.
- ************************************************************************/
+ */
 
-class TimezoneContainer : public GeoCoordContainer
+class SGTimeZoneContainer : public SGGeoCoordContainer
 {
  public:
-  TimezoneContainer(const char *filename);
-  virtual ~TimezoneContainer();
+  SGTimeZoneContainer(const char *filename);
+  virtual ~SGTimeZoneContainer();
 };