casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalHolographyTable.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 CalHolographyTable.h
32  */
33 
34 #ifndef CalHolographyTable_CLASS
35 #define CalHolographyTable_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/Length.h>
57 
58 
59 
60 #include <alma/ASDM/Frequency.h>
61 
62 
63 
64 #include <alma/ASDM/Tag.h>
65 
66 
67 
68 #include <alma/ASDM/EntityRef.h>
69 
70 
71 
72 
73 
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 
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 
133 #include <alma/ASDM/DuplicateKey.h>
135 #include <alma/ASDM/NoSuchRow.h>
136 #include <alma/ASDM/DuplicateKey.h>
137 
138 
139 #ifndef WITHOUT_ACS
140 #include <asdmIDLC.h>
141 #endif
142 
143 #include <alma/ASDM/Representable.h>
144 
145 #include <pthread.h>
146 
147 namespace asdm {
148 
149 //class asdm::ASDM;
150 //class asdm::CalHolographyRow;
151 
152 class ASDM;
153 class CalHolographyRow;
377  friend class ASDM;
378 
379 public:
380 
381 
387  static const std::vector<std::string>& getKeyName();
388 
389 
390  virtual ~CalHolographyTable();
391 
397  ASDM &getContainer() const;
398 
404  unsigned int size() const;
405 
413  std::string getName() const;
414 
422  static std::string name() ;
423 
428  std::string getVersion() const ;
429 
435  static const std::vector<std::string>& getAttributesNames();
436 
442  static const std::vector<std::string>& defaultAttributesNamesInBin();
443 
447  Entity getEntity() const;
448 
453  void setEntity(Entity e);
454 
462  std::string toXML() ;
463 
464 #ifndef WITHOUT_ACS
465  // Conversion Methods
471  asdmIDL::CalHolographyTableIDL *toIDL() ;
472 
480  void toIDL(asdmIDL::CalHolographyTableIDL& x) const;
481 
482 #endif
483 
484 #ifndef WITHOUT_ACS
485 
491  void fromIDL(asdmIDL::CalHolographyTableIDL x) ;
492 #endif
493 
494  //
495  // ====> Row creation.
496  //
497 
503 
504 
548  CalHolographyRow *newRow(std::string antennaName, Tag calDataId, Tag calReductionId, AntennaMakeMod::AntennaMake antennaMake, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, std::vector<Length > focusPosition, std::vector<Frequency > frequencyRange, double illuminationTaper, int numReceptor, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, int numPanelModes, ReceiverBandMod::ReceiverBand receiverBand, EntityRef beamMapUID, Length rawRMS, Length weightedRMS, EntityRef surfaceMapUID, std::vector<Angle > direction);
549 
550 
551 
565 
566  //
567  // ====> Append a row to its table.
568  //
569 
570 
584 
585 
586 
587 
588 
589  //
590  // ====> Methods returning rows.
591  //
592 
598  std::vector<CalHolographyRow *> get() ;
599 
606  const std::vector<CalHolographyRow *>& get() const ;
607 
608 
609 
610 
611 
625  CalHolographyRow* getRowByKey(std::string antennaName, Tag calDataId, Tag calReductionId);
626 
627 
628 
629 
630 
676  CalHolographyRow* lookup(std::string antennaName, Tag calDataId, Tag calReductionId, AntennaMakeMod::AntennaMake antennaMake, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, std::vector<Length > focusPosition, std::vector<Frequency > frequencyRange, double illuminationTaper, int numReceptor, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, int numPanelModes, ReceiverBandMod::ReceiverBand receiverBand, EntityRef beamMapUID, Length rawRMS, Length weightedRMS, EntityRef surfaceMapUID, std::vector<Angle > direction);
677 
678 
679  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
680  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
681 
682 private:
683 
693 
695 
696  bool archiveAsBin; // If true archive binary else archive XML
697  bool fileAsBin ; // If true file binary else file XML
698 
699  std::string version ;
700 
702 
703 
704 
705 
706 
707 
715  CalHolographyRow* checkAndAdd(CalHolographyRow* x, bool skipCheckUniqueness=false) ;
716 
722  void append(CalHolographyRow* x) ;
723 
730 
731 
732 
733 
734 
735 // A data structure to store the pointers on the table's rows.
736 
737 // In all cases we maintain a private vector of CalHolographyRow s.
738  std::vector<CalHolographyRow * > privateRows;
739 
740 
741 
742  std::vector<CalHolographyRow *> row;
743 
744 
745  void error() ; //throw(ConversionException);
746 
747 
754  void fromXML(std::string& xmlDoc) ;
755 
756  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
757 
762  void setFromMIMEFile(const std::string& directory);
763  /*
764  void openMIMEFile(const std::string& directory);
765  */
766  void setFromXMLFile(const std::string& directory);
767 
775  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
776 
777 
784  void setFromMIME(const std::string & mimeMsg);
785 
789  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
790 
800  void toFile(std::string directory);
801 
807  if (!presentInMemory && !loadInProgress) {
808  loadInProgress = true;
809  setFromFile(getContainer().getDirectory());
810  presentInMemory = true;
811  loadInProgress = false;
812  }
813  }
822  void setFromFile(const std::string& directory);
823 
824 };
825 
826 } // End namespace asdm
827 
828 #endif /* CalHolographyTable_CLASS */
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...
static const std::vector< std::string > & getKeyName()
Return the list of field names that make up key key as an array of strings.
static const ByteOrder * Machine_Endianity
Definition: Misc.h:119
CalHolographyRow * lookup(std::string antennaName, Tag calDataId, Tag calReductionId, AntennaMakeMod::AntennaMake antennaMake, ArrayTime startValidTime, ArrayTime endValidTime, Temperature ambientTemperature, std::vector< Length > focusPosition, std::vector< Frequency > frequencyRange, double illuminationTaper, int numReceptor, std::vector< PolarizationTypeMod::PolarizationType > polarizationTypes, int numPanelModes, ReceiverBandMod::ReceiverBand receiverBand, EntityRef beamMapUID, Length rawRMS, Length weightedRMS, EntityRef surfaceMapUID, std::vector< Angle > direction)
Look up the table for a row whose all attributes are equal to the corresponding parameters of the met...
std::vector< CalHolographyRow * > row
void setFromXMLFile(const std::string &directory)
std::vector< CalHolographyRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
unsigned int size() const
Return the number of rows in the table.
static const std::vector< std::string > & defaultAttributesNamesInBin()
Return the default sorted list of attributes names in the binary representation of the table...
void setFromFile(const std::string &directory)
Reads and parses a file containing a representation of a CalHolographyTable as those produced by the ...
struct _xmlDoc xmlDoc
Definition: Misc.h:59
void setEntity(Entity e)
Set this table&#39;s Entity.
std::string getVersion() const
Return the version information about this table.
A class to represent byte order information.
Definition: Misc.h:115
Entity getEntity() const
Return this table&#39;s Entity.
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
The ASDM class is the container for all tables.
Definition: ASDM.h:273
CalHolographyRow * newRow()
====&gt; Row creation.
The CalHolographyRow class is a row of a CalHolographyTable.
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::string toXML()
Produces an XML representation conform to the schema defined for CalHolography (CalHolographyTable.xsd).
The Temperature class implements a quantity of temperature in degrees Kelvin.
Definition: Temperature.h:53
The EntityRef class is an identification of a persistant entity in the ALMA archive.
Definition: EntityRef.h:58
bool loadInProgress
Load the table in memory if necessary.
void toFile(std::string directory)
Stores a representation (binary or XML) of this table into a file.
CalHolographyRow * checkAndAdd(CalHolographyRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
void addWithoutCheckingUnique(CalHolographyRow *x)
Brutally append an CalHolographyRow x to the collection of rows already stored in this table...
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...
The Length class implements a quantity of length in meters.
Definition: Length.h:53
asdmIDL::CalHolographyTableIDL * toIDL()
Conversion Methods.
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
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...
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
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:
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
CalHolographyRow * getRowByKey(std::string antennaName, Tag calDataId, Tag calReductionId)
Returns a CalHolographyRow* given a key.
CalHolographyTable(ASDM &container)
Create a CalHolographyTable.
ASDM & getContainer() const
Return the container to which this table belongs.
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes of this table.
static std::string name()
Return the name of this table.
void append(CalHolographyRow *x)
Brutally append an CalHolographyRow x to the collection of rows already stored in this table...
The CalHolographyTable class is an Alma 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.
CalHolographyRow * add(CalHolographyRow *x)
====&gt; Append a row to its table.
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59
void fromIDL(asdmIDL::CalHolographyTableIDL x)
Populate this table from the content of a CalHolographyTableIDL Corba structure.