LCOV - code coverage report
Current view: top level - alma/Enumerations - CFluxCalibrationMethod.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 63 0.0 %
Date: 2024-10-28 15:53:10 Functions: 0 12 0.0 %

          Line data    Source code
       1             : 
       2             : /*
       3             :  * ALMA - Atacama Large Millimeter Array
       4             :  * (c) European Southern Observatory, 2002
       5             :  * (c) Associated Universities Inc., 2002
       6             :  * Copyright by ESO (in the framework of the ALMA collaboration),
       7             :  * Copyright by AUI (in the framework of the ALMA collaboration),
       8             :  * All rights reserved.
       9             :  * 
      10             :  * This library is free software; you can redistribute it and/or
      11             :  * modify it under the terms of the GNU Lesser General Public
      12             :  * License as published by the Free software Foundation; either
      13             :  * version 2.1 of the License, or (at your option) any later version.
      14             :  * 
      15             :  * This library is distributed in the hope that it will be useful,
      16             :  * but WITHOUT ANY WARRANTY, without even the implied warranty of
      17             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      18             :  * Lesser General Public License for more details.
      19             :  * 
      20             :  * You should have received a copy of the GNU Lesser General Public
      21             :  * License along with this library; if not, write to the Free Software
      22             :  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
      23             :  * MA 02111-1307  USA
      24             :  * 
      25             :  * /////////////////////////////////////////////////////////////////
      26             :  * // WARNING!  DO NOT MODIFY THIS FILE!                          //
      27             :  * //  ---------------------------------------------------------  //
      28             :  * // | This is generated code!  Do not modify this file.       | //
      29             :  * // | Any changes will be lost when the file is re-generated. | //
      30             :  * //  ---------------------------------------------------------  //
      31             :  * /////////////////////////////////////////////////////////////////
      32             :  *
      33             :  * File CFluxCalibrationMethod.cpp
      34             :  */
      35             : #include <sstream>
      36             : #include <alma/Enumerations/CFluxCalibrationMethod.h>
      37             : #include <string>
      38             : using namespace std;
      39             : 
      40           0 : int CFluxCalibrationMethod::version() {
      41           0 :         return FluxCalibrationMethodMod::version;
      42             :         }
      43             :         
      44           0 : string CFluxCalibrationMethod::revision () {
      45           0 :         return FluxCalibrationMethodMod::revision;
      46             : }
      47             : 
      48           0 : unsigned int CFluxCalibrationMethod::size() {
      49           0 :         return 3;
      50             :         }
      51             :         
      52             :         
      53             : const std::string& CFluxCalibrationMethod::sABSOLUTE = "ABSOLUTE";
      54             :         
      55             : const std::string& CFluxCalibrationMethod::sRELATIVE = "RELATIVE";
      56             :         
      57             : const std::string& CFluxCalibrationMethod::sEFFICIENCY = "EFFICIENCY";
      58             :         
      59           0 : const std::vector<std::string> CFluxCalibrationMethod::names() {
      60           0 :     std::vector<std::string> enumSet;
      61             :     
      62           0 :     enumSet.insert(enumSet.end(), CFluxCalibrationMethod::sABSOLUTE);
      63             :     
      64           0 :     enumSet.insert(enumSet.end(), CFluxCalibrationMethod::sRELATIVE);
      65             :     
      66           0 :     enumSet.insert(enumSet.end(), CFluxCalibrationMethod::sEFFICIENCY);
      67             :         
      68           0 :     return enumSet;
      69           0 : }
      70             : 
      71           0 : std::string CFluxCalibrationMethod::name(const FluxCalibrationMethodMod::FluxCalibrationMethod& f) {
      72           0 :     switch (f) {
      73             :     
      74           0 :     case FluxCalibrationMethodMod::ABSOLUTE:
      75           0 :       return CFluxCalibrationMethod::sABSOLUTE;
      76             :     
      77           0 :     case FluxCalibrationMethodMod::RELATIVE:
      78           0 :       return CFluxCalibrationMethod::sRELATIVE;
      79             :     
      80           0 :     case FluxCalibrationMethodMod::EFFICIENCY:
      81           0 :       return CFluxCalibrationMethod::sEFFICIENCY;
      82             :         
      83             :     }
      84             :     // Impossible siutation but....who knows with C++ enums
      85           0 :     throw badInt((int) f);
      86             : }
      87             : 
      88           0 : FluxCalibrationMethodMod::FluxCalibrationMethod CFluxCalibrationMethod::newFluxCalibrationMethod(const std::string& name) {
      89             :                 
      90           0 :     if (name == CFluxCalibrationMethod::sABSOLUTE) {
      91           0 :         return FluxCalibrationMethodMod::ABSOLUTE;
      92             :     }
      93             :         
      94           0 :     if (name == CFluxCalibrationMethod::sRELATIVE) {
      95           0 :         return FluxCalibrationMethodMod::RELATIVE;
      96             :     }
      97             :         
      98           0 :     if (name == CFluxCalibrationMethod::sEFFICIENCY) {
      99           0 :         return FluxCalibrationMethodMod::EFFICIENCY;
     100             :     }
     101             :     
     102           0 :     throw badString(name);
     103             : }
     104             : 
     105           0 : FluxCalibrationMethodMod::FluxCalibrationMethod CFluxCalibrationMethod::literal(const std::string& name) {
     106             :                 
     107           0 :     if (name == CFluxCalibrationMethod::sABSOLUTE) {
     108           0 :         return FluxCalibrationMethodMod::ABSOLUTE;
     109             :     }
     110             :         
     111           0 :     if (name == CFluxCalibrationMethod::sRELATIVE) {
     112           0 :         return FluxCalibrationMethodMod::RELATIVE;
     113             :     }
     114             :         
     115           0 :     if (name == CFluxCalibrationMethod::sEFFICIENCY) {
     116           0 :         return FluxCalibrationMethodMod::EFFICIENCY;
     117             :     }
     118             :     
     119           0 :     throw badString(name);
     120             : }
     121             : 
     122           0 : FluxCalibrationMethodMod::FluxCalibrationMethod CFluxCalibrationMethod::from_int(unsigned int i) {
     123           0 :         vector<string> names_ = names();
     124           0 :         if (i >= names_.size()) throw badInt(i);
     125           0 :         return newFluxCalibrationMethod(names_.at(i));
     126           0 : }
     127             : 
     128           0 : string CFluxCalibrationMethod::badString(const string& name) {
     129           0 :         return "'"+name+"' does not correspond to any literal in the enumeration 'FluxCalibrationMethod'.";
     130             : }
     131             : 
     132           0 : string CFluxCalibrationMethod::badInt(unsigned int i) {
     133           0 :         ostringstream oss ;
     134           0 :         oss << "'" << i << "' is out of range for the enumeration 'FluxCalibrationMethod'.";
     135           0 :         return oss.str();
     136           0 : }
     137             : 
     138             : namespace FluxCalibrationMethodMod {
     139           0 :         std::ostream & operator << ( std::ostream & out, const FluxCalibrationMethod& value) {
     140           0 :                 out << CFluxCalibrationMethod::name(value);
     141           0 :                 return out;
     142             :         }
     143             : 
     144           0 :         std::istream & operator >> ( std::istream & in , FluxCalibrationMethod& value ) {
     145           0 :                 in.clear();
     146           0 :                 string s ; 
     147           0 :                 in >> s;
     148             :                 try {
     149           0 :                 value = CFluxCalibrationMethod::literal(s);
     150             :                 }
     151           0 :                 catch (string & m) {
     152           0 :                 in.setstate(ios::failbit);
     153           0 :                 }
     154           0 :                 return in;
     155           0 :         }
     156             : }
     157             : 

Generated by: LCOV version 1.16