casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalPointingModelTable.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 CalPointingModelTable.h
32  */
33 
34 #ifndef CalPointingModelTable_CLASS
35 #define CalPointingModelTable_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/Tag.h>
53 
54 
55 
56 
57 
58 
59 
60 
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 
95 
96 
97 
98 
99 
100 
101 
102 
103 
105 #include <alma/ASDM/DuplicateKey.h>
107 #include <alma/ASDM/NoSuchRow.h>
108 #include <alma/ASDM/DuplicateKey.h>
109 
110 
111 #ifndef WITHOUT_ACS
112 #include <asdmIDLC.h>
113 #endif
114 
115 #include <alma/ASDM/Representable.h>
116 
117 #include <pthread.h>
118 
119 namespace asdm {
120 
121 //class asdm::ASDM;
122 //class asdm::CalPointingModelRow;
123 
124 class ASDM;
125 class CalPointingModelRow;
302  friend class ASDM;
303 
304 public:
305 
306 
312  static const std::vector<std::string>& getKeyName();
313 
314 
315  virtual ~CalPointingModelTable();
316 
322  ASDM &getContainer() const;
323 
329  unsigned int size() const;
330 
338  std::string getName() const;
339 
347  static std::string name() ;
348 
353  std::string getVersion() const ;
354 
360  static const std::vector<std::string>& getAttributesNames();
361 
367  static const std::vector<std::string>& defaultAttributesNamesInBin();
368 
372  Entity getEntity() const;
373 
378  void setEntity(Entity e);
379 
387  std::string toXML() ;
388 
389 #ifndef WITHOUT_ACS
390  // Conversion Methods
396  asdmIDL::CalPointingModelTableIDL *toIDL() ;
397 
405  void toIDL(asdmIDL::CalPointingModelTableIDL& x) const;
406 
407 #endif
408 
409 #ifndef WITHOUT_ACS
410 
416  void fromIDL(asdmIDL::CalPointingModelTableIDL x) ;
417 #endif
418 
419  //
420  // ====> Row creation.
421  //
422 
428 
429 
471  CalPointingModelRow *newRow(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, AntennaMakeMod::AntennaMake antennaMake, PointingModelModeMod::PointingModelMode pointingModelMode, PolarizationTypeMod::PolarizationType polarizationType, int numCoeff, std::vector<std::string > coeffName, std::vector<float > coeffVal, std::vector<float > coeffError, std::vector<bool > coeffFixed, Angle azimuthRMS, Angle elevationRms, Angle skyRMS, double reducedChiSquared);
472 
473 
474 
488 
489  //
490  // ====> Append a row to its table.
491  //
492 
493 
507 
508 
509 
510 
511 
512  //
513  // ====> Methods returning rows.
514  //
515 
521  std::vector<CalPointingModelRow *> get() ;
522 
529  const std::vector<CalPointingModelRow *>& get() const ;
530 
531 
532 
533 
534 
550  CalPointingModelRow* getRowByKey(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId);
551 
552 
553 
554 
555 
599  CalPointingModelRow* lookup(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, AntennaMakeMod::AntennaMake antennaMake, PointingModelModeMod::PointingModelMode pointingModelMode, PolarizationTypeMod::PolarizationType polarizationType, int numCoeff, std::vector<std::string > coeffName, std::vector<float > coeffVal, std::vector<float > coeffError, std::vector<bool > coeffFixed, Angle azimuthRMS, Angle elevationRms, Angle skyRMS, double reducedChiSquared);
600 
601 
602  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
603  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
604 
605 private:
606 
616 
618 
619  bool archiveAsBin; // If true archive binary else archive XML
620  bool fileAsBin ; // If true file binary else file XML
621 
622  std::string version ;
623 
625 
626 
627 
628 
629 
630 
638  CalPointingModelRow* checkAndAdd(CalPointingModelRow* x, bool skipCheckUniqueness=false) ;
639 
645  void append(CalPointingModelRow* x) ;
646 
653 
654 
655 
656 
657 
658 // A data structure to store the pointers on the table's rows.
659 
660 // In all cases we maintain a private vector of CalPointingModelRow s.
661  std::vector<CalPointingModelRow * > privateRows;
662 
663 
664 
665  std::vector<CalPointingModelRow *> row;
666 
667 
668  void error() ; //throw(ConversionException);
669 
670 
677  void fromXML(std::string& xmlDoc) ;
678 
679  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
680 
685  void setFromMIMEFile(const std::string& directory);
686  /*
687  void openMIMEFile(const std::string& directory);
688  */
689  void setFromXMLFile(const std::string& directory);
690 
698  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
699 
700 
707  void setFromMIME(const std::string & mimeMsg);
708 
712  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
713 
723  void toFile(std::string directory);
724 
730  if (!presentInMemory && !loadInProgress) {
731  loadInProgress = true;
732  setFromFile(getContainer().getDirectory());
733  presentInMemory = true;
734  loadInProgress = false;
735  }
736  }
745  void setFromFile(const std::string& directory);
746 
747 };
748 
749 } // End namespace asdm
750 
751 #endif /* CalPointingModelTable_CLASS */
static std::string name()
Return the name of this table.
static const ByteOrder * Machine_Endianity
Definition: Misc.h:119
void toFile(std::string directory)
Stores a representation (binary or XML) of this table into a file.
struct _xmlDoc xmlDoc
Definition: Misc.h:59
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
std::string getVersion() const
Return the version information about this table.
std::string toXML()
Produces an XML representation conform to the schema defined for CalPointingModel (CalPointingModelTa...
A class to represent byte order information.
Definition: Misc.h:115
ASDM & getContainer() const
Return the container to which this table belongs.
CalPointingModelRow * newRow()
====&gt; Row creation.
void addWithoutCheckingUnique(CalPointingModelRow *x)
Brutally append an CalPointingModelRow x to the collection of rows already stored in this table...
bool loadInProgress
Load the table in memory if necessary.
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 setEntity(Entity e)
Set this table&#39;s Entity.
CalPointingModelRow * checkAndAdd(CalPointingModelRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
asdmIDL::CalPointingModelTableIDL * toIDL()
Conversion Methods.
void append(CalPointingModelRow *x)
Brutally append an CalPointingModelRow x to the collection of rows already stored in this table...
The Angle class implements a quantity of angle in radians.
Definition: Angle.h:53
void fromIDL(asdmIDL::CalPointingModelTableIDL x)
Populate this table from the content of a CalPointingModelTableIDL Corba structure.
Entity getEntity() const
Return this table&#39;s Entity.
The CalPointingModelTable 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.
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...
std::string getName() const
Return the name of 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 ArrayTime class implements the concept of a point in time, implemented as an Interval of time sin...
Definition: ArrayTime.h:89
std::vector< CalPointingModelRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
static const std::vector< std::string > & defaultAttributesNamesInBin()
Return the default sorted list of attributes names in the binary representation of the table...
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
CalPointingModelRow * getRowByKey(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId)
Returns a CalPointingModelRow* given a key.
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
void setFromFile(const std::string &directory)
Reads and parses a file containing a representation of a CalPointingModelTable as those produced by t...
CalPointingModelRow * add(CalPointingModelRow *x)
====&gt; Append a row to its 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 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 setFromXMLFile(const std::string &directory)
std::vector< CalPointingModelRow * > row
CalPointingModelTable(ASDM &container)
Create a CalPointingModelTable.
The CalPointingModelRow class is a row of a CalPointingModelTable.
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
unsigned int size() const
Return the number of rows in the 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).
CalPointingModelRow * lookup(std::string antennaName, ReceiverBandMod::ReceiverBand receiverBand, Tag calDataId, Tag calReductionId, ArrayTime startValidTime, ArrayTime endValidTime, AntennaMakeMod::AntennaMake antennaMake, PointingModelModeMod::PointingModelMode pointingModelMode, PolarizationTypeMod::PolarizationType polarizationType, int numCoeff, std::vector< std::string > coeffName, std::vector< float > coeffVal, std::vector< float > coeffError, std::vector< bool > coeffFixed, Angle azimuthRMS, Angle elevationRms, Angle skyRMS, double reducedChiSquared)
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 > & getAttributesNames()
Return the names of the attributes of this table.
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59