Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Constellation Class Reference

#include <constellation.h>

List of all members.

Public Member Functions

std::string getAbbreviation ()
std::string getGenitive ()
std::string getName ()

Static Public Member Functions

static ConstellationgetConstellation (const std::string &)
static ConstellationgetConstellation (unsigned int)

Private Member Functions

 Constellation (const char *_name, const char *_genitive, const char *_abbrev)

Static Private Member Functions

static void initialize ()

Private Attributes

std::string abbrev
std::string genitive
std::string name


Constructor & Destructor Documentation

Constellation::Constellation const char *  _name,
const char *  _genitive,
const char *  _abbrev
[private]
 

Definition at line 118 of file constellation.cpp.

References abbrev, genitive, and name.

Referenced by initialize().

00119 {
00120     name = string(_name);
00121     genitive = string(_genitive);
00122     abbrev = string(_abbrev);
00123 }


Member Function Documentation

string Constellation::getAbbreviation  ) 
 

Definition at line 167 of file constellation.cpp.

References abbrev.

Referenced by StarNameDatabase::findCatalogNumberByName().

00168 {
00169     return abbrev;
00170 }

Constellation * Constellation::getConstellation const std::string  )  [static]
 

Definition at line 137 of file constellation.cpp.

References compareIgnoringCase(), constellationInfo, constellations, initialize(), and name.

00138 {
00139     if (constellations == NULL)
00140         initialize();
00141 
00142     for (unsigned int i = 0;
00143          i < sizeof(constellationInfo) / sizeof(constellationInfo[0]);
00144          i++)
00145     {
00146         if (compareIgnoringCase(name, constellationInfo[i].abbr) == 0 ||
00147             compareIgnoringCase(name, constellationInfo[i].gen) == 0 ||
00148             compareIgnoringCase(name, constellationInfo[i].name) == 0)
00149         {
00150             return constellations[i];
00151         }
00152     }
00153 
00154     return NULL;
00155 }

Constellation * Constellation::getConstellation unsigned  int  )  [static]
 

Definition at line 125 of file constellation.cpp.

References constellationInfo, constellations, and initialize().

Referenced by StarNameDatabase::findCatalogNumberByName().

00126 {
00127     if (constellations == NULL)
00128         initialize();
00129 
00130     if (constellations == NULL ||
00131         n >= sizeof(constellationInfo) / sizeof(constellationInfo[0]))
00132         return NULL;
00133     else
00134         return constellations[n];
00135 }

string Constellation::getGenitive  ) 
 

Definition at line 162 of file constellation.cpp.

References genitive.

00163 {
00164     return genitive;
00165 }

string Constellation::getName  ) 
 

Definition at line 157 of file constellation.cpp.

References name.

00158 {
00159     return name;
00160 }

void Constellation::initialize  )  [static, private]
 

Definition at line 172 of file constellation.cpp.

References Constellation(), constellationInfo, constellations, and name.

Referenced by getConstellation().

00173 {
00174     int nConstellations = sizeof(constellationInfo) / sizeof(constellationInfo[0]);
00175     constellations = new Constellation* [nConstellations];
00176 
00177     if (constellations != NULL)
00178     {
00179         for (int i = 0; i < nConstellations; i++)
00180         {
00181             constellations[i] = new Constellation(constellationInfo[i].name,
00182                                                   constellationInfo[i].gen,
00183                                                   constellationInfo[i].abbr);
00184         }
00185     }
00186 }


Member Data Documentation

std::string Constellation::abbrev [private]
 

Definition at line 31 of file constellation.h.

Referenced by Constellation(), and getAbbreviation().

std::string Constellation::genitive [private]
 

Definition at line 30 of file constellation.h.

Referenced by Constellation(), and getGenitive().

std::string Constellation::name [private]
 

Definition at line 29 of file constellation.h.

Referenced by Constellation(), getConstellation(), getName(), and initialize().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:16 2006 for Celestia by  doxygen 1.4.1