casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DelayModelFixedParametersTable.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 DelayModelFixedParametersTable.h
32  */
33 
34 #ifndef DelayModelFixedParametersTable_CLASS
35 #define DelayModelFixedParametersTable_CLASS
36 
37 #include <string>
38 #include <vector>
39 #include <map>
40 
41 
42 
43 
44 #include <alma/ASDM/Speed.h>
45 
46 
47 
48 #include <alma/ASDM/AngularRate.h>
49 
50 
51 
52 #include <alma/ASDM/Length.h>
53 
54 
55 
56 #include <alma/ASDM/Tag.h>
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 
103 #include <alma/ASDM/DuplicateKey.h>
105 #include <alma/ASDM/NoSuchRow.h>
106 #include <alma/ASDM/DuplicateKey.h>
107 
108 
109 #ifndef WITHOUT_ACS
110 #include <asdmIDLC.h>
111 #endif
112 
113 #include <alma/ASDM/Representable.h>
114 
115 #include <pthread.h>
116 
117 namespace asdm {
118 
119 //class asdm::ASDM;
120 //class asdm::DelayModelFixedParametersRow;
121 
122 class ASDM;
123 class DelayModelFixedParametersRow;
295  friend class ASDM;
296 
297 public:
298 
299 
305  static const std::vector<std::string>& getKeyName();
306 
307 
309 
315  ASDM &getContainer() const;
316 
322  unsigned int size() const;
323 
331  std::string getName() const;
332 
340  static std::string name() ;
341 
346  std::string getVersion() const ;
347 
353  static const std::vector<std::string>& getAttributesNames();
354 
360  static const std::vector<std::string>& defaultAttributesNamesInBin();
361 
365  Entity getEntity() const;
366 
371  void setEntity(Entity e);
372 
380  std::string toXML() ;
381 
382 #ifndef WITHOUT_ACS
383  // Conversion Methods
389  asdmIDL::DelayModelFixedParametersTableIDL *toIDL() ;
390 
398  void toIDL(asdmIDL::DelayModelFixedParametersTableIDL& x) const;
399 
400 #endif
401 
402 #ifndef WITHOUT_ACS
403 
409  void fromIDL(asdmIDL::DelayModelFixedParametersTableIDL x) ;
410 #endif
411 
412  //
413  // ====> Row creation.
414  //
415 
421 
422 
432  DelayModelFixedParametersRow *newRow(std::string delayModelVersion, Tag execBlockId);
433 
434 
435 
449 
450  //
451  // ====> Append a row to its table.
452  //
453 
454 
455 
456 
467 
468 
469 
470  //
471  // ====> Methods returning rows.
472  //
473 
479  std::vector<DelayModelFixedParametersRow *> get() ;
480 
487  const std::vector<DelayModelFixedParametersRow *>& get() const ;
488 
489 
490 
491 
492 
502  DelayModelFixedParametersRow* getRowByKey(Tag delayModelFixedParametersId);
503 
504 
505 
506 
507 
519  DelayModelFixedParametersRow* lookup(std::string delayModelVersion, Tag execBlockId);
520 
521 
522  void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
523  BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
524 
525 private:
526 
536 
538 
539  bool archiveAsBin; // If true archive binary else archive XML
540  bool fileAsBin ; // If true file binary else file XML
541 
542  std::string version ;
543 
545 
546 
547 
548 
549 
550  // A map for the autoincrementation algorithm
551  std::map<std::string,int> noAutoIncIds;
552  void autoIncrement(std::string key, DelayModelFixedParametersRow* x);
553 
554 
564  DelayModelFixedParametersRow* checkAndAdd(DelayModelFixedParametersRow* x, bool skipCheckUniqueness=false) ;
565 
572 
579 
580 
581 
582 
583 
584 // A data structure to store the pointers on the table's rows.
585 
586 // In all cases we maintain a private vector of DelayModelFixedParametersRow s.
587  std::vector<DelayModelFixedParametersRow * > privateRows;
588 
589 
590 
591  std::vector<DelayModelFixedParametersRow *> row;
592 
593 
594  void error() ; //throw(ConversionException);
595 
596 
603  void fromXML(std::string& xmlDoc) ;
604 
605  std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
606 
611  void setFromMIMEFile(const std::string& directory);
612  /*
613  void openMIMEFile(const std::string& directory);
614  */
615  void setFromXMLFile(const std::string& directory);
616 
624  std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
625 
626 
633  void setFromMIME(const std::string & mimeMsg);
634 
638  std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
639 
649  void toFile(std::string directory);
650 
656  if (!presentInMemory && !loadInProgress) {
657  loadInProgress = true;
658  setFromFile(getContainer().getDirectory());
659  presentInMemory = true;
660  loadInProgress = false;
661  }
662  }
671  void setFromFile(const std::string& directory);
672 
673 };
674 
675 } // End namespace asdm
676 
677 #endif /* DelayModelFixedParametersTable_CLASS */
static const ByteOrder * Machine_Endianity
Definition: Misc.h:119
static std::string name()
Return the name of this table.
Entity getEntity() const
Return this table&#39;s Entity.
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 getVersion() const
Return the version information about this table.
void setEntity(Entity e)
Set this table&#39;s Entity.
struct _xmlDoc xmlDoc
Definition: Misc.h:59
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.
std::string MIMEXMLPart(const asdm::ByteOrder *byteOrder=asdm::ByteOrder::Machine_Endianity)
Private methods involved during the export of this table into disk file(s).
A class to represent byte order information.
Definition: Misc.h:115
DelayModelFixedParametersRow * add(DelayModelFixedParametersRow *x)
====&gt; Append a row to its table.
The ASDM class is the container for all tables.
Definition: ASDM.h:273
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes of this table.
void fromIDL(asdmIDL::DelayModelFixedParametersTableIDL x)
Populate this table from the content of a DelayModelFixedParametersTableIDL Corba structure...
void autoIncrement(std::string key, DelayModelFixedParametersRow *x)
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
void setFromFile(const std::string &directory)
Reads and parses a file containing a representation of a DelayModelFixedParametersTable as those prod...
void setFromXMLFile(const std::string &directory)
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
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...
asdmIDL::DelayModelFixedParametersTableIDL * toIDL()
Conversion Methods.
unsigned int size() const
Return the number of rows in the table.
DelayModelFixedParametersRow * checkAndAdd(DelayModelFixedParametersRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
std::map< std::string, int > noAutoIncIds
A map for the autoincrementation algorithm.
DelayModelFixedParametersRow * newRow()
====&gt; Row creation.
static const std::vector< std::string > & getKeyName()
Return the list of field names that make up key key as an array of strings.
std::vector< DelayModelFixedParametersRow * > row
The DelayModelFixedParametersRow class is a row of a DelayModelFixedParametersTable.
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
std::vector< DelayModelFixedParametersRow * > privateRows
A data structure to store the pointers on the table&#39;s rows.
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:
bool loadInProgress
Load the table in memory if necessary.
DelayModelFixedParametersRow * getRowByKey(Tag delayModelFixedParametersId)
Returns a DelayModelFixedParametersRow* given a key.
DelayModelFixedParametersTable(ASDM &container)
Create a DelayModelFixedParametersTable.
void addWithoutCheckingUnique(DelayModelFixedParametersRow *x)
Brutally append an DelayModelFixedParametersRow x to the collection of rows already stored in this ta...
DelayModelFixedParametersRow * lookup(std::string delayModelVersion, Tag execBlockId)
Look up the table for a row whose all attributes except the autoincrementable one are equal to the co...
ASDM & getContainer() const
Return the container to which this table belongs.
void toFile(std::string directory)
Stores a representation (binary or XML) of this table into a file.
void append(DelayModelFixedParametersRow *x)
Brutally append an DelayModelFixedParametersRow x to the collection of rows already stored in this ta...
std::string toXML()
Produces an XML representation conform to the schema defined for DelayModelFixedParameters (DelayMode...
std::string getName() const
Return the name of this table.
The Entity class is an identification of a persistant entity in the ALMA archive. ...
Definition: Entity.h:59
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 std::vector< std::string > & defaultAttributesNamesInBin()
Return the default sorted list of attributes names in the binary representation of the table...
The DelayModelFixedParametersTable class is an Alma table.