casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalDelayTable.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 CalDelayTable.h
32  */
33 
34 #ifndef CalDelayTable_CLASS
35 #define CalDelayTable_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 
61 
62 
63 
64 
66 
67 
68 
70 
71 
72 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
108 
109 
110 
111 
113 #include <alma/ASDM/DuplicateKey.h>
115 #include <alma/ASDM/NoSuchRow.h>
116 #include <alma/ASDM/DuplicateKey.h>
117 
118 
119 #ifndef WITHOUT_ACS
120 #include <asdmIDLC.h>
121 #endif
122 
123 #include <alma/ASDM/Representable.h>
124 
125 #include <pthread.h>
126 
127 namespace asdm {
128 
129 //class asdm::ASDM;
130 //class asdm::CalDelayRow;
131 
132 class ASDM;
133 class CalDelayRow;
320 class CalDelayTable : public Representable {
321  friend class ASDM;
322 
323 public:
324 
325 
331  static const std::vector<std::string>& getKeyName();
332 
333 
334  virtual ~CalDelayTable();
335 
341  ASDM &getContainer() const;
342 
348  unsigned int size() const;
349 
357  std::string getName() const;
358 
366  static std::string name() ;
367 
372  std::string getVersion() const ;
373 
379  static const std::vector<std::string>& getAttributesNames();
380 
386  static const std::vector<std::string>& defaultAttributesNamesInBin();
387 
391  Entity getEntity() const;
392 
397  void setEntity(Entity e);
398 
406  std::string toXML() ;
407 
408 #ifndef WITHOUT_ACS
409  // Conversion Methods
415  asdmIDL::CalDelayTableIDL *toIDL() ;
416 
424  void toIDL(asdmIDL::CalDelayTableIDL& x) const;
425 
426 #endif
427 
428 #ifndef WITHOUT_ACS
429 
435  void fromIDL(asdmIDL::CalDelayTableIDL x) ;
436 #endif
437 
438  //
439  // ====> Row creation.
440  //
441 
446  CalDelayRow *newRow();
447 
448 
484  CalDelayRow *newRow(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, BasebandNameMod::BasebandName basebandName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, std::string refAntennaName, int numReceptor, std::vector<double > delayError, std::vector<double > delayOffset, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector<double > reducedChiSquared, std::vector<double > appliedDelay);
485 
486 
487 
501 
502  //
503  // ====> Append a row to its table.
504  //
505 
506 
519  CalDelayRow* add(CalDelayRow* x) ;
520 
521 
522 
523 
524 
525  //
526  // ====> Methods returning rows.
527  //
528 
534  std::vector<CalDelayRow *> get() ;
535 
542  const std::vector<CalDelayRow *>& get() const ;
543 
544 
545 
546 
547 
567  CalDelayRow* getRowByKey(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, BasebandNameMod::BasebandName basebandName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
568 
569 
570 
571 
572 
610  CalDelayRow* lookup(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, BasebandNameMod::BasebandName basebandName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, std::string refAntennaName, int numReceptor, std::vector<double > delayError, std::vector<double > delayOffset, std::vector<PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector<double > reducedChiSquared, std::vector<double > appliedDelay);
611 
612 
613  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
614  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
615 
616 private:
617 
627 
629 
630  bool archiveAsBin; // If true archive binary else archive XML
631  bool fileAsBin ; // If true file binary else file XML
632 
633  std::string version ;
634 
636 
637 
638 
639 
640 
641 
649  CalDelayRow* checkAndAdd(CalDelayRow* x, bool skipCheckUniqueness=false) ;
650 
656  void append(CalDelayRow* x) ;
657 
664 
665 
666 
667 
668 
669 // A data structure to store the pointers on the table's rows.
670 
671 // In all cases we maintain a private vector of CalDelayRow s.
672  std::vector<CalDelayRow * > privateRows;
673 
674 
675 
676  std::vector<CalDelayRow *> row;
677 
678 
679  void error() ; //throw(ConversionException);
680 
681 
688  void fromXML(std::string& xmlDoc) ;
689 
690  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
691 
696  void setFromMIMEFile(const std::string& directory);
697  /*
698  void openMIMEFile(const std::string& directory);
699  */
700  void setFromXMLFile(const std::string& directory);
701 
709  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
710 
711 
718  void setFromMIME(const std::string & mimeMsg);
719 
723  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
724 
734  void toFile(std::string directory);
735 
741  if (!presentInMemory && !loadInProgress) {
742  loadInProgress = true;
743  setFromFile(getContainer().getDirectory());
744  presentInMemory = true;
745  loadInProgress = false;
746  }
747  }
756  void setFromFile(const std::string& directory);
757 
758 };
759 
760 } // End namespace asdm
761 
762 #endif /* CalDelayTable_CLASS */
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
unsigned int size() const
Return the number of rows in the table.
void append(CalDelayRow *x)
Brutally append an CalDelayRow x to the collection of rows already stored in this table...
std::string getVersion() const
Return the version information about this table.
void setEntity(Entity e)
Set this table&#39;s Entity.
static const ByteOrder * Machine_Endianity
Definition: Misc.h:119
The CalDelayTable class is an Alma table.
static const std::vector< std::string > & getKeyName()
Return the list of field names that make up key key as an array of strings.
virtual ~CalDelayTable()
void setFromFile(const std::string &directory)
Reads and parses a file containing a representation of a CalDelayTable as those produced by the toFil...
std::vector< CalDelayRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
CalDelayRow * newRow()
====&gt; Row creation.
struct _xmlDoc xmlDoc
Definition: Misc.h:59
ASDM & getContainer() const
Return the container to which this table belongs.
void fromIDL(asdmIDL::CalDelayTableIDL x)
Populate this table from the content of a CalDelayTableIDL Corba structure.
The CalDelayRow class is a row of a CalDelayTable.
Definition: CalDelayRow.h:152
A class to represent byte order information.
Definition: Misc.h:115
CalDelayTable(ASDM &container)
Create a CalDelayTable.
std::string toXML()
Produces an XML representation conform to the schema defined for CalDelay (CalDelayTable.xsd).
The ASDM class is the container for all tables.
Definition: ASDM.h:273
CalDelayRow * add(CalDelayRow *x)
====&gt; Append a row to its 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).
bool loadInProgress
Load the table in memory if necessary.
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
Entity getEntity() const
Return this table&#39;s Entity.
asdmIDL::CalDelayTableIDL * toIDL()
Conversion Methods.
static std::string name()
Return the name of 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.
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
CalDelayRow * checkAndAdd(CalDelayRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
CalDelayRow * lookup(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, BasebandNameMod::BasebandName basebandName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, std::string refAntennaName, int numReceptor, std::vector< double > delayError, std::vector< double > delayOffset, std::vector< PolarizationTypeMod::PolarizationType > polarizationTypes, std::vector< double > reducedChiSquared, std::vector< double > appliedDelay)
Look up the table for a row whose all attributes are equal to the corresponding parameters of the met...
std::vector< CalDelayRow * > row
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes of this table.
void addWithoutCheckingUnique(CalDelayRow *x)
Brutally append an CalDelayRow x to the collection of rows already stored in this 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
const Double e
e and functions thereof:
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 getName() const
Return the name of this table.
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 fromXML(std::string &xmlDoc)
Populate this table from the content of a XML document that is required to be conform to the XML sche...
CalDelayRow * getRowByKey(std::string antennaName, AtmPhaseCorrectionMod::AtmPhaseCorrection atmPhaseCorrection, BasebandNameMod::BasebandName basebandName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId)
Returns a CalDelayRow* given a key.
static const std::vector< std::string > & defaultAttributesNamesInBin()
Return the default sorted list of attributes names in the binary representation of the table...
void setFromXMLFile(const std::string &directory)
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59