[Kstars-devel] KDE/kdeedu/kstars/kstars/skyobjects

Alexey Khudyakov alexey.skladnoy at gmail.com
Mon Jul 27 00:03:04 CEST 2009


SVN commit 1002762 by khudyakov:

Typedefs and declarations for UID for sky ojects.

UID typedef is implemented inside of SkyObject class. This is
because it's property of SkyObjects. Also code amount is rather
small and not deserve header on ots own.

CCMAIL: kstars-devel at kde.org



 M  +5 -0      skyobject.cpp  
 M  +25 -0     skyobject.h  


--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/skyobject.cpp #1002761:1002762
@@ -473,3 +473,8 @@
         info = new AuxInfo; 
     return &(*info);
 }
+
+SkyObject::UID SkyObject::getUID() const
+{
+    return invalidUID;
+}
--- trunk/KDE/kdeedu/kstars/kstars/skyobjects/skyobject.h #1002761:1002762
@@ -45,6 +45,24 @@
  */
 class SkyObject : public SkyPoint {
 public:
+    /** @short Type for Unique object IDenticator.
+     *
+     * Each object has unique ID (UID). For different objects UIDs
+     * must be different.
+     */
+    typedef qint64 UID;
+
+    /** @short Kind of UID */
+    enum UIDkind {
+        UID_STAR     = 0,
+        UID_GALAXY   = 1,
+        UID_DEEPSKY  = 2,
+        UID_SOLARSYS = 3
+    };
+    
+    /** Invalid UID. Real sky object could not have such UID */
+    static const UID invalidUID = ~0;
+    
     /**
      *Constructor.  Set SkyObject data according to arguments.
      *@param t Type of object
@@ -351,6 +369,13 @@
      */
     inline QString &userLog() { return getAuxInfo()->userLog; }
 
+    /** @short Return UID for object.  
+     * This method should be reimplemented in all concrete
+     * subclasses. Implementation for SkyObject just returns
+     * invalidUID. It's required SkyObject is not an abstract class.
+     */
+    virtual UID getUID() const;
+
 private:
 
     /**


More information about the Kstars-devel mailing list