casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalAntennaSolutionsTable.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 CalAntennaSolutionsTable.h
32  */
33 
34 #ifndef CalAntennaSolutionsTable_CLASS
35 #define CalAntennaSolutionsTable_CLASS
36 
37 #include <string>
38 #include <vector>
39 #include <map>
40 
41 
42 
43 
44 #include <alma/ASDM/Angle.h>
45 
46 
47 
48 #include <alma/ASDM/ArrayTime.h>
49 
50 
51 
52 #include <alma/ASDM/Frequency.h>
53 
54 
55 
56 #include <alma/ASDM/Tag.h>
57 
58 
59 
60 #include <alma/ASDM/Interval.h>
61 
62 
63 
64 
65 
66 
67 
68 
70 
71 
72 
74 
75 
76 
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 
111 #include <alma/ASDM/DuplicateKey.h>
113 #include <alma/ASDM/NoSuchRow.h>
114 #include <alma/ASDM/DuplicateKey.h>
115 
116 
117 #ifndef WITHOUT_ACS
118 #include <asdmIDLC.h>
119 #endif
120 
121 #include <alma/ASDM/Representable.h>
122 
123 #include <pthread.h>
124 
125 namespace asdm {
126 
127 //class asdm::ASDM;
128 //class asdm::CalAntennaSolutionsRow;
129 
130 class ASDM;
131 class CalAntennaSolutionsRow;
311  friend class ASDM;
312 
313 public:
314 
315 
321  static const std::vector<std::string>& getKeyName();
322 
323 
324  virtual ~CalAntennaSolutionsTable();
325 
331  ASDM &getContainer() const;
332 
338  unsigned int size() const;
339 
347  std::string getName() const;
348 
356  static std::string name() ;
357 
362  std::string getVersion() const ;
363 
369  static const std::vector<std::string>& getAttributesNames();
370 
376  static const std::vector<std::string>& defaultAttributesNamesInBin();
377 
381  Entity getEntity() const;
382 
387  void setEntity(Entity e);
388 
396  std::string toXML() ;
397 
398 #ifndef WITHOUT_ACS
399  // Conversion Methods
405  asdmIDL::CalAntennaSolutionsTableIDL *toIDL() ;
406 
414  void toIDL(asdmIDL::CalAntennaSolutionsTableIDL& x) const;
415 
416 #endif
417 
418 #ifndef WITHOUT_ACS
419 
425  void fromIDL(asdmIDL::CalAntennaSolutionsTableIDL x) ;
426 #endif
427 
428  //
429  // ====> Row creation.
430  //
431 
437 
438 
484  CalAntennaSolutionsRow *newRow(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, Tag spectralWindowId, ArrayTime startValidTime, ArrayTime endValidTime, int numReceptor, std::string refAntennaName, std::vector<Angle > direction, std::vector<Frequency > frequencyRange, Interval integrationTime, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, bool correctionValidity, std::vector<float > phaseAnt, std::vector<float > phaseAntRMS, std::vector<float > amplitudeAnt, std::vector<float > amplitudeAntRMS);
485 
486 
487 
501 
502  //
503  // ====> Append a row to its table.
504  //
505 
506 
520 
521 
522 
523 
524 
525  //
526  // ====> Methods returning rows.
527  //
528 
534  std::vector<CalAntennaSolutionsRow *> get() ;
535 
542  const std::vector<CalAntennaSolutionsRow *>& get() const ;
543 
544 
545 
546 
547 
569  CalAntennaSolutionsRow* getRowByKey(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, Tag spectralWindowId);
570 
571 
572 
573 
574 
622  CalAntennaSolutionsRow* lookup(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, Tag spectralWindowId, ArrayTime startValidTime, ArrayTime endValidTime, int numReceptor, std::string refAntennaName, std::vector<Angle > direction, std::vector<Frequency > frequencyRange, Interval integrationTime, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, bool correctionValidity, std::vector<float > phaseAnt, std::vector<float > phaseAntRMS, std::vector<float > amplitudeAnt, std::vector<float > amplitudeAntRMS);
623 
624 
625  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
626  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
627 
628 private:
629 
639 
641 
642  bool archiveAsBin; // If true archive binary else archive XML
643  bool fileAsBin ; // If true file binary else file XML
644 
645  std::string version ;
646 
648 
649 
650 
651 
652 
653 
661  CalAntennaSolutionsRow* checkAndAdd(CalAntennaSolutionsRow* x, bool skipCheckUniqueness=false) ;
662 
668  void append(CalAntennaSolutionsRow* x) ;
669 
676 
677 
678 
679 
680 
681 // A data structure to store the pointers on the table's rows.
682 
683 // In all cases we maintain a private vector of CalAntennaSolutionsRow s.
684  std::vector<CalAntennaSolutionsRow * > privateRows;
685 
686 
687 
688  std::vector<CalAntennaSolutionsRow *> row;
689 
690 
691  void error() ; //throw(ConversionException);
692 
693 
700  void fromXML(std::string& xmlDoc) ;
701 
702  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
703 
708  void setFromMIMEFile(const std::string& directory);
709  /*
710  void openMIMEFile(const std::string& directory);
711  */
712  void setFromXMLFile(const std::string& directory);
713 
721  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
722 
723 
730  void setFromMIME(const std::string & mimeMsg);
731 
735  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
736 
746  void toFile(std::string directory);
747 
753  if (!presentInMemory && !loadInProgress) {
754  loadInProgress = true;
755  setFromFile(getContainer().getDirectory());
756  presentInMemory = true;
757  loadInProgress = false;
758  }
759  }
768  void setFromFile(const std::string& directory);
769 
770 };
771 
772 } // End namespace asdm
773 
774 #endif /* CalAntennaSolutionsTable_CLASS */
static const ByteOrder * Machine_Endianity
Definition: Misc.h:119
The Interval class implements an interval of time in units of nanoseconds.
Definition: Interval.h:58
static std::string name()
Return the name of this table.
CalAntennaSolutionsTable(ASDM &container)
Create a CalAntennaSolutionsTable.
CalAntennaSolutionsRow * getRowByKey(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, Tag spectralWindowId)
Returns a CalAntennaSolutionsRow* given a key.
struct _xmlDoc xmlDoc
Definition: Misc.h:59
unsigned int size() const
Return the number of rows in the table.
The CalAntennaSolutionsTable class is an Alma table.
std::string MIMEXMLPart(const asdm::ByteOrder *byteOrder=asdm::ByteOrder::Machine_Endianity)
Private methods involved during the export of this table into disk file(s).
A class to represent byte order information.
Definition: Misc.h:115
void append(CalAntennaSolutionsRow *x)
Brutally append an CalAntennaSolutionsRow x to the collection of rows already stored in 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.
The ASDM class is the container for all tables.
Definition: ASDM.h:273
void setFromFile(const std::string &directory)
Reads and parses a file containing a representation of a CalAntennaSolutionsTable as those produced b...
CalAntennaSolutionsRow * checkAndAdd(CalAntennaSolutionsRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
bool loadInProgress
Load the table in memory if necessary.
std::string getName() const
Return the name of this table.
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...
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...
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...
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.
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
std::string toXML()
Produces an XML representation conform to the schema defined for CalAntennaSolutions (CalAntennaSolut...
CalAntennaSolutionsRow * add(CalAntennaSolutionsRow *x)
====&gt; Append a row to its table.
asdmIDL::CalAntennaSolutionsTableIDL * toIDL()
Conversion Methods.
static const std::vector< std::string > & defaultAttributesNamesInBin()
Return the default sorted list of attributes names in the binary representation of the table...
void addWithoutCheckingUnique(CalAntennaSolutionsRow *x)
Brutally append an CalAntennaSolutionsRow x to the collection of rows already stored in this table...
CalAntennaSolutionsRow * lookup(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, ReceiverBandMod::ReceiverBand receiverBand, BasebandNameMod::BasebandName basebandName, Tag calDataId, Tag calReductionId, Tag spectralWindowId, ArrayTime startValidTime, ArrayTime endValidTime, int numReceptor, std::string refAntennaName, std::vector< Angle > direction, std::vector< Frequency > frequencyRange, Interval integrationTime, std::vector< PolarizationTypeMod::PolarizationType > polarizationTypes, bool correctionValidity, std::vector< float > phaseAnt, std::vector< float > phaseAntRMS, std::vector< float > amplitudeAnt, std::vector< float > amplitudeAntRMS)
Look up the table for a row whose all attributes are equal to the corresponding parameters of the met...
void toFile(std::string directory)
Stores a representation (binary or XML) of this table into a file.
The ArrayTime class implements the concept of a point in time, implemented as an Interval of time sin...
Definition: ArrayTime.h:89
void fromIDL(asdmIDL::CalAntennaSolutionsTableIDL x)
Populate this table from the content of a CalAntennaSolutionsTableIDL Corba structure.
std::vector< CalAntennaSolutionsRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
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
The CalAntennaSolutionsRow class is a row of a CalAntennaSolutionsTable.
ASDM & getContainer() const
Return the container to which this table belongs.
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
const Double e
e and functions thereof:
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
CalAntennaSolutionsRow * newRow()
====&gt; Row creation.
std::string getVersion() const
Return the version information about this table.
std::vector< CalAntennaSolutionsRow * > row
void setFromXMLFile(const std::string &directory)
void setEntity(Entity e)
Set this table&#39;s Entity.
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes of this table.