ObsID ObsID::idCreator(const std::string& strID, const std::string& desc) { char ot = strID[0]; ObservationType type; if (!char2ot.count(ot)) { type = (ObservationType)otDesc.size(); otDesc[type] = desc; char2ot[ot] = type; ot2char[type] = ot; } else type = char2ot[ot]; char cb = strID[1]; CarrierBand band; if (!char2cb.count(cb)) { band = (CarrierBand)cbDesc.size(); cbDesc[band] = desc; char2cb[cb] = band; cb2char[band] = cb; } else band = char2cb[cb]; char tc = strID[2]; TrackingCode code; if (!char2tc.count(tc)) { code = (TrackingCode) tcDesc.size(); tcDesc[code] = desc; char2tc[tc] = code; tc2char[code] = tc; } else code = char2tc[tc]; return ObsID(type, band, code); }
ObsID(const char* id) throw(InvalidParameter) { *this=ObsID(std::string(id));};