LCOV - code coverage report
Current view: top level - alma/Enumerations - CAntennaMake.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 105 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 CAntennaMake.cpp
      34             :  */
      35             : #include <sstream>
      36             : #include <alma/Enumerations/CAntennaMake.h>
      37             : #include <string>
      38             : using namespace std;
      39             : 
      40           0 : int CAntennaMake::version() {
      41           0 :         return AntennaMakeMod::version;
      42             :         }
      43             :         
      44           0 : string CAntennaMake::revision () {
      45           0 :         return AntennaMakeMod::revision;
      46             : }
      47             : 
      48           0 : unsigned int CAntennaMake::size() {
      49           0 :         return 9;
      50             :         }
      51             :         
      52             :         
      53             : const std::string& CAntennaMake::sAEM_12 = "AEM_12";
      54             :         
      55             : const std::string& CAntennaMake::sMITSUBISHI_7 = "MITSUBISHI_7";
      56             :         
      57             : const std::string& CAntennaMake::sMITSUBISHI_12_A = "MITSUBISHI_12_A";
      58             :         
      59             : const std::string& CAntennaMake::sMITSUBISHI_12_B = "MITSUBISHI_12_B";
      60             :         
      61             : const std::string& CAntennaMake::sVERTEX_12_ATF = "VERTEX_12_ATF";
      62             :         
      63             : const std::string& CAntennaMake::sAEM_12_ATF = "AEM_12_ATF";
      64             :         
      65             : const std::string& CAntennaMake::sVERTEX_12 = "VERTEX_12";
      66             :         
      67             : const std::string& CAntennaMake::sIRAM_15 = "IRAM_15";
      68             :         
      69             : const std::string& CAntennaMake::sUNDEFINED = "UNDEFINED";
      70             :         
      71           0 : const std::vector<std::string> CAntennaMake::names() {
      72           0 :     std::vector<std::string> enumSet;
      73             :     
      74           0 :     enumSet.insert(enumSet.end(), CAntennaMake::sAEM_12);
      75             :     
      76           0 :     enumSet.insert(enumSet.end(), CAntennaMake::sMITSUBISHI_7);
      77             :     
      78           0 :     enumSet.insert(enumSet.end(), CAntennaMake::sMITSUBISHI_12_A);
      79             :     
      80           0 :     enumSet.insert(enumSet.end(), CAntennaMake::sMITSUBISHI_12_B);
      81             :     
      82           0 :     enumSet.insert(enumSet.end(), CAntennaMake::sVERTEX_12_ATF);
      83             :     
      84           0 :     enumSet.insert(enumSet.end(), CAntennaMake::sAEM_12_ATF);
      85             :     
      86           0 :     enumSet.insert(enumSet.end(), CAntennaMake::sVERTEX_12);
      87             :     
      88           0 :     enumSet.insert(enumSet.end(), CAntennaMake::sIRAM_15);
      89             :     
      90           0 :     enumSet.insert(enumSet.end(), CAntennaMake::sUNDEFINED);
      91             :         
      92           0 :     return enumSet;
      93           0 : }
      94             : 
      95           0 : std::string CAntennaMake::name(const AntennaMakeMod::AntennaMake& f) {
      96           0 :     switch (f) {
      97             :     
      98           0 :     case AntennaMakeMod::AEM_12:
      99           0 :       return CAntennaMake::sAEM_12;
     100             :     
     101           0 :     case AntennaMakeMod::MITSUBISHI_7:
     102           0 :       return CAntennaMake::sMITSUBISHI_7;
     103             :     
     104           0 :     case AntennaMakeMod::MITSUBISHI_12_A:
     105           0 :       return CAntennaMake::sMITSUBISHI_12_A;
     106             :     
     107           0 :     case AntennaMakeMod::MITSUBISHI_12_B:
     108           0 :       return CAntennaMake::sMITSUBISHI_12_B;
     109             :     
     110           0 :     case AntennaMakeMod::VERTEX_12_ATF:
     111           0 :       return CAntennaMake::sVERTEX_12_ATF;
     112             :     
     113           0 :     case AntennaMakeMod::AEM_12_ATF:
     114           0 :       return CAntennaMake::sAEM_12_ATF;
     115             :     
     116           0 :     case AntennaMakeMod::VERTEX_12:
     117           0 :       return CAntennaMake::sVERTEX_12;
     118             :     
     119           0 :     case AntennaMakeMod::IRAM_15:
     120           0 :       return CAntennaMake::sIRAM_15;
     121             :     
     122           0 :     case AntennaMakeMod::UNDEFINED:
     123           0 :       return CAntennaMake::sUNDEFINED;
     124             :         
     125             :     }
     126             :     // Impossible siutation but....who knows with C++ enums
     127           0 :     throw badInt((int) f);
     128             : }
     129             : 
     130           0 : AntennaMakeMod::AntennaMake CAntennaMake::newAntennaMake(const std::string& name) {
     131             :                 
     132           0 :     if (name == CAntennaMake::sAEM_12) {
     133           0 :         return AntennaMakeMod::AEM_12;
     134             :     }
     135             :         
     136           0 :     if (name == CAntennaMake::sMITSUBISHI_7) {
     137           0 :         return AntennaMakeMod::MITSUBISHI_7;
     138             :     }
     139             :         
     140           0 :     if (name == CAntennaMake::sMITSUBISHI_12_A) {
     141           0 :         return AntennaMakeMod::MITSUBISHI_12_A;
     142             :     }
     143             :         
     144           0 :     if (name == CAntennaMake::sMITSUBISHI_12_B) {
     145           0 :         return AntennaMakeMod::MITSUBISHI_12_B;
     146             :     }
     147             :         
     148           0 :     if (name == CAntennaMake::sVERTEX_12_ATF) {
     149           0 :         return AntennaMakeMod::VERTEX_12_ATF;
     150             :     }
     151             :         
     152           0 :     if (name == CAntennaMake::sAEM_12_ATF) {
     153           0 :         return AntennaMakeMod::AEM_12_ATF;
     154             :     }
     155             :         
     156           0 :     if (name == CAntennaMake::sVERTEX_12) {
     157           0 :         return AntennaMakeMod::VERTEX_12;
     158             :     }
     159             :         
     160           0 :     if (name == CAntennaMake::sIRAM_15) {
     161           0 :         return AntennaMakeMod::IRAM_15;
     162             :     }
     163             :         
     164           0 :     if (name == CAntennaMake::sUNDEFINED) {
     165           0 :         return AntennaMakeMod::UNDEFINED;
     166             :     }
     167             :     
     168           0 :     throw badString(name);
     169             : }
     170             : 
     171           0 : AntennaMakeMod::AntennaMake CAntennaMake::literal(const std::string& name) {
     172             :                 
     173           0 :     if (name == CAntennaMake::sAEM_12) {
     174           0 :         return AntennaMakeMod::AEM_12;
     175             :     }
     176             :         
     177           0 :     if (name == CAntennaMake::sMITSUBISHI_7) {
     178           0 :         return AntennaMakeMod::MITSUBISHI_7;
     179             :     }
     180             :         
     181           0 :     if (name == CAntennaMake::sMITSUBISHI_12_A) {
     182           0 :         return AntennaMakeMod::MITSUBISHI_12_A;
     183             :     }
     184             :         
     185           0 :     if (name == CAntennaMake::sMITSUBISHI_12_B) {
     186           0 :         return AntennaMakeMod::MITSUBISHI_12_B;
     187             :     }
     188             :         
     189           0 :     if (name == CAntennaMake::sVERTEX_12_ATF) {
     190           0 :         return AntennaMakeMod::VERTEX_12_ATF;
     191             :     }
     192             :         
     193           0 :     if (name == CAntennaMake::sAEM_12_ATF) {
     194           0 :         return AntennaMakeMod::AEM_12_ATF;
     195             :     }
     196             :         
     197           0 :     if (name == CAntennaMake::sVERTEX_12) {
     198           0 :         return AntennaMakeMod::VERTEX_12;
     199             :     }
     200             :         
     201           0 :     if (name == CAntennaMake::sIRAM_15) {
     202           0 :         return AntennaMakeMod::IRAM_15;
     203             :     }
     204             :         
     205           0 :     if (name == CAntennaMake::sUNDEFINED) {
     206           0 :         return AntennaMakeMod::UNDEFINED;
     207             :     }
     208             :     
     209           0 :     throw badString(name);
     210             : }
     211             : 
     212           0 : AntennaMakeMod::AntennaMake CAntennaMake::from_int(unsigned int i) {
     213           0 :         vector<string> names_ = names();
     214           0 :         if (i >= names_.size()) throw badInt(i);
     215           0 :         return newAntennaMake(names_.at(i));
     216           0 : }
     217             : 
     218           0 : string CAntennaMake::badString(const string& name) {
     219           0 :         return "'"+name+"' does not correspond to any literal in the enumeration 'AntennaMake'.";
     220             : }
     221             : 
     222           0 : string CAntennaMake::badInt(unsigned int i) {
     223           0 :         ostringstream oss ;
     224           0 :         oss << "'" << i << "' is out of range for the enumeration 'AntennaMake'.";
     225           0 :         return oss.str();
     226           0 : }
     227             : 
     228             : namespace AntennaMakeMod {
     229           0 :         std::ostream & operator << ( std::ostream & out, const AntennaMake& value) {
     230           0 :                 out << CAntennaMake::name(value);
     231           0 :                 return out;
     232             :         }
     233             : 
     234           0 :         std::istream & operator >> ( std::istream & in , AntennaMake& value ) {
     235           0 :                 in.clear();
     236           0 :                 string s ; 
     237           0 :                 in >> s;
     238             :                 try {
     239           0 :                 value = CAntennaMake::literal(s);
     240             :                 }
     241           0 :                 catch (string & m) {
     242           0 :                 in.setstate(ios::failbit);
     243           0 :                 }
     244           0 :                 return in;
     245           0 :         }
     246             : }
     247             : 

Generated by: LCOV version 1.16