casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalAtmosphereTable.h
Go to the documentation of this file.
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  * Warning!
26  * --------------------------------------------------------------------
27  * | This is generated code! Do not modify this file. |
28  * | If you do, all changes will be lost when the file is re-generated. |
29  * --------------------------------------------------------------------
30  *
31  * File CalAtmosphereTable.h
32  */
33 
34 #ifndef CalAtmosphereTable_CLASS
35 #define CalAtmosphereTable_CLASS
36 
37 #include <string>
38 #include <vector>
39 #include <map>
40 
41 
42 
43 
44 #include <alma/ASDM/Temperature.h>
45 
46 
47 
48 #include <alma/ASDM/ArrayTime.h>
49 
50 
51 
52 #include <alma/ASDM/Pressure.h>
53 
54 
55 
56 #include <alma/ASDM/Length.h>
57 
58 
59 
60 #include <alma/ASDM/Humidity.h>
61 
62 
63 
64 #include <alma/ASDM/Frequency.h>
65 
66 
67 
68 #include <alma/ASDM/Tag.h>
69 
70 
71 
72 
73 
74 
76 
77 
78 
79 
80 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
108 
109 
110 
111 
112 
113 
114 
116 
117 
118 
119 
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
131 
132 
133 
134 
135 
136 
137 
138 
139 
140 
141 
142 
143 
144 
145 
146 
147 
148 
149 
150 
151 
153 #include <alma/ASDM/DuplicateKey.h>
155 #include <alma/ASDM/NoSuchRow.h>
156 #include <alma/ASDM/DuplicateKey.h>
157 
158 
159 #ifndef WITHOUT_ACS
160 #include <asdmIDLC.h>
161 #endif
162 
163 #include <alma/ASDM/Representable.h>
164 
165 #include <pthread.h>
166 
167 namespace asdm {
168 
169 //class asdm::ASDM;
170 //class asdm::CalAtmosphereRow;
171 
172 class ASDM;
173 class CalAtmosphereRow;
464  friend class ASDM;
465 
466 public:
467 
468 
474  static const std::vector<std::string>& getKeyName();
475 
476 
477  virtual ~CalAtmosphereTable();
478 
484  ASDM &getContainer() const;
485 
491  unsigned int size() const;
492 
500  std::string getName() const;
501 
509  static std::string name() ;
510 
515  std::string getVersion() const ;
516 
522  static const std::vector<std::string>& getAttributesNames();
523 
529  static const std::vector<std::string>& defaultAttributesNamesInBin();
530 
534  Entity getEntity() const;
535 
540  void setEntity(Entity e);
541 
549  std::string toXML() ;
550 
551 #ifndef WITHOUT_ACS
552  // Conversion Methods
558  asdmIDL::CalAtmosphereTableIDL *toIDL() ;
559 
567  void toIDL(asdmIDL::CalAtmosphereTableIDL& x) const;
568 
569 #endif
570 
571 #ifndef WITHOUT_ACS
572 
578  void fromIDL(asdmIDL::CalAtmosphereTableIDL x) ;
579 #endif
580 
581  //
582  // ====> Row creation.
583  //
584 
590 
591 
657  CalAtmosphereRow *newRow(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, int numFreq, int numLoad, int numReceptor, std::vector<std::vector<float > > forwardEffSpectrum, std::vector<Frequency > frequencyRange, Pressure groundPressure, Humidity groundRelHumidity, std::vector<Frequency > frequencySpectrum, Temperature groundTemperature, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector<std::vector<float > > powerSkySpectrum, std::vector<std::vector<std::vector<float > > > powerLoadSpectrum, SyscalMethodMod::SyscalMethod syscalType, std::vector<std::vector<Temperature > > tAtmSpectrum, std::vector<std::vector<Temperature > > tRecSpectrum, std::vector<std::vector<Temperature > > tSysSpectrum, std::vector<std::vector<float > > tauSpectrum, std::vector<Temperature > tAtm, std::vector<Temperature > tRec, std::vector<Temperature > tSys, std::vector<float > tau, std::vector<Length > water, std::vector<Length > waterError);
658 
659 
660 
674 
675  //
676  // ====> Append a row to its table.
677  //
678 
679 
693 
694 
695 
696 
697 
698  //
699  // ====> Methods returning rows.
700  //
701 
707  std::vector<CalAtmosphereRow *> get() ;
708 
715  const std::vector<CalAtmosphereRow *>& get() const ;
716 
717 
718 
719 
720 
738  CalAtmosphereRow* getRowByKey(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId);
739 
740 
741 
742 
743 
811  CalAtmosphereRow* lookup(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, int numFreq, int numLoad, int numReceptor, std::vector<std::vector<float > > forwardEffSpectrum, std::vector<Frequency > frequencyRange, Pressure groundPressure, Humidity groundRelHumidity, std::vector<Frequency > frequencySpectrum, Temperature groundTemperature, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector<std::vector<float > > powerSkySpectrum, std::vector<std::vector<std::vector<float > > > powerLoadSpectrum, SyscalMethodMod::SyscalMethod syscalType, std::vector<std::vector<Temperature > > tAtmSpectrum, std::vector<std::vector<Temperature > > tRecSpectrum, std::vector<std::vector<Temperature > > tSysSpectrum, std::vector<std::vector<float > > tauSpectrum, std::vector<Temperature > tAtm, std::vector<Temperature > tRec, std::vector<Temperature > tSys, std::vector<float > tau, std::vector<Length > water, std::vector<Length > waterError);
812 
813 
814  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
815  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
816 
817 private:
818 
828 
830 
831  bool archiveAsBin; // If true archive binary else archive XML
832  bool fileAsBin ; // If true file binary else file XML
833 
834  std::string version ;
835 
837 
838 
839 
840 
841 
842 
850  CalAtmosphereRow* checkAndAdd(CalAtmosphereRow* x, bool skipCheckUniqueness=false) ;
851 
857  void append(CalAtmosphereRow* x) ;
858 
865 
866 
867 
868 
869 
870 // A data structure to store the pointers on the table's rows.
871 
872 // In all cases we maintain a private vector of CalAtmosphereRow s.
873  std::vector<CalAtmosphereRow * > privateRows;
874 
875 
876 
877  std::vector<CalAtmosphereRow *> row;
878 
879 
880  void error() ; //throw(ConversionException);
881 
882 
889  void fromXML(std::string& xmlDoc) ;
890 
891  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
892 
897  void setFromMIMEFile(const std::string& directory);
898  /*
899  void openMIMEFile(const std::string& directory);
900  */
901  void setFromXMLFile(const std::string& directory);
902 
910  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
911 
912 
919  void setFromMIME(const std::string & mimeMsg);
920 
924  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
925 
935  void toFile(std::string directory);
936 
942  if (!presentInMemory && !loadInProgress) {
943  loadInProgress = true;
944  setFromFile(getContainer().getDirectory());
945  presentInMemory = true;
946  loadInProgress = false;
947  }
948  }
957  void setFromFile(const std::string& directory);
958 
959 };
960 
961 } // End namespace asdm
962 
963 #endif /* CalAtmosphereTable_CLASS */
void setEntity(Entity e)
Set this table&#39;s Entity.
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
std::string toXML()
Produces an XML representation conform to the schema defined for CalAtmosphere (CalAtmosphereTable.xsd).
static const ByteOrder * Machine_Endianity
Definition: Misc.h:119
static const std::vector< std::string > & getKeyName()
Return the list of field names that make up key key as an array of strings.
CalAtmosphereRow * checkAndAdd(CalAtmosphereRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
unsigned int size() const
Return the number of rows in the table.
struct _xmlDoc xmlDoc
Definition: Misc.h:59
CalAtmosphereRow * lookup(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, int numFreq, int numLoad, int numReceptor, std::vector< std::vector< float > > forwardEffSpectrum, std::vector< Frequency > frequencyRange, Pressure groundPressure, Humidity groundRelHumidity, std::vector< Frequency > frequencySpectrum, Temperature groundTemperature, std::vector< PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector< std::vector< float > > powerSkySpectrum, std::vector< std::vector< std::vector< float > > > powerLoadSpectrum, SyscalMethodMod::SyscalMethod syscalType, std::vector< std::vector< Temperature > > tAtmSpectrum, std::vector< std::vector< Temperature > > tRecSpectrum, std::vector< std::vector< Temperature > > tSysSpectrum, std::vector< std::vector< float > > tauSpectrum, std::vector< Temperature > tAtm, std::vector< Temperature > tRec, std::vector< Temperature > tSys, std::vector< float > tau, std::vector< Length > water, std::vector< Length > waterError)
Look up the table for a row whose all attributes are equal to the corresponding parameters of the met...
void setFromMIMEFile(const std::string &directory)
Private methods involved during the build of this table out of the content of file(s) containing an e...
bool loadInProgress
Load the table in memory if necessary.
A class to represent byte order information.
Definition: Misc.h:115
static const std::vector< std::string > & defaultAttributesNamesInBin()
Return the default sorted list of attributes names in the binary representation of the table...
std::string toMIME(const asdm::ByteOrder *byteOrder=asdm::ByteOrder::Machine_Endianity)
Serialize this into a stream of bytes and encapsulates that stream into a MIME message.
The ASDM class is the container for all tables.
Definition: ASDM.h:273
The Humidity class implements a quantity of humidity in percent.
Definition: Humidity.h:53
The Temperature class implements a quantity of temperature in degrees Kelvin.
Definition: Temperature.h:53
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
void toFile(std::string directory)
Stores a representation (binary or XML) of this table into a file.
void setFromMIME(const std::string &mimeMsg)
Extracts the binary part of a MIME message and deserialize its content to fill this with the result o...
void fromIDL(asdmIDL::CalAtmosphereTableIDL x)
Populate this table from the content of a CalAtmosphereTableIDL Corba structure.
void append(CalAtmosphereRow *x)
Brutally append an CalAtmosphereRow x to the collection of rows already stored in this table...
void setFromXMLFile(const std::string &directory)
std::string MIMEXMLPart(const asdm::ByteOrder *byteOrder=asdm::ByteOrder::Machine_Endianity)
Private methods involved during the export of this table into disk file(s).
std::vector< CalAtmosphereRow * > row
The Pressure class implements a quantity of pressure in hectopascals.
Definition: Pressure.h:53
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
void fromXML(std::string &xmlDoc)
Populate this table from the content of a XML document that is required to be conform to the XML sche...
std::string getName() const
Return the name of this table.
The ArrayTime class implements the concept of a point in time, implemented as an Interval of time sin...
Definition: ArrayTime.h:89
Entity getEntity() const
Return this table&#39;s Entity.
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
void setFromFile(const std::string &directory)
Reads and parses a file containing a representation of a CalAtmosphereTable as those produced by the ...
The CalAtmosphereTable class is an Alma table.
A pure virtual class whose derived classes are expected to be functors whose behaviours will be to re...
Definition: EndianStream.h:117
The Representable interface is implemented by all tables and by the container.
Definition: Representable.h:53
std::string getVersion() const
Return the version information about this table.
const Double e
e and functions thereof:
ASDM & getContainer() const
Return the container to which this table belongs.
void addWithoutCheckingUnique(CalAtmosphereRow *x)
Brutally append an CalAtmosphereRow x to the collection of rows already stored in this table...
CalAtmosphereTable(ASDM &container)
Create a CalAtmosphereTable.
The CalAtmosphereRow class is a row of a CalAtmosphereTable.
CalAtmosphereRow * newRow()
====&gt; Row creation.
CalAtmosphereRow * getRowByKey(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId)
Returns a CalAtmosphereRow* given a key.
static std::string name()
Return the name of this table.
std::vector< CalAtmosphereRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes of this table.
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59
CalAtmosphereRow * add(CalAtmosphereRow *x)
====&gt; Append a row to its table.
asdmIDL::CalAtmosphereTableIDL * toIDL()
Conversion Methods.