casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalBandpassTable.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 CalBandpassTable.h
32  */
33 
34 #ifndef CalBandpassTable_CLASS
35 #define CalBandpassTable_CLASS
36 
37 #include <string>
38 #include <vector>
39 #include <map>
40 
41 
42 
43 
44 #include <alma/ASDM/ArrayTime.h>
45 
46 
47 
48 #include <alma/ASDM/Frequency.h>
49 
50 
51 
52 #include <alma/ASDM/Tag.h>
53 
54 
55 
56 
57 
58 
60 
61 
62 
64 
65 
66 
68 
69 
70 
72 
73 
74 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
120 
121 
123 #include <alma/ASDM/DuplicateKey.h>
125 #include <alma/ASDM/NoSuchRow.h>
126 #include <alma/ASDM/DuplicateKey.h>
127 
128 
129 #ifndef WITHOUT_ACS
130 #include <asdmIDLC.h>
131 #endif
132 
133 #include <alma/ASDM/Representable.h>
134 
135 #include <pthread.h>
136 
137 namespace asdm {
138 
139 //class asdm::ASDM;
140 //class asdm::CalBandpassRow;
141 
142 class ASDM;
143 class CalBandpassRow;
375  friend class ASDM;
376 
377 public:
378 
379 
385  static const std::vector<std::string>& getKeyName();
386 
387 
388  virtual ~CalBandpassTable();
389 
395  ASDM &getContainer() const;
396 
402  unsigned int size() const;
403 
411  std::string getName() const;
412 
420  static std::string name() ;
421 
426  std::string getVersion() const ;
427 
433  static const std::vector<std::string>& getAttributesNames();
434 
440  static const std::vector<std::string>& defaultAttributesNamesInBin();
441 
445  Entity getEntity() const;
446 
451  void setEntity(Entity e);
452 
460  std::string toXML() ;
461 
462 #ifndef WITHOUT_ACS
463  // Conversion Methods
469  asdmIDL::CalBandpassTableIDL *toIDL() ;
470 
478  void toIDL(asdmIDL::CalBandpassTableIDL& x) const;
479 
480 #endif
481 
482 #ifndef WITHOUT_ACS
483 
489  void fromIDL(asdmIDL::CalBandpassTableIDL x) ;
490 #endif
491 
492  //
493  // ====> Row creation.
494  //
495 
501 
502 
544  CalBandpassRow *newRow(BasebandNameMod::BasebandName basebandName, NetSidebandMod::NetSideband sideband, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, CalCurveTypeMod::CalCurveType typeCurve, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, int numAntenna, int numPoly, int numReceptor, std::vector<std::string > antennaNames, std::string refAntennaName, std::vector<Frequency > freqLimits, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector<std::vector<std::vector<float > > > curve, std::vector<double > reducedChiSquared);
545 
546 
547 
561 
562  //
563  // ====> Append a row to its table.
564  //
565 
566 
580 
581 
582 
583 
584 
585  //
586  // ====> Methods returning rows.
587  //
588 
594  std::vector<CalBandpassRow *> get() ;
595 
602  const std::vector<CalBandpassRow *>& get() const ;
603 
604 
605 
606 
607 
629  CalBandpassRow* getRowByKey(BasebandNameMod::BasebandName basebandName, NetSidebandMod::NetSideband sideband, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, CalCurveTypeMod::CalCurveType typeCurve, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
630 
631 
632 
633 
634 
678  CalBandpassRow* lookup(BasebandNameMod::BasebandName basebandName, NetSidebandMod::NetSideband sideband, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, CalCurveTypeMod::CalCurveType typeCurve, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, int numAntenna, int numPoly, int numReceptor, std::vector<std::string > antennaNames, std::string refAntennaName, std::vector<Frequency > freqLimits, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector<std::vector<std::vector<float > > > curve, std::vector<double > reducedChiSquared);
679 
680 
681  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
682  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
683 
684 private:
685 
695 
697 
698  bool archiveAsBin; // If true archive binary else archive XML
699  bool fileAsBin ; // If true file binary else file XML
700 
701  std::string version ;
702 
704 
705 
706 
707 
708 
709 
717  CalBandpassRow* checkAndAdd(CalBandpassRow* x, bool skipCheckUniqueness=false) ;
718 
724  void append(CalBandpassRow* x) ;
725 
732 
733 
734 
735 
736 
737 // A data structure to store the pointers on the table's rows.
738 
739 // In all cases we maintain a private vector of CalBandpassRow s.
740  std::vector<CalBandpassRow * > privateRows;
741 
742 
743 
744  std::vector<CalBandpassRow *> row;
745 
746 
747  void error() ; //throw(ConversionException);
748 
749 
756  void fromXML(std::string& xmlDoc) ;
757 
758  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
759 
764  void setFromMIMEFile(const std::string& directory);
765  /*
766  void openMIMEFile(const std::string& directory);
767  */
768  void setFromXMLFile(const std::string& directory);
769 
777  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
778 
779 
786  void setFromMIME(const std::string & mimeMsg);
787 
791  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
792 
802  void toFile(std::string directory);
803 
809  if (!presentInMemory && !loadInProgress) {
810  loadInProgress = true;
811  setFromFile(getContainer().getDirectory());
812  presentInMemory = true;
813  loadInProgress = false;
814  }
815  }
824  void setFromFile(const std::string& directory);
825 
826 };
827 
828 } // End namespace asdm
829 
830 #endif /* CalBandpassTable_CLASS */
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.
static const ByteOrder * Machine_Endianity
Definition: Misc.h:119
std::string MIMEXMLPart(const asdm::ByteOrder *byteOrder=asdm::ByteOrder::Machine_Endianity)
Private methods involved during the export of this table into disk file(s).
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
Entity getEntity() const
Return this table&#39;s Entity.
struct _xmlDoc xmlDoc
Definition: Misc.h:59
asdmIDL::CalBandpassTableIDL * toIDL()
Conversion Methods.
A class to represent byte order information.
Definition: Misc.h:115
std::vector< CalBandpassRow * > row
The ASDM class is the container for all tables.
Definition: ASDM.h:273
The CalBandpassTable class is an Alma table.
The CalBandpassRow class is a row of a CalBandpassTable.
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes of this table.
CalBandpassRow * checkAndAdd(CalBandpassRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
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...
CalBandpassRow * getRowByKey(BasebandNameMod::BasebandName basebandName, NetSidebandMod::NetSideband sideband, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, CalCurveTypeMod::CalCurveType typeCurve, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId)
Returns a CalBandpassRow* given a key.
CalBandpassRow * add(CalBandpassRow *x)
====&gt; Append a row to its table.
static const std::vector< std::string > & defaultAttributesNamesInBin()
Return the default sorted list of attributes names in the binary representation of the table...
void toFile(std::string directory)
Stores a representation (binary or XML) of this table into a file.
ASDM & getContainer() const
Return the container to which this table belongs.
std::string getVersion() const
Return the version information about this table.
static const std::vector< std::string > & getKeyName()
Return the list of field names that make up key key as an array of strings.
CalBandpassTable(ASDM &container)
Create a CalBandpassTable.
void setEntity(Entity e)
Set this table&#39;s Entity.
void setFromXMLFile(const std::string &directory)
std::string toXML()
Produces an XML representation conform to the schema defined for CalBandpass (CalBandpassTable.xsd).
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.
The ArrayTime class implements the concept of a point in time, implemented as an Interval of time sin...
Definition: ArrayTime.h:89
unsigned int size() const
Return the number of rows in the table.
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
static std::string name()
Return the name of this table.
CalBandpassRow * newRow()
====&gt; Row creation.
void fromIDL(asdmIDL::CalBandpassTableIDL x)
Populate this table from the content of a CalBandpassTableIDL Corba structure.
void append(CalBandpassRow *x)
Brutally append an CalBandpassRow x to the collection of rows already stored in this table...
std::vector< CalBandpassRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
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::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
const Double e
e and functions thereof:
std::string getName() const
Return the name of this table.
void addWithoutCheckingUnique(CalBandpassRow *x)
Brutally append an CalBandpassRow x to the collection of rows already stored in this table...
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
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...
CalBandpassRow * lookup(BasebandNameMod::BasebandName basebandName, NetSidebandMod::NetSideband sideband, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, CalCurveTypeMod::CalCurveType typeCurve, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, int numAntenna, int numPoly, int numReceptor, std::vector< std::string > antennaNames, std::string refAntennaName, std::vector< Frequency > freqLimits, std::vector< PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector< std::vector< std::vector< float > > > curve, std::vector< double > reducedChiSquared)
Look up the table for a row whose all attributes are equal to the corresponding parameters of the met...
void setFromFile(const std::string &directory)
Reads and parses a file containing a representation of a CalBandpassTable as those produced by the to...
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59