casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CFieldCode.h
Go to the documentation of this file.
00001 
00002 #ifndef CFieldCode_H
00003 #define CFieldCode_H
00004 
00005 /*
00006  * ALMA - Atacama Large Millimeter Array
00007  * (c) European Southern Observatory, 2002
00008  * (c) Associated Universities Inc., 2002
00009  * Copyright by ESO (in the framework of the ALMA collaboration),
00010  * Copyright by AUI (in the framework of the ALMA collaboration),
00011  * All rights reserved.
00012  * 
00013  * This library is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU Lesser General Public
00015  * License as published by the Free software Foundation; either
00016  * version 2.1 of the License, or (at your option) any later version.
00017  * 
00018  * This library is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY, without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  * Lesser General Public License for more details.
00022  * 
00023  * You should have received a copy of the GNU Lesser General Public
00024  * License along with this library; if not, write to the Free Software
00025  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00026  * MA 02111-1307  USA
00027  * 
00028  * /////////////////////////////////////////////////////////////////
00029  * // WARNING!  DO NOT MODIFY THIS FILE!                          //
00030  * //  ---------------------------------------------------------  //
00031  * // | This is generated code!  Do not modify this file.       | //
00032  * // | Any changes will be lost when the file is re-generated. | //
00033  * //  ---------------------------------------------------------  //
00034  * /////////////////////////////////////////////////////////////////
00035  *
00036  * File CFieldCode.h
00037  */
00038 
00039 #ifndef __cplusplus
00040 #error This is a C++ include file and cannot be used from plain C
00041 #endif
00042 
00043 #include <iostream>
00044 #include <string>
00045 #include <vector>
00049 #ifndef WITHOUT_ACS
00050 #include <almaEnumerations_IFC.h>
00051 #else
00052 
00053 // This part mimics the behaviour of 
00054 namespace FieldCodeMod
00055 {
00058   
00059   const char *const revision = "1.10";
00060   const int version = 1;
00061   
00062   enum FieldCode
00063   { 
00064     NONE 
00066   };
00067   typedef FieldCode &FieldCode_out;
00068 } 
00069 #endif
00070 
00071 namespace FieldCodeMod {
00072         std::ostream & operator << ( std::ostream & out, const FieldCode& value);
00073         std::istream & operator >> ( std::istream & in , FieldCode& value );
00074 }
00075 
00080 class CFieldCode {
00081   public:
00082  
00087         static const std::string& sNONE; 
00094           static int version() ;
00095           
00096           
00102           static std::string revision() ;
00103           
00104           
00109        static unsigned int size() ;
00110        
00111        
00117         static std::string name(const FieldCodeMod::FieldCode& e);
00118         
00122     static std::string toString(const FieldCodeMod::FieldCode& f) { return name(f); }
00123 
00129      static const std::vector<std::string> names();      
00130     
00131         
00132         // Create a FieldCode enumeration object by specifying its name.
00133         static FieldCodeMod::FieldCode newFieldCode(const std::string& name);
00134         
00140         static FieldCodeMod::FieldCode literal(const std::string& name);
00141         
00147         static FieldCodeMod::FieldCode from_int(unsigned int i);        
00148         
00149 
00150   private:
00151     /* Not Implemented.  This is a pure static class. */
00152     CFieldCode();
00153     CFieldCode(const CFieldCode&);
00154     CFieldCode& operator=(const CFieldCode&);
00155     
00156     static std::string badString(const std::string& name) ;
00157         static std::string badInt(unsigned int i) ;
00158         
00159 };
00160  
00161 #endif