libHiRISE
|
00001 /* Channel_ID 00002 00003 PIRL CVS ID: Channel_ID.hh,v 2.3 2020/02/14 00:58:12 schaller Exp 00004 00005 Copyright (C) 2003-2020 Arizona Board of Regents on behalf of the Lunar and 00006 Planetary Laboratory at the University of Arizona. 00007 00008 Licensed under the Apache License, Version 2.0 (the "License"); you may not use 00009 this file except in compliance with the License. You may obtain a copy of the 00010 License at 00011 00012 http://www.apache.org/licenses/LICENSE-2.0 00013 00014 Unless required by applicable law or agreed to in writing, software distributed 00015 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 00016 CONDITIONS OF ANY KIND, either express or implied. See the License for the 00017 specific language governing permissions and limitations under the License. 00018 00019 */ 00020 #ifndef _UA_HIRISE_CHANNEL_ID_HEADER_ 00021 #define _UA_HIRISE_CHANNEL_ID_HEADER_ 00022 00023 #include "CCD_ID.hh" 00024 00025 00026 namespace UA 00027 { 00028 namespace HiRISE 00029 { 00045 class Channel_ID 00046 : public CCD_ID 00047 { 00048 public: 00049 00050 /*============================================================================== 00051 Constants 00052 */ 00054 static const char* 00055 ID; 00056 00058 static const unsigned int 00059 DEFAULT_CHANNEL_NUMBER; 00060 00061 /*============================================================================== 00062 Constructors 00063 */ 00064 /*------------------------------------------------------------------------------ 00065 Channel_ID::Channel_ID (const u_int_32, const unsigned int, const unsigned int) 00066 */ 00086 Channel_ID 00087 ( 00088 const u_int_32 observation_id_value = DEFAULT_OBSERVATION_ID, 00089 const unsigned int cpmm_value = DEFAULT_CPMM_NUMBER, 00090 const unsigned int channel_value = DEFAULT_CHANNEL_NUMBER 00091 ); 00092 00093 /*------------------------------------------------------------------------------ 00094 Channel_ID::Channel_ID (const Mission_Phase, const int, ...) 00095 */ 00121 Channel_ID 00122 ( 00123 const Mission_Phase mission_phase_value, 00124 const int time_value = -1, 00125 const unsigned int cpmm_value = DEFAULT_CPMM_NUMBER, 00126 const unsigned int channel_value = DEFAULT_CHANNEL_NUMBER 00127 ); 00128 00129 /*------------------------------------------------------------------------------ 00130 Channel_ID::Channel_ID (const Mission_Phase, const unsigned int, ...) 00131 */ 00157 Channel_ID 00158 ( 00159 const Mission_Phase mission_phase_value, 00160 const unsigned int orbit_number_value, 00161 const unsigned int target_value, 00162 const unsigned int cpmm_value = DEFAULT_CPMM_NUMBER, 00163 const unsigned int channel_value = DEFAULT_CHANNEL_NUMBER 00164 ); 00165 00166 /*------------------------------------------------------------------------------ 00167 Channel_ID::Channel_ID (const std::string&) 00168 */ 00181 explicit 00182 Channel_ID 00183 ( 00184 const std::string& id_text 00185 ); 00186 00187 /*============================================================================== 00188 Accessors 00189 */ 00190 /*------------------------------------------------------------------------------ 00191 Channel_ID::channel_number () 00192 */ 00199 unsigned int 00200 channel_number () const { return Channel_Number; } 00201 00202 /*------------------------------------------------------------------------------ 00203 Channel_ID::channel_number (const unsigned int) 00204 */ 00218 Channel_ID& 00219 channel_number 00220 ( 00221 const unsigned int channel_value 00222 ) 00223 throw (Out_of_Range); 00224 00225 /*------------------------------------------------------------------------------ 00226 Channel_ID::channel_number (const std::string&) 00227 */ 00245 Channel_ID& 00246 channel_number 00247 ( 00248 const std::string& channel_text 00249 ) 00250 throw (Invalid_Argument, Out_of_Range); 00251 00252 /*------------------------------------------------------------------------------ 00253 Channel_ID::channel_name () 00254 */ 00262 std::string 00263 channel_name () const; 00264 00265 /*------------------------------------------------------------------------------ 00266 Channel_ID::channel_name (const std::string&) 00267 */ 00281 Channel_ID& 00282 channel_name 00283 ( 00284 const std::string& channel_text 00285 ) 00286 throw (Invalid_Argument, Out_of_Range); 00287 00288 /*============================================================================== 00289 Text representation 00290 */ 00291 /*------------------------------------------------------------------------------ 00292 Channel_ID::text () 00293 */ 00304 std::string 00305 text () const; 00306 00307 /*------------------------------------------------------------------------------ 00308 Channel_ID::text (const std::string&) 00309 */ 00316 Channel_ID& 00317 text 00318 ( 00319 const std::string& id_text 00320 ) 00321 throw (Invalid_Argument, Out_of_Range); 00322 00323 /*------------------------------------------------------------------------------ 00324 Channel_ID::parse (const std::string&) 00325 */ 00333 std::string 00334 parse 00335 ( 00336 const std::string& id_text 00337 ); 00338 00339 /*============================================================================== 00340 Utility Methods 00341 */ 00342 /*------------------------------------------------------------------------------ 00343 Channel_ID::print (std::ostream&) 00344 */ 00350 std::ostream& print 00351 ( 00352 std::ostream& stream = std::cout 00353 ) const; 00354 00355 /*============================================================================== 00356 Private Members 00357 */ 00358 private: 00359 00361 int Channel_Number; 00362 00363 }; // Channel_ID class 00364 00365 /*============================================================================== 00366 Utility Functions 00367 */ 00368 /*------------------------------------------------------------------------------ 00369 UA::HiRISE::operator<< (std::ostream&, const Channel_ID&) 00370 */ 00377 std::ostream& operator<< 00378 ( 00379 std::ostream& stream, 00380 const Channel_ID& channel_id 00381 ); 00382 00383 } // HiRISE namespace 00384 00385 } // UA namespace 00386 00387 #endif