casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalAppPhaseTable.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 CalAppPhaseTable.h
32  */
33 
34 #ifndef CalAppPhaseTable_CLASS
35 #define CalAppPhaseTable_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/Tag.h>
49 
50 
51 
52 
53 
54 
56 
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
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::CalAppPhaseRow;
129 
130 class ASDM;
131 class CalAppPhaseRow;
364  friend class ASDM;
365 
366 public:
367 
368 
374  static const std::vector<std::string>& getKeyName();
375 
376 
377  virtual ~CalAppPhaseTable();
378 
384  ASDM &getContainer() const;
385 
391  unsigned int size() const;
392 
400  std::string getName() const;
401 
409  static std::string name() ;
410 
415  std::string getVersion() const ;
416 
422  static const std::vector<std::string>& getAttributesNames();
423 
429  static const std::vector<std::string>& defaultAttributesNamesInBin();
430 
434  Entity getEntity() const;
435 
440  void setEntity(Entity e);
441 
449  std::string toXML() ;
450 
451 #ifndef WITHOUT_ACS
452  // Conversion Methods
458  asdmIDL::CalAppPhaseTableIDL *toIDL() ;
459 
467  void toIDL(asdmIDL::CalAppPhaseTableIDL& x) const;
468 
469 #endif
470 
471 #ifndef WITHOUT_ACS
472 
478  void fromIDL(asdmIDL::CalAppPhaseTableIDL x) ;
479 #endif
480 
481  //
482  // ====> Row creation.
483  //
484 
490 
491 
547  CalAppPhaseRow *newRow(BasebandNameMod::BasebandName basebandName, int scanNumber, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, ArrayTime adjustTime, std::string adjustToken, std::string phasingMode, int numPhasedAntennas, std::vector<std::string > phasedAntennas, int refAntennaIndex, int candRefAntennaIndex, std::string phasePacking, int numReceptors, int numChannels, int numPhaseValues, std::vector<float > phaseValues, int numCompare, int numEfficiencies, std::vector<std::string > compareArray, std::vector<int > efficiencyIndices, std::vector<std::vector<float > > efficiencies, std::vector<float > quality, std::string phasedSumAntenna);
548 
549 
550 
564 
565  //
566  // ====> Append a row to its table.
567  //
568 
569 
583 
584 
585 
586 
587 
588  //
589  // ====> Methods returning rows.
590  //
591 
597  std::vector<CalAppPhaseRow *> get() ;
598 
605  const std::vector<CalAppPhaseRow *>& get() const ;
606 
607 
608 
609 
610 
626  CalAppPhaseRow* getRowByKey(BasebandNameMod::BasebandName basebandName, int scanNumber, Tag calDataId, Tag calReductionId);
627 
628 
629 
630 
631 
689  CalAppPhaseRow* lookup(BasebandNameMod::BasebandName basebandName, int scanNumber, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, ArrayTime adjustTime, std::string adjustToken, std::string phasingMode, int numPhasedAntennas, std::vector<std::string > phasedAntennas, int refAntennaIndex, int candRefAntennaIndex, std::string phasePacking, int numReceptors, int numChannels, int numPhaseValues, std::vector<float > phaseValues, int numCompare, int numEfficiencies, std::vector<std::string > compareArray, std::vector<int > efficiencyIndices, std::vector<std::vector<float > > efficiencies, std::vector<float > quality, std::string phasedSumAntenna);
690 
691 
692  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
693  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
694 
695 private:
696 
706 
708 
709  bool archiveAsBin; // If true archive binary else archive XML
710  bool fileAsBin ; // If true file binary else file XML
711 
712  std::string version ;
713 
715 
716 
717 
718 
719 
720 
728  CalAppPhaseRow* checkAndAdd(CalAppPhaseRow* x, bool skipCheckUniqueness=false) ;
729 
735  void append(CalAppPhaseRow* x) ;
736 
743 
744 
745 
746 
747 
748 // A data structure to store the pointers on the table's rows.
749 
750 // In all cases we maintain a private vector of CalAppPhaseRow s.
751  std::vector<CalAppPhaseRow * > privateRows;
752 
753 
754 
755  std::vector<CalAppPhaseRow *> row;
756 
757 
758  void error() ; //throw(ConversionException);
759 
760 
767  void fromXML(std::string& xmlDoc) ;
768 
769  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
770 
775  void setFromMIMEFile(const std::string& directory);
776  /*
777  void openMIMEFile(const std::string& directory);
778  */
779  void setFromXMLFile(const std::string& directory);
780 
788  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
789 
790 
797  void setFromMIME(const std::string & mimeMsg);
798 
802  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
803 
813  void toFile(std::string directory);
814 
820  if (!presentInMemory && !loadInProgress) {
821  loadInProgress = true;
822  setFromFile(getContainer().getDirectory());
823  presentInMemory = true;
824  loadInProgress = false;
825  }
826  }
835  void setFromFile(const std::string& directory);
836 
837 };
838 
839 } // End namespace asdm
840 
841 #endif /* CalAppPhaseTable_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...
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...
static const ByteOrder * Machine_Endianity
Definition: Misc.h:119
The CalAppPhaseTable class is an Alma table.
CalAppPhaseRow * getRowByKey(BasebandNameMod::BasebandName basebandName, int scanNumber, Tag calDataId, Tag calReductionId)
Returns a CalAppPhaseRow* given a key.
ASDM & getContainer() const
Return the container to which this table belongs.
std::string toXML()
Produces an XML representation conform to the schema defined for CalAppPhase (CalAppPhaseTable.xsd).
std::string getVersion() const
Return the version information about this table.
struct _xmlDoc xmlDoc
Definition: Misc.h:59
A class to represent byte order information.
Definition: Misc.h:115
CalAppPhaseRow * add(CalAppPhaseRow *x)
====&gt; Append a row to its table.
void addWithoutCheckingUnique(CalAppPhaseRow *x)
Brutally append an CalAppPhaseRow x to the collection of rows already stored in this table...
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
The ASDM class is the container for all tables.
Definition: ASDM.h:273
void toFile(std::string directory)
Stores a representation (binary or XML) of this table into a file.
CalAppPhaseRow * lookup(BasebandNameMod::BasebandName basebandName, int scanNumber, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, ArrayTime adjustTime, std::string adjustToken, std::string phasingMode, int numPhasedAntennas, std::vector< std::string > phasedAntennas, int refAntennaIndex, int candRefAntennaIndex, std::string phasePacking, int numReceptors, int numChannels, int numPhaseValues, std::vector< float > phaseValues, int numCompare, int numEfficiencies, std::vector< std::string > compareArray, std::vector< int > efficiencyIndices, std::vector< std::vector< float > > efficiencies, std::vector< float > quality, std::string phasedSumAntenna)
Look up the table for a row whose all attributes are equal to the corresponding parameters of the met...
static const std::vector< std::string > & getKeyName()
Return the list of field names that make up key key as an array of strings.
void setEntity(Entity e)
Set this table&#39;s Entity.
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 CalAppPhaseTable as those produced by the to...
CalAppPhaseTable(ASDM &container)
Create a CalAppPhaseTable.
std::vector< CalAppPhaseRow * > row
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
bool loadInProgress
Load the table in memory if necessary.
std::vector< CalAppPhaseRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
static std::string name()
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
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
std::string getName() const
Return the name of this table.
unsigned int size() const
Return the number of rows in the 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:
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 setFromXMLFile(const std::string &directory)
The CalAppPhaseRow class is a row of a CalAppPhaseTable.
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes 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 append(CalAppPhaseRow *x)
Brutally append an CalAppPhaseRow 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...
Entity getEntity() const
Return this table&#39;s Entity.
void fromIDL(asdmIDL::CalAppPhaseTableIDL x)
Populate this table from the content of a CalAppPhaseTableIDL Corba structure.
asdmIDL::CalAppPhaseTableIDL * toIDL()
Conversion Methods.
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
CalAppPhaseRow * checkAndAdd(CalAppPhaseRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59
CalAppPhaseRow * newRow()
====&gt; Row creation.