casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalPointingTable.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 CalPointingTable.h
32  */
33 
34 #ifndef CalPointingTable_CLASS
35 #define CalPointingTable_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/Angle.h>
53 
54 
55 
56 #include <alma/ASDM/Frequency.h>
57 
58 
59 
60 #include <alma/ASDM/Tag.h>
61 
62 
63 
64 
65 
66 
67 
68 
70 
71 
72 
73 
74 
75 
76 
77 
78 
80 
81 
82 
84 
85 
86 
87 
88 
89 
90 
92 
93 
94 
96 
97 
98 
99 
100 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 
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 
143 #include <alma/ASDM/DuplicateKey.h>
145 #include <alma/ASDM/NoSuchRow.h>
146 #include <alma/ASDM/DuplicateKey.h>
147 
148 
149 #ifndef WITHOUT_ACS
150 #include <asdmIDLC.h>
151 #endif
152 
153 #include <alma/ASDM/Representable.h>
154 
155 #include <pthread.h>
156 
157 namespace asdm {
158 
159 //class asdm::ASDM;
160 //class asdm::CalPointingRow;
161 
162 class ASDM;
163 class CalPointingRow;
431  friend class ASDM;
432 
433 public:
434 
435 
441  static const std::vector<std::string>& getKeyName();
442 
443 
444  virtual ~CalPointingTable();
445 
451  ASDM &getContainer() const;
452 
458  unsigned int size() const;
459 
467  std::string getName() const;
468 
476  static std::string name() ;
477 
482  std::string getVersion() const ;
483 
489  static const std::vector<std::string>& getAttributesNames();
490 
496  static const std::vector<std::string>& defaultAttributesNamesInBin();
497 
501  Entity getEntity() const;
502 
507  void setEntity(Entity e);
508 
516  std::string toXML() ;
517 
518 #ifndef WITHOUT_ACS
519  // Conversion Methods
525  asdmIDL::CalPointingTableIDL *toIDL() ;
526 
534  void toIDL(asdmIDL::CalPointingTableIDL& x) const;
535 
536 #endif
537 
538 #ifndef WITHOUT_ACS
539 
545  void fromIDL(asdmIDL::CalPointingTableIDL x) ;
546 #endif
547 
548  //
549  // ====> Row creation.
550  //
551 
557 
558 
604  CalPointingRow *newRow(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, AntennaMakeMod::AntennaMake antennaMake, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, std::vector<Angle > direction, std::vector<Frequency > frequencyRange, PointingModelModeMod::PointingModelMode pointingModelMode, PointingMethodMod::PointingMethod pointingMethod, int numReceptor, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector<std::vector<Angle > > collOffsetRelative, std::vector<std::vector<Angle > > collOffsetAbsolute, std::vector<std::vector<Angle > > collError, std::vector<std::vector<bool > > collOffsetTied, std::vector<double > reducedChiSquared);
605 
606 
607 
621 
622  //
623  // ====> Append a row to its table.
624  //
625 
626 
640 
641 
642 
643 
644 
645  //
646  // ====> Methods returning rows.
647  //
648 
654  std::vector<CalPointingRow *> get() ;
655 
662  const std::vector<CalPointingRow *>& get() const ;
663 
664 
665 
666 
667 
683  CalPointingRow* getRowByKey(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
684 
685 
686 
687 
688 
736  CalPointingRow* lookup(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, AntennaMakeMod::AntennaMake antennaMake, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, std::vector<Angle > direction, std::vector<Frequency > frequencyRange, PointingModelModeMod::PointingModelMode pointingModelMode, PointingMethodMod::PointingMethod pointingMethod, int numReceptor, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector<std::vector<Angle > > collOffsetRelative, std::vector<std::vector<Angle > > collOffsetAbsolute, std::vector<std::vector<Angle > > collError, std::vector<std::vector<bool > > collOffsetTied, std::vector<double > reducedChiSquared);
737 
738 
739  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
740  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
741 
742 private:
743 
753 
755 
756  bool archiveAsBin; // If true archive binary else archive XML
757  bool fileAsBin ; // If true file binary else file XML
758 
759  std::string version ;
760 
762 
763 
764 
765 
766 
767 
775  CalPointingRow* checkAndAdd(CalPointingRow* x, bool skipCheckUniqueness=false) ;
776 
782  void append(CalPointingRow* x) ;
783 
790 
791 
792 
793 
794 
795 // A data structure to store the pointers on the table's rows.
796 
797 // In all cases we maintain a private vector of CalPointingRow s.
798  std::vector<CalPointingRow * > privateRows;
799 
800 
801 
802  std::vector<CalPointingRow *> row;
803 
804 
805  void error() ; //throw(ConversionException);
806 
807 
814  void fromXML(std::string& xmlDoc) ;
815 
816  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
817 
822  void setFromMIMEFile(const std::string& directory);
823  /*
824  void openMIMEFile(const std::string& directory);
825  */
826  void setFromXMLFile(const std::string& directory);
827 
835  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
836 
837 
844  void setFromMIME(const std::string & mimeMsg);
845 
849  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
850 
860  void toFile(std::string directory);
861 
867  if (!presentInMemory && !loadInProgress) {
868  loadInProgress = true;
869  setFromFile(getContainer().getDirectory());
870  presentInMemory = true;
871  loadInProgress = false;
872  }
873  }
882  void setFromFile(const std::string& directory);
883 
884 };
885 
886 } // End namespace asdm
887 
888 #endif /* CalPointingTable_CLASS */
static const ByteOrder * Machine_Endianity
Definition: Misc.h:119
asdmIDL::CalPointingTableIDL * toIDL()
Conversion Methods.
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
struct _xmlDoc xmlDoc
Definition: Misc.h:59
unsigned int size() const
Return the number of rows in the table.
A class to represent byte order information.
Definition: Misc.h:115
void append(CalPointingRow *x)
Brutally append an CalPointingRow x to the collection of rows already stored in this table...
Entity getEntity() const
Return this table&#39;s Entity.
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.
The ASDM class is the container for all tables.
Definition: ASDM.h:273
static const std::vector< std::string > & defaultAttributesNamesInBin()
Return the default sorted list of attributes names in the binary representation of the table...
std::string toXML()
Produces an XML representation conform to the schema defined for CalPointing (CalPointingTable.xsd).
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 fromXML(std::string &xmlDoc)
Populate this table from the content of a XML document that is required to be conform to the XML sche...
The Temperature class implements a quantity of temperature in degrees Kelvin.
Definition: Temperature.h:53
bool loadInProgress
Load the table in memory if necessary.
CalPointingRow * add(CalPointingRow *x)
====&gt; Append a row to its table.
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
The CalPointingRow class is a row of a CalPointingTable.
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< CalPointingRow * > row
std::vector< CalPointingRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
The ArrayTime class implements the concept of a point in time, implemented as an Interval of time sin...
Definition: ArrayTime.h:89
void setFromXMLFile(const std::string &directory)
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
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...
CalPointingRow * lookup(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, AntennaMakeMod::AntennaMake antennaMake, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, std::vector< Angle > direction, std::vector< Frequency > frequencyRange, PointingModelModeMod::PointingModelMode pointingModelMode, PointingMethodMod::PointingMethod pointingMethod, int numReceptor, std::vector< PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector< std::vector< Angle > > collOffsetRelative, std::vector< std::vector< Angle > > collOffsetAbsolute, std::vector< std::vector< Angle > > collError, std::vector< std::vector< bool > > collOffsetTied, std::vector< double > reducedChiSquared)
Look up the table for a row whose all attributes are equal to the corresponding parameters of the met...
ASDM & getContainer() const
Return the container to which this table belongs.
The CalPointingTable class is an Alma table.
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes of this table.
void addWithoutCheckingUnique(CalPointingRow *x)
Brutally append an CalPointingRow x to the collection of rows already stored in this 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.
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
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...
const Double e
e and functions thereof:
CalPointingRow * getRowByKey(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId)
Returns a CalPointingRow* given a key.
CalPointingRow * checkAndAdd(CalPointingRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
std::string getName() const
Return the name of this table.
CalPointingRow * newRow()
====&gt; Row creation.
void setEntity(Entity e)
Set this table&#39;s Entity.
void setFromFile(const std::string &directory)
Reads and parses a file containing a representation of a CalPointingTable as those produced by the to...
static std::string name()
Return the name of this table.
CalPointingTable(ASDM &container)
Create a CalPointingTable.
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59
void fromIDL(asdmIDL::CalPointingTableIDL x)
Populate this table from the content of a CalPointingTableIDL Corba structure.