casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DelayModelVariableParametersTable.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 DelayModelVariableParametersTable.h
32  */
33 
34 #ifndef DelayModelVariableParametersTable_CLASS
35 #define DelayModelVariableParametersTable_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/AngularRate.h>
49 
50 
51 
52 #include <alma/ASDM/ArrayTime.h>
53 
54 
55 
56 #include <alma/ASDM/Tag.h>
57 
58 
59 
60 
61 
62 
63 
64 
65 
66 
67 
68 
69 
70 
72 
73 
74 
75 
76 
77 
78 
79 
80 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
95 #include <alma/ASDM/DuplicateKey.h>
97 #include <alma/ASDM/NoSuchRow.h>
98 #include <alma/ASDM/DuplicateKey.h>
99 
100 
101 #ifndef WITHOUT_ACS
102 #include <asdmIDLC.h>
103 #endif
104 
105 #include <alma/ASDM/Representable.h>
106 
107 #include <pthread.h>
108 
109 namespace asdm {
110 
111 //class asdm::ASDM;
112 //class asdm::DelayModelVariableParametersRow;
113 
114 class ASDM;
115 class DelayModelVariableParametersRow;
244  friend class ASDM;
245 
246 public:
247 
248 
254  static const std::vector<std::string>& getKeyName();
255 
256 
258 
264  ASDM &getContainer() const;
265 
271  unsigned int size() const;
272 
280  std::string getName() const;
281 
289  static std::string name() ;
290 
295  std::string getVersion() const ;
296 
302  static const std::vector<std::string>& getAttributesNames();
303 
309  static const std::vector<std::string>& defaultAttributesNamesInBin();
310 
314  Entity getEntity() const;
315 
320  void setEntity(Entity e);
321 
329  std::string toXML() ;
330 
331 #ifndef WITHOUT_ACS
332  // Conversion Methods
338  asdmIDL::DelayModelVariableParametersTableIDL *toIDL() ;
339 
347  void toIDL(asdmIDL::DelayModelVariableParametersTableIDL& x) const;
348 
349 #endif
350 
351 #ifndef WITHOUT_ACS
352 
358  void fromIDL(asdmIDL::DelayModelVariableParametersTableIDL x) ;
359 #endif
360 
361  //
362  // ====> Row creation.
363  //
364 
370 
371 
395  DelayModelVariableParametersRow *newRow(ArrayTime time, double ut1_utc, double iat_utc, DifferenceTypeMod::DifferenceType timeType, Angle gstAtUt0, AngularRate earthRotationRate, std::vector<double > polarOffsets, DifferenceTypeMod::DifferenceType polarOffsetsType, Tag delayModelFixedParametersId);
396 
397 
398 
412 
413  //
414  // ====> Append a row to its table.
415  //
416 
417 
418 
419 
430 
431 
432 
433  //
434  // ====> Methods returning rows.
435  //
436 
442  std::vector<DelayModelVariableParametersRow *> get() ;
443 
450  const std::vector<DelayModelVariableParametersRow *>& get() const ;
451 
452 
453 
454 
455 
465  DelayModelVariableParametersRow* getRowByKey(Tag delayModelVariableParametersId);
466 
467 
468 
469 
470 
496  DelayModelVariableParametersRow* lookup(ArrayTime time, double ut1_utc, double iat_utc, DifferenceTypeMod::DifferenceType timeType, Angle gstAtUt0, AngularRate earthRotationRate, std::vector<double > polarOffsets, DifferenceTypeMod::DifferenceType polarOffsetsType, Tag delayModelFixedParametersId);
497 
498 
499  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
500  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
501 
502 private:
503 
513 
515 
516  bool archiveAsBin; // If true archive binary else archive XML
517  bool fileAsBin ; // If true file binary else file XML
518 
519  std::string version ;
520 
522 
523 
524 
525 
526 
527  // A map for the autoincrementation algorithm
528  std::map<std::string,int> noAutoIncIds;
529  void autoIncrement(std::string key, DelayModelVariableParametersRow* x);
530 
531 
542 
549 
556 
557 
558 
559 
560 
561 // A data structure to store the pointers on the table's rows.
562 
563 // In all cases we maintain a private vector of DelayModelVariableParametersRow s.
564  std::vector<DelayModelVariableParametersRow * > privateRows;
565 
566 
567 
568  std::vector<DelayModelVariableParametersRow *> row;
569 
570 
571  void error() ; //throw(ConversionException);
572 
573 
580  void fromXML(std::string& xmlDoc) ;
581 
582  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
583 
588  void setFromMIMEFile(const std::string& directory);
589  /*
590  void openMIMEFile(const std::string& directory);
591  */
592  void setFromXMLFile(const std::string& directory);
593 
601  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
602 
603 
610  void setFromMIME(const std::string & mimeMsg);
611 
615  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
616 
626  void toFile(std::string directory);
627 
633  if (!presentInMemory && !loadInProgress) {
634  loadInProgress = true;
635  setFromFile(getContainer().getDirectory());
636  presentInMemory = true;
637  loadInProgress = false;
638  }
639  }
648  void setFromFile(const std::string& directory);
649 
650 };
651 
652 } // End namespace asdm
653 
654 #endif /* DelayModelVariableParametersTable_CLASS */
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.
std::vector< DelayModelVariableParametersRow * > row
std::map< std::string, int > noAutoIncIds
A map for the autoincrementation algorithm.
DelayModelVariableParametersRow * newRow()
====&gt; Row creation.
void autoIncrement(std::string key, DelayModelVariableParametersRow *x)
struct _xmlDoc xmlDoc
Definition: Misc.h:59
A class to represent byte order information.
Definition: Misc.h:115
static std::string name()
Return the name of this table.
std::vector< DelayModelVariableParametersRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
ABSTRACT TOOL CLASSES A PlotTool is a higher level event handler for a PlotCanvas The idea is to take common tasks which may require multiple events and put them in one place PlotTools also provide additional functionality in that they can be active and blocking non blocking The PlotCanvas will only send events to active and will not send events to later tools or event handlers if the latest tool was blocking In this way a single tool can be used to handle ALL user interaction via the GUI at one time
Definition: PlotTool.h:43
The ASDM class is the container for all tables.
Definition: ASDM.h:273
void setFromXMLFile(const std::string &directory)
DelayModelVariableParametersRow * add(DelayModelVariableParametersRow *x)
====&gt; Append a row to its table.
DelayModelVariableParametersRow * lookup(ArrayTime time, double ut1_utc, double iat_utc, DifferenceTypeMod::DifferenceType timeType, Angle gstAtUt0, AngularRate earthRotationRate, std::vector< double > polarOffsets, DifferenceTypeMod::DifferenceType polarOffsetsType, Tag delayModelFixedParametersId)
Look up the table for a row whose all attributes except the autoincrementable one are equal to the co...
bool loadInProgress
Load the table in memory if necessary.
unsigned int size() const
Return the number of rows in the table.
The DelayModelVariableParametersTable class is an Alma table.
The Angle class implements a quantity of angle in radians.
Definition: Angle.h:53
void fromIDL(asdmIDL::DelayModelVariableParametersTableIDL x)
Populate this table from the content of a DelayModelVariableParametersTableIDL Corba structure...
DelayModelVariableParametersRow * checkAndAdd(DelayModelVariableParametersRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
std::string toXML()
Produces an XML representation conform to the schema defined for DelayModelVariableParameters (DelayM...
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.
asdmIDL::DelayModelVariableParametersTableIDL * toIDL()
Conversion Methods.
The AngularRate class implements a quantity of AngularRate in radians per second. ...
Definition: AngularRate.h:53
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...
void append(DelayModelVariableParametersRow *x)
Brutally append an DelayModelVariableParametersRow x to the collection of rows already stored in this...
DelayModelVariableParametersRow * getRowByKey(Tag delayModelVariableParametersId)
Returns a DelayModelVariableParametersRow* given a key.
The DelayModelVariableParametersRow class is a row of a DelayModelVariableParametersTable.
The ArrayTime class implements the concept of a point in time, implemented as an Interval of time sin...
Definition: ArrayTime.h:89
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.
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
DelayModelVariableParametersTable(ASDM &container)
Create a DelayModelVariableParametersTable.
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
void addWithoutCheckingUnique(DelayModelVariableParametersRow *x)
Brutally append an DelayModelVariableParametersRow x to the collection of rows already stored in this...
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
Entity getEntity() const
Return this table&#39;s Entity.
const Double e
e and functions thereof:
ASDM & getContainer() const
Return the container to which this table belongs.
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 DelayModelVariableParametersTable as those p...
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 getName() const
Return the name of this table.
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
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 setEntity(Entity e)
Set this table&#39;s Entity.
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes of this table.
std::string getVersion() const
Return the version information about this table.
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59