LCOV - code coverage report
Current view: top level - alma/ASDM - ExecBlockTable.h (source / functions) Hit Total Coverage
Test: casa_coverage.info Lines: 7 7 100.0 %
Date: 2023-10-25 08:47:59 Functions: 1 1 100.0 %

          Line data    Source code
       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 ExecBlockTable.h
      32             :  */
      33             :  
      34             : #ifndef ExecBlockTable_CLASS
      35             : #define ExecBlockTable_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/Length.h>
      53             :         
      54             : 
      55             :         
      56             : #include <alma/ASDM/Tag.h>
      57             :         
      58             : 
      59             :         
      60             : #include <alma/ASDM/EntityRef.h>
      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             : 
     110             :         
     111             : 
     112             :         
     113             : 
     114             :         
     115             : 
     116             :         
     117             : 
     118             : 
     119             : 
     120             : #include <alma/ASDM/ConversionException.h>
     121             : #include <alma/ASDM/DuplicateKey.h>
     122             : #include <alma/ASDM/UniquenessViolationException.h>
     123             : #include <alma/ASDM/NoSuchRow.h>
     124             : #include <alma/ASDM/DuplicateKey.h>
     125             : 
     126             : 
     127             : #ifndef WITHOUT_ACS
     128             : #include <asdmIDLC.h>
     129             : #endif
     130             : 
     131             : #include <alma/ASDM/Representable.h>
     132             : 
     133             : #include <pthread.h>
     134             : 
     135             : namespace asdm {
     136             : 
     137             : //class asdm::ASDM;
     138             : //class asdm::ExecBlockRow;
     139             : 
     140             : class ASDM;
     141             : class ExecBlockRow;
     142             : /**
     143             :  * The ExecBlockTable class is an Alma table.
     144             :  * <BR>
     145             :  * 
     146             :  * \par Role
     147             :  * Characteristics of the Execution block.
     148             :  * <BR>
     149             :  
     150             :  * Generated from model's revision "-1", branch ""
     151             :  *
     152             :  * <TABLE BORDER="1">
     153             :  * <CAPTION> Attributes of ExecBlock </CAPTION>
     154             :  * <TR BGCOLOR="#AAAAAA"> <TH> Name </TH> <TH> Type </TH> <TH> Expected shape  </TH> <TH> Comment </TH></TR>
     155             :  
     156             :  * <TR> <TH BGCOLOR="#CCCCCC" colspan="4" align="center"> Key </TD></TR>
     157             :         
     158             :  * <TR>
     159             :                 
     160             :  * <TD><I> execBlockId </I></TD>
     161             :                  
     162             :  * <TD> Tag</TD>
     163             :  * <TD> &nbsp; </TD>
     164             :  * <TD> &nbsp;identifies a unique row in ExecBlock Table. </TD>
     165             :  * </TR>
     166             :         
     167             : 
     168             : 
     169             :  * <TR> <TH BGCOLOR="#CCCCCC"  colspan="4" valign="center"> Value <br> (Mandatory) </TH></TR>
     170             :         
     171             :  * <TR>
     172             :  * <TD> startTime </TD> 
     173             :  * <TD> ArrayTime </TD>
     174             :  * <TD>  &nbsp;  </TD> 
     175             :  * <TD> &nbsp;the start time of the execution block. </TD>
     176             :  * </TR>
     177             :         
     178             :  * <TR>
     179             :  * <TD> endTime </TD> 
     180             :  * <TD> ArrayTime </TD>
     181             :  * <TD>  &nbsp;  </TD> 
     182             :  * <TD> &nbsp;the end time of the execution block. </TD>
     183             :  * </TR>
     184             :         
     185             :  * <TR>
     186             :  * <TD> execBlockNum </TD> 
     187             :  * <TD> int </TD>
     188             :  * <TD>  &nbsp;  </TD> 
     189             :  * <TD> &nbsp;indicates the position of the execution block in the project (sequential numbering starting at 1). </TD>
     190             :  * </TR>
     191             :         
     192             :  * <TR>
     193             :  * <TD> execBlockUID </TD> 
     194             :  * <TD> EntityRef </TD>
     195             :  * <TD>  &nbsp;  </TD> 
     196             :  * <TD> &nbsp;the archive's UID of the execution block. </TD>
     197             :  * </TR>
     198             :         
     199             :  * <TR>
     200             :  * <TD> projectUID </TD> 
     201             :  * <TD> EntityRef </TD>
     202             :  * <TD>  &nbsp;  </TD> 
     203             :  * <TD> &nbsp;the archive's UID of the project. </TD>
     204             :  * </TR>
     205             :         
     206             :  * <TR>
     207             :  * <TD> configName </TD> 
     208             :  * <TD> std::string </TD>
     209             :  * <TD>  &nbsp;  </TD> 
     210             :  * <TD> &nbsp;the name of the array's configuration. </TD>
     211             :  * </TR>
     212             :         
     213             :  * <TR>
     214             :  * <TD> telescopeName </TD> 
     215             :  * <TD> std::string </TD>
     216             :  * <TD>  &nbsp;  </TD> 
     217             :  * <TD> &nbsp;the name of the telescope. </TD>
     218             :  * </TR>
     219             :         
     220             :  * <TR>
     221             :  * <TD> observerName </TD> 
     222             :  * <TD> std::string </TD>
     223             :  * <TD>  &nbsp;  </TD> 
     224             :  * <TD> &nbsp;the name of the observer. </TD>
     225             :  * </TR>
     226             :         
     227             :  * <TR>
     228             :  * <TD> numObservingLog (numObservingLog)</TD> 
     229             :  * <TD> int </TD>
     230             :  * <TD>  &nbsp;  </TD> 
     231             :  * <TD> &nbsp;the number of elements in the (array) attribute observingLog. </TD>
     232             :  * </TR>
     233             :         
     234             :  * <TR>
     235             :  * <TD> observingLog </TD> 
     236             :  * <TD> std::vector<std::string > </TD>
     237             :  * <TD>  numObservingLog </TD> 
     238             :  * <TD> &nbsp; logs of the observation during this execution block. </TD>
     239             :  * </TR>
     240             :         
     241             :  * <TR>
     242             :  * <TD> sessionReference </TD> 
     243             :  * <TD> EntityRef </TD>
     244             :  * <TD>  &nbsp;  </TD> 
     245             :  * <TD> &nbsp;the observing session reference. </TD>
     246             :  * </TR>
     247             :         
     248             :  * <TR>
     249             :  * <TD> baseRangeMin </TD> 
     250             :  * <TD> Length </TD>
     251             :  * <TD>  &nbsp;  </TD> 
     252             :  * <TD> &nbsp;the length of the shortest baseline. </TD>
     253             :  * </TR>
     254             :         
     255             :  * <TR>
     256             :  * <TD> baseRangeMax </TD> 
     257             :  * <TD> Length </TD>
     258             :  * <TD>  &nbsp;  </TD> 
     259             :  * <TD> &nbsp;the length of the longest baseline. </TD>
     260             :  * </TR>
     261             :         
     262             :  * <TR>
     263             :  * <TD> baseRmsMinor </TD> 
     264             :  * <TD> Length </TD>
     265             :  * <TD>  &nbsp;  </TD> 
     266             :  * <TD> &nbsp;the minor axis of the representative ellipse of baseline lengths. </TD>
     267             :  * </TR>
     268             :         
     269             :  * <TR>
     270             :  * <TD> baseRmsMajor </TD> 
     271             :  * <TD> Length </TD>
     272             :  * <TD>  &nbsp;  </TD> 
     273             :  * <TD> &nbsp;the major axis of the representative ellipse of baseline lengths. </TD>
     274             :  * </TR>
     275             :         
     276             :  * <TR>
     277             :  * <TD> basePa </TD> 
     278             :  * <TD> Angle </TD>
     279             :  * <TD>  &nbsp;  </TD> 
     280             :  * <TD> &nbsp;the baselines position angle. </TD>
     281             :  * </TR>
     282             :         
     283             :  * <TR>
     284             :  * <TD> aborted </TD> 
     285             :  * <TD> bool </TD>
     286             :  * <TD>  &nbsp;  </TD> 
     287             :  * <TD> &nbsp;the execution block has been aborted (true) or has completed (false). </TD>
     288             :  * </TR>
     289             :         
     290             :  * <TR>
     291             :  * <TD> numAntenna (numAntenna)</TD> 
     292             :  * <TD> int </TD>
     293             :  * <TD>  &nbsp;  </TD> 
     294             :  * <TD> &nbsp;the number of antennas. </TD>
     295             :  * </TR>
     296             :         
     297             :  * <TR>
     298             :  * <TD> antennaId </TD> 
     299             :  * <TD> std::vector<Tag>  </TD>
     300             :  * <TD>  numAntenna </TD> 
     301             :  * <TD> &nbsp;refers to the relevant rows in AntennaTable. </TD>
     302             :  * </TR>
     303             :         
     304             :  * <TR>
     305             :  * <TD> sBSummaryId </TD> 
     306             :  * <TD> Tag </TD>
     307             :  * <TD>  &nbsp;  </TD> 
     308             :  * <TD> &nbsp;refers to a unique row  in SBSummaryTable. </TD>
     309             :  * </TR>
     310             :         
     311             : 
     312             : 
     313             :  * <TR> <TH BGCOLOR="#CCCCCC"  colspan="4" valign="center"> Value <br> (Optional) </TH></TR>
     314             :         
     315             :  * <TR>
     316             :  * <TD> releaseDate</TD> 
     317             :  * <TD> ArrayTime </TD>
     318             :  * <TD>  &nbsp; </TD>
     319             :  * <TD>&nbsp; the date when the data go to the public domain. </TD>
     320             :  * </TR>
     321             :         
     322             :  * <TR>
     323             :  * <TD> schedulerMode</TD> 
     324             :  * <TD> std::string </TD>
     325             :  * <TD>  &nbsp; </TD>
     326             :  * <TD>&nbsp; the mode of scheduling. </TD>
     327             :  * </TR>
     328             :         
     329             :  * <TR>
     330             :  * <TD> siteAltitude</TD> 
     331             :  * <TD> Length </TD>
     332             :  * <TD>  &nbsp; </TD>
     333             :  * <TD>&nbsp; the altitude of the site. </TD>
     334             :  * </TR>
     335             :         
     336             :  * <TR>
     337             :  * <TD> siteLongitude</TD> 
     338             :  * <TD> Angle </TD>
     339             :  * <TD>  &nbsp; </TD>
     340             :  * <TD>&nbsp; the longitude of the site. </TD>
     341             :  * </TR>
     342             :         
     343             :  * <TR>
     344             :  * <TD> siteLatitude</TD> 
     345             :  * <TD> Angle </TD>
     346             :  * <TD>  &nbsp; </TD>
     347             :  * <TD>&nbsp; the latitude of the site. </TD>
     348             :  * </TR>
     349             :         
     350             :  * <TR>
     351             :  * <TD> observingScript</TD> 
     352             :  * <TD> std::string </TD>
     353             :  * <TD>  &nbsp; </TD>
     354             :  * <TD>&nbsp; The text of the observation script. </TD>
     355             :  * </TR>
     356             :         
     357             :  * <TR>
     358             :  * <TD> observingScriptUID</TD> 
     359             :  * <TD> EntityRef </TD>
     360             :  * <TD>  &nbsp; </TD>
     361             :  * <TD>&nbsp; A reference to the Entity which contains the observing script. </TD>
     362             :  * </TR>
     363             :         
     364             :  * <TR>
     365             :  * <TD> scaleId</TD> 
     366             :  * <TD> Tag </TD>
     367             :  * <TD>  &nbsp; </TD>
     368             :  * <TD>&nbsp; refers to a unique row in the table Scale. </TD>
     369             :  * </TR>
     370             :         
     371             : 
     372             :  * </TABLE>
     373             :  */
     374             : class ExecBlockTable : public Representable {
     375             :         friend class ASDM;
     376             : 
     377             : public:
     378             : 
     379             : 
     380             :         /**
     381             :          * Return the list of field names that make up key key
     382             :          * as an array of strings.
     383             :          * @return a vector of string.
     384             :          */     
     385             :         static const std::vector<std::string>& getKeyName();
     386             : 
     387             : 
     388             :         virtual ~ExecBlockTable();
     389             :         
     390             :         /**
     391             :          * Return the container to which this table belongs.
     392             :          *
     393             :          * @return the ASDM containing this table.
     394             :          */
     395             :         ASDM &getContainer() const;
     396             :         
     397             :         /**
     398             :          * Return the number of rows in the table.
     399             :          *
     400             :          * @return the number of rows in an unsigned int.
     401             :          */
     402             :         unsigned int size() const;
     403             :         
     404             :         /**
     405             :          * Return the name of this table.
     406             :          *
     407             :          * This is a instance method of the class.
     408             :          *
     409             :          * @return the name of this table in a string.
     410             :          */
     411             :         std::string getName() const;
     412             :         
     413             :         /**
     414             :          * Return the name of this table.
     415             :          *
     416             :          * This is a static method of the class.
     417             :          *
     418             :          * @return the name of this table in a string.
     419             :          */
     420             :         static std::string name() ;     
     421             :         
     422             :         /**
     423             :          * Return the version information about this table.
     424             :          *
     425             :          */
     426             :          std::string getVersion() const ;
     427             :         
     428             :         /**
     429             :          * Return the names of the attributes of this table.
     430             :          *
     431             :          * @return a vector of string
     432             :          */
     433             :          static const std::vector<std::string>& getAttributesNames();
     434             : 
     435             :         /**
     436             :          * Return the default sorted list of attributes names in the binary representation of the table.
     437             :          *
     438             :          * @return a const reference to a vector of string
     439             :          */
     440             :          static const std::vector<std::string>& defaultAttributesNamesInBin();
     441             :          
     442             :         /**
     443             :          * Return this table's Entity.
     444             :          */
     445             :         Entity getEntity() const;
     446             : 
     447             :         /**
     448             :          * Set this table's Entity.
     449             :          * @param e An entity. 
     450             :          */
     451             :         void setEntity(Entity e);
     452             :                 
     453             :         /**
     454             :          * Produces an XML representation conform
     455             :          * to the schema defined for ExecBlock (ExecBlockTable.xsd).
     456             :          *
     457             :          * @returns a string containing the XML representation.
     458             :          * @throws ConversionException
     459             :          */
     460             :         std::string toXML()  ;
     461             : 
     462             : #ifndef WITHOUT_ACS
     463             :         // Conversion Methods
     464             :         /**
     465             :          * Convert this table into a ExecBlockTableIDL CORBA structure.
     466             :          *
     467             :          * @return a pointer to a ExecBlockTableIDL
     468             :          */
     469             :         asdmIDL::ExecBlockTableIDL *toIDL() ;
     470             :         
     471             :         /**
     472             :          * Fills the CORBA data structure passed in parameter
     473             :          * with the content of this table.
     474             :          *
     475             :          * @param x a reference to the asdmIDL::ExecBlockTableIDL to be populated
     476             :          * with the content of this.
     477             :          */
     478             :          void toIDL(asdmIDL::ExecBlockTableIDL& x) const;
     479             :          
     480             : #endif
     481             : 
     482             : #ifndef WITHOUT_ACS
     483             :         /**
     484             :          * Populate this table from the content of a ExecBlockTableIDL Corba structure.
     485             :          *
     486             :          * @throws DuplicateKey Thrown if the method tries to add a row having a key that is already in the table.
     487             :          * @throws ConversionException
     488             :          */     
     489             :         void fromIDL(asdmIDL::ExecBlockTableIDL x) ;
     490             : #endif
     491             :         
     492             :         //
     493             :         // ====> Row creation.
     494             :         //
     495             :         
     496             :         /**
     497             :          * Create a new row with default values.
     498             :          * @return a pointer on a ExecBlockRow
     499             :          */
     500             :         ExecBlockRow *newRow();
     501             :         
     502             :         
     503             :         /**
     504             :          * Create a new row initialized to the specified values.
     505             :          * @return a pointer on the created and initialized row.
     506             :         
     507             :          * @param startTime
     508             :         
     509             :          * @param endTime
     510             :         
     511             :          * @param execBlockNum
     512             :         
     513             :          * @param execBlockUID
     514             :         
     515             :          * @param projectUID
     516             :         
     517             :          * @param configName
     518             :         
     519             :          * @param telescopeName
     520             :         
     521             :          * @param observerName
     522             :         
     523             :          * @param numObservingLog
     524             :         
     525             :          * @param observingLog
     526             :         
     527             :          * @param sessionReference
     528             :         
     529             :          * @param baseRangeMin
     530             :         
     531             :          * @param baseRangeMax
     532             :         
     533             :          * @param baseRmsMinor
     534             :         
     535             :          * @param baseRmsMajor
     536             :         
     537             :          * @param basePa
     538             :         
     539             :          * @param aborted
     540             :         
     541             :          * @param numAntenna
     542             :         
     543             :          * @param antennaId
     544             :         
     545             :          * @param sBSummaryId
     546             :         
     547             :      */
     548             :         ExecBlockRow *newRow(ArrayTime startTime, ArrayTime endTime, int execBlockNum, EntityRef execBlockUID, EntityRef projectUID, std::string configName, std::string telescopeName, std::string observerName, int numObservingLog, std::vector<std::string > observingLog, EntityRef sessionReference, Length baseRangeMin, Length baseRangeMax, Length baseRmsMinor, Length baseRmsMajor, Angle basePa, bool aborted, int numAntenna, std::vector<Tag>  antennaId, Tag sBSummaryId);
     549             :         
     550             : 
     551             : 
     552             :         /**
     553             :          * Create a new row using a copy constructor mechanism.
     554             :          * 
     555             :          * The method creates a new ExecBlockRow owned by this. Each attribute of the created row 
     556             :          * is a (deep) copy of the corresponding attribute of row. The method does not add 
     557             :          * the created row to this, its simply parents it to this, a call to the add method
     558             :          * has to be done in order to get the row added (very likely after having modified
     559             :          * some of its attributes).
     560             :          * If row is null then the method returns a new ExecBlockRow with default values for its attributes. 
     561             :          *
     562             :          * @param row the row which is to be copied.
     563             :          */
     564             :          ExecBlockRow *newRow(ExecBlockRow *row); 
     565             : 
     566             :         //
     567             :         // ====> Append a row to its table.
     568             :         //
     569             : 
     570             :         
     571             :         
     572             :         
     573             :         /** 
     574             :          * Add a row.
     575             :          * If there table contains a row whose key's fields are equal
     576             :          * to x's ones then return a pointer on this row (i.e. no actual insertion is performed) 
     577             :          * otherwise add x to the table and return x.
     578             :          * @param x . A pointer on the row to be added.
     579             :          * @returns a pointer to a ExecBlockRow.         
     580             :          */      
     581             :          
     582             :          ExecBlockRow* add(ExecBlockRow* x) ;
     583             : 
     584             : 
     585             : 
     586             :         //
     587             :         // ====> Methods returning rows.
     588             :         //
     589             :                 
     590             :         /**
     591             :          * Get a collection of pointers on the rows of the table.
     592             :          * @return Alls rows in a vector of pointers of ExecBlockRow. The elements of this vector are stored in the order 
     593             :          * in which they have been added to the ExecBlockTable.
     594             :          */
     595             :         std::vector<ExecBlockRow *> get() ;
     596             :         
     597             :         /**
     598             :          * Get a const reference on the collection of rows pointers internally hold by the table.
     599             :          * @return A const reference of a vector of pointers of ExecBlockRow. The elements of this vector are stored in the order 
     600             :          * in which they have been added to the ExecBlockTable.
     601             :          *
     602             :          */
     603             :          const std::vector<ExecBlockRow *>& get() const ;
     604             :         
     605             : 
     606             : 
     607             :  
     608             :         
     609             :         /**
     610             :          * Returns a ExecBlockRow* given a key.
     611             :          * @return a pointer to the row having the key whose values are passed as parameters, or 0 if
     612             :          * no row exists for that key.
     613             :         
     614             :          * @param execBlockId
     615             :         
     616             :          *
     617             :          */
     618             :         ExecBlockRow* getRowByKey(Tag execBlockId);
     619             : 
     620             :                 
     621             : 
     622             : 
     623             : 
     624             :         /**
     625             :          * Look up the table for a row whose all attributes  except the autoincrementable one 
     626             :          * are equal to the corresponding parameters of the method.
     627             :          * @return a pointer on this row if any, null otherwise.
     628             :          *
     629             :                         
     630             :          * @param startTime
     631             :                         
     632             :          * @param endTime
     633             :                         
     634             :          * @param execBlockNum
     635             :                         
     636             :          * @param execBlockUID
     637             :                         
     638             :          * @param projectUID
     639             :                         
     640             :          * @param configName
     641             :                         
     642             :          * @param telescopeName
     643             :                         
     644             :          * @param observerName
     645             :                         
     646             :          * @param numObservingLog
     647             :                         
     648             :          * @param observingLog
     649             :                         
     650             :          * @param sessionReference
     651             :                         
     652             :          * @param baseRangeMin
     653             :                         
     654             :          * @param baseRangeMax
     655             :                         
     656             :          * @param baseRmsMinor
     657             :                         
     658             :          * @param baseRmsMajor
     659             :                         
     660             :          * @param basePa
     661             :                         
     662             :          * @param aborted
     663             :                         
     664             :          * @param numAntenna
     665             :                         
     666             :          * @param antennaId
     667             :                         
     668             :          * @param sBSummaryId
     669             :                          
     670             :          */
     671             :         ExecBlockRow* lookup(ArrayTime startTime, ArrayTime endTime, int execBlockNum, EntityRef execBlockUID, EntityRef projectUID, std::string configName, std::string telescopeName, std::string observerName, int numObservingLog, std::vector<std::string > observingLog, EntityRef sessionReference, Length baseRangeMin, Length baseRangeMax, Length baseRmsMinor, Length baseRmsMajor, Angle basePa, bool aborted, int numAntenna, std::vector<Tag>  antennaId, Tag sBSummaryId); 
     672             : 
     673             : 
     674             :         void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr);
     675             :         BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const;
     676             : 
     677             : private:
     678             : 
     679             :         /**
     680             :          * Create a ExecBlockTable.
     681             :          * <p>
     682             :          * This constructor is private because only the
     683             :          * container can create tables.  All tables must know the container
     684             :          * to which they belong.
     685             :          * @param container The container to which this table belongs.
     686             :          */ 
     687             :         ExecBlockTable (ASDM & container);
     688             : 
     689             :         ASDM & container;
     690             :         
     691             :         bool archiveAsBin; // If true archive binary else archive XML
     692             :         bool fileAsBin ; // If true file binary else file XML   
     693             :         
     694             :         std::string version ; 
     695             :         
     696             :         Entity entity;
     697             :         
     698             : 
     699             :         
     700             :         
     701             : 
     702             :         // A map for the autoincrementation algorithm
     703             :         std::map<std::string,int>  noAutoIncIds;
     704             :         void autoIncrement(std::string key, ExecBlockRow* x);
     705             : 
     706             : 
     707             :         /**
     708             :          * If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and throw exception if not.
     709             :          * Check if *x verifies the key uniqueness rule and throw an exception if not.
     710             :          * Append x to its table.
     711             :          * @throws DuplicateKey
     712             :          
     713             :          * @throws UniquenessViolationException
     714             :          
     715             :          */
     716             :         ExecBlockRow* checkAndAdd(ExecBlockRow* x, bool skipCheckUniqueness=false) ;
     717             :         
     718             :         /**
     719             :          * Brutally append an ExecBlockRow x to the collection of rows already stored in this table. No uniqueness check is done !
     720             :          *
     721             :          * @param ExecBlockRow* x a pointer onto the ExecBlockRow to be appended.
     722             :          */
     723             :          void append(ExecBlockRow* x) ;
     724             :          
     725             :         /**
     726             :          * Brutally append an ExecBlockRow x to the collection of rows already stored in this table. No uniqueness check is done !
     727             :          *
     728             :          * @param ExecBlockRow* x a pointer onto the ExecBlockRow to be appended.
     729             :          */
     730             :          void addWithoutCheckingUnique(ExecBlockRow* x) ;
     731             :          
     732             :          
     733             : 
     734             : 
     735             : 
     736             : // A data structure to store the pointers on the table's rows.
     737             : 
     738             : // In all cases we maintain a private vector of ExecBlockRow s.
     739             :    std::vector<ExecBlockRow * > privateRows;
     740             :    
     741             : 
     742             :                         
     743             :         std::vector<ExecBlockRow *> row;
     744             : 
     745             :         
     746             :         void error() ; //throw(ConversionException);
     747             : 
     748             :         
     749             :         /**
     750             :          * Populate this table from the content of a XML document that is required to
     751             :          * be conform to the XML schema defined for a ExecBlock (ExecBlockTable.xsd).
     752             :          * @throws ConversionException
     753             :          * 
     754             :          */
     755             :         void fromXML(std::string& xmlDoc) ;
     756             :                 
     757             :         std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors;
     758             : 
     759             :         /**
     760             :           * Private methods involved during the build of this table out of the content
     761             :           * of file(s) containing an external representation of a ExecBlock table.
     762             :           */
     763             :         void setFromMIMEFile(const std::string& directory);
     764             :         /*
     765             :         void openMIMEFile(const std::string& directory);
     766             :         */
     767             :         void setFromXMLFile(const std::string& directory);
     768             :         
     769             :                  /**
     770             :          * Serialize this into a stream of bytes and encapsulates that stream into a MIME message.
     771             :          * @returns a string containing the MIME message.
     772             :          *
     773             :          * @param byteOrder a const pointer to a static instance of the class ByteOrder.
     774             :          * 
     775             :          */
     776             :         std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
     777             :   
     778             :         
     779             :    /** 
     780             :      * Extracts the binary part of a MIME message and deserialize its content
     781             :          * to fill this with the result of the deserialization. 
     782             :          * @param mimeMsg the string containing the MIME message.
     783             :          * @throws ConversionException
     784             :          */
     785             :          void setFromMIME(const std::string & mimeMsg);
     786             :         
     787             :         /**
     788             :           * Private methods involved during the export of this table into disk file(s).
     789             :           */
     790             :         std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity);
     791             :         
     792             :         /**
     793             :           * Stores a representation (binary or XML) of this table into a file.
     794             :           *
     795             :           * Depending on the boolean value of its private field fileAsBin a binary serialization  of this (fileAsBin==true)  
     796             :           * will be saved in a file "ExecBlock.bin" or an XML representation (fileAsBin==false) will be saved in a file "ExecBlock.xml".
     797             :           * The file is always written in a directory whose name is passed as a parameter.
     798             :          * @param directory The name of directory  where the file containing the table's representation will be saved.
     799             :           * 
     800             :           */
     801             :           void toFile(std::string directory);
     802             :           
     803             :           /**
     804             :            * Load the table in memory if necessary.
     805             :            */
     806             :           bool loadInProgress;
     807        6270 :           void checkPresenceInMemory() {
     808        6270 :                 if (!presentInMemory && !loadInProgress) {
     809          83 :                         loadInProgress = true;
     810          83 :                         setFromFile(getContainer().getDirectory());
     811          83 :                         presentInMemory = true;
     812          83 :                         loadInProgress = false;
     813             :                 }
     814        6270 :           }
     815             :         /**
     816             :          * Reads and parses a file containing a representation of a ExecBlockTable as those produced  by the toFile method.
     817             :          * This table is populated with the result of the parsing.
     818             :          * @param directory The name of the directory containing the file te be read and parsed.
     819             :          * @throws ConversionException If any error occurs while reading the 
     820             :          * files in the directory or parsing them.
     821             :          *
     822             :          */
     823             :          void setFromFile(const std::string& directory);    
     824             :  
     825             : };
     826             : 
     827             : } // End namespace asdm
     828             : 
     829             : #endif /* ExecBlockTable_CLASS */

Generated by: LCOV version 1.16