[Kstars-devel] Great minds think alike: AuxInfo Hash

James Bowlin bowlin at mindspring.com
Thu Jun 5 02:26:13 CEST 2008


On Wed June 4 2008, Jason Harris wrote:
> Your proposal sounds good to me.  If it will help Akarsh, I may be  
> able to find time to implement the AuxInfo stub in SkyObject in the  
> next few days.

That's great Jason.

Perhaps it is dreadfully obvious but I think the best way forward is
to convert the public SkyObject data members:

    ImageList, ImageTitle, InfoList, InfoTitle, userLog

into public methods.  Then we can hide all of the complexity of 
dynamically of creating AuxInfo objects inside of SkyObject.

The change to the code outside of SkyObject will essentially be a simple
search and replace adding parens to the end of the above data members.  
The methods inside of SkyObject will first check the auxInfo pointer 
and create a new AuxInfo object if the pointer is NULL.  If there is 
code that would make this cause every possible AuxInfo object to be 
created then maybe we will have to do something a little more clever,
perhaps adding a hasAuxInfo() method to SkyObject.

It becomes a little tricky to generalize to the AuxInfo hash for unnamed 
stars because (I think) the SkyObject needs to know about the unique 
unnamed star ID.  This means that SkyObject will have to have an int32 
starID field.  This will still save space when we get rid of the five 
fields above.  Maybe there is a better way but this at least gives us 
one way forward that will eventually do everything we want.

I think this will overall be an improvement to KStars since it is a move 
toward "normalizing" our data structure much the way a database can be 
normalized.


-- 
Peace, James


More information about the Kstars-devel mailing list