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 SpectralWindowTable.h 32 : */ 33 : 34 : #ifndef SpectralWindowTable_CLASS 35 : #define SpectralWindowTable_CLASS 36 : 37 : #include <string> 38 : #include <vector> 39 : #include <map> 40 : 41 : 42 : 43 : 44 : #include <alma/ASDM/Frequency.h> 45 : 46 : 47 : 48 : #include <alma/ASDM/Tag.h> 49 : 50 : 51 : 52 : 53 : 54 : 55 : 56 : 57 : #include <alma/Enumerations/CBasebandName.h> 58 : 59 : 60 : 61 : #include <alma/Enumerations/CNetSideband.h> 62 : 63 : 64 : 65 : 66 : 67 : 68 : 69 : 70 : 71 : #include <alma/Enumerations/CSidebandProcessingMode.h> 72 : 73 : 74 : 75 : 76 : 77 : #include <alma/Enumerations/CWindowFunction.h> 78 : 79 : 80 : 81 : 82 : 83 : 84 : 85 : 86 : 87 : 88 : 89 : 90 : 91 : #include <alma/Enumerations/CCorrelationBit.h> 92 : 93 : 94 : 95 : 96 : 97 : 98 : 99 : 100 : 101 : 102 : 103 : 104 : 105 : #include <alma/Enumerations/CFrequencyReferenceCode.h> 106 : 107 : 108 : 109 : 110 : 111 : 112 : 113 : 114 : 115 : 116 : 117 : 118 : 119 : 120 : 121 : 122 : 123 : #include <alma/Enumerations/CSpectralResolutionType.h> 124 : 125 : 126 : 127 : 128 : #include <alma/ASDM/ConversionException.h> 129 : #include <alma/ASDM/DuplicateKey.h> 130 : #include <alma/ASDM/UniquenessViolationException.h> 131 : #include <alma/ASDM/NoSuchRow.h> 132 : #include <alma/ASDM/DuplicateKey.h> 133 : 134 : 135 : #ifndef WITHOUT_ACS 136 : #include <asdmIDLC.h> 137 : #endif 138 : 139 : #include <alma/ASDM/Representable.h> 140 : 141 : #include <pthread.h> 142 : 143 : namespace asdm { 144 : 145 : //class asdm::ASDM; 146 : //class asdm::SpectralWindowRow; 147 : 148 : class ASDM; 149 : class SpectralWindowRow; 150 : /** 151 : * The SpectralWindowTable class is an Alma table. 152 : * <BR> 153 : * 154 : * \par Role 155 : * Spectral window description. The convention in ALMA is to describe the frequency axis in the topocentric reference frame. If this is not the case (for instance if active Doppler tracking is implemented) then \texttt{measFreqRef} should be set accordingly. 156 : * <BR> 157 : 158 : * Generated from model's revision "-1", branch "" 159 : * 160 : * <TABLE BORDER="1"> 161 : * <CAPTION> Attributes of SpectralWindow </CAPTION> 162 : * <TR BGCOLOR="#AAAAAA"> <TH> Name </TH> <TH> Type </TH> <TH> Expected shape </TH> <TH> Comment </TH></TR> 163 : 164 : * <TR> <TH BGCOLOR="#CCCCCC" colspan="4" align="center"> Key </TD></TR> 165 : 166 : * <TR> 167 : 168 : * <TD><I> spectralWindowId </I></TD> 169 : 170 : * <TD> Tag</TD> 171 : * <TD> </TD> 172 : * <TD> identifies a unique row in the table. </TD> 173 : * </TR> 174 : 175 : 176 : 177 : * <TR> <TH BGCOLOR="#CCCCCC" colspan="4" valign="center"> Value <br> (Mandatory) </TH></TR> 178 : 179 : * <TR> 180 : * <TD> basebandName </TD> 181 : * <TD> BasebandNameMod::BasebandName </TD> 182 : * <TD> </TD> 183 : * <TD> identifies the baseband. </TD> 184 : * </TR> 185 : 186 : * <TR> 187 : * <TD> netSideband </TD> 188 : * <TD> NetSidebandMod::NetSideband </TD> 189 : * <TD> </TD> 190 : * <TD> identifies the net sideband. </TD> 191 : * </TR> 192 : 193 : * <TR> 194 : * <TD> numChan (numChan)</TD> 195 : * <TD> int </TD> 196 : * <TD> </TD> 197 : * <TD> the number of frequency channels. </TD> 198 : * </TR> 199 : 200 : * <TR> 201 : * <TD> refFreq </TD> 202 : * <TD> Frequency </TD> 203 : * <TD> </TD> 204 : * <TD> the reference frequency. </TD> 205 : * </TR> 206 : 207 : * <TR> 208 : * <TD> sidebandProcessingMode </TD> 209 : * <TD> SidebandProcessingModeMod::SidebandProcessingMode </TD> 210 : * <TD> </TD> 211 : * <TD> identifies the sideband processing mode. </TD> 212 : * </TR> 213 : 214 : * <TR> 215 : * <TD> totBandwidth </TD> 216 : * <TD> Frequency </TD> 217 : * <TD> </TD> 218 : * <TD> the total bandwidth. </TD> 219 : * </TR> 220 : 221 : * <TR> 222 : * <TD> windowFunction </TD> 223 : * <TD> WindowFunctionMod::WindowFunction </TD> 224 : * <TD> </TD> 225 : * <TD> identifies the window function. </TD> 226 : * </TR> 227 : 228 : 229 : 230 : * <TR> <TH BGCOLOR="#CCCCCC" colspan="4" valign="center"> Value <br> (Optional) </TH></TR> 231 : 232 : * <TR> 233 : * <TD> numBin(numBin)</TD> 234 : * <TD> int </TD> 235 : * <TD> </TD> 236 : * <TD> the number of channels used in any post-FFT averaging. </TD> 237 : * </TR> 238 : 239 : * <TR> 240 : * <TD> chanFreqStart</TD> 241 : * <TD> Frequency </TD> 242 : * <TD> </TD> 243 : * <TD> the frequency of the first channel. </TD> 244 : * </TR> 245 : 246 : * <TR> 247 : * <TD> chanFreqStep</TD> 248 : * <TD> Frequency </TD> 249 : * <TD> </TD> 250 : * <TD> the increment between two successive frequencies. </TD> 251 : * </TR> 252 : 253 : * <TR> 254 : * <TD> chanFreqArray</TD> 255 : * <TD> std::vector<Frequency > </TD> 256 : * <TD> numChan </TD> 257 : * <TD> the frequencies defined as an array (\texttt{numChan} values). </TD> 258 : * </TR> 259 : 260 : * <TR> 261 : * <TD> chanWidth</TD> 262 : * <TD> Frequency </TD> 263 : * <TD> </TD> 264 : * <TD> the nominal channel width. </TD> 265 : * </TR> 266 : 267 : * <TR> 268 : * <TD> chanWidthArray</TD> 269 : * <TD> std::vector<Frequency > </TD> 270 : * <TD> numChan </TD> 271 : * <TD> Array of channel widths. </TD> 272 : * </TR> 273 : 274 : * <TR> 275 : * <TD> correlationBit</TD> 276 : * <TD> CorrelationBitMod::CorrelationBit </TD> 277 : * <TD> </TD> 278 : * <TD> identifies the number of bits used in the signal representation. </TD> 279 : * </TR> 280 : 281 : * <TR> 282 : * <TD> effectiveBw</TD> 283 : * <TD> Frequency </TD> 284 : * <TD> </TD> 285 : * <TD> the effective noise bandwidth. </TD> 286 : * </TR> 287 : 288 : * <TR> 289 : * <TD> effectiveBwArray</TD> 290 : * <TD> std::vector<Frequency > </TD> 291 : * <TD> numChan </TD> 292 : * <TD> array of effective bandwidths. </TD> 293 : * </TR> 294 : 295 : * <TR> 296 : * <TD> freqGroup</TD> 297 : * <TD> int </TD> 298 : * <TD> </TD> 299 : * <TD> the frequency group number. </TD> 300 : * </TR> 301 : 302 : * <TR> 303 : * <TD> freqGroupName</TD> 304 : * <TD> std::string </TD> 305 : * <TD> </TD> 306 : * <TD> the frequency group name. </TD> 307 : * </TR> 308 : 309 : * <TR> 310 : * <TD> lineArray</TD> 311 : * <TD> std::vector<bool > </TD> 312 : * <TD> numChan </TD> 313 : * <TD> indicates lines (true) versus baselines (false). </TD> 314 : * </TR> 315 : 316 : * <TR> 317 : * <TD> measFreqRef</TD> 318 : * <TD> FrequencyReferenceCodeMod::FrequencyReferenceCode </TD> 319 : * <TD> </TD> 320 : * <TD> the reference frame of the frequencies. </TD> 321 : * </TR> 322 : 323 : * <TR> 324 : * <TD> name</TD> 325 : * <TD> std::string </TD> 326 : * <TD> </TD> 327 : * <TD> a name for this spectral window. </TD> 328 : * </TR> 329 : 330 : * <TR> 331 : * <TD> oversampling</TD> 332 : * <TD> bool </TD> 333 : * <TD> </TD> 334 : * <TD> data are "oversampled" (true) or not (false). </TD> 335 : * </TR> 336 : 337 : * <TR> 338 : * <TD> quantization</TD> 339 : * <TD> bool </TD> 340 : * <TD> </TD> 341 : * <TD> a quantization correction has been applied (true) or not applied (false). </TD> 342 : * </TR> 343 : 344 : * <TR> 345 : * <TD> refChan</TD> 346 : * <TD> double </TD> 347 : * <TD> </TD> 348 : * <TD> the reference channel "number". </TD> 349 : * </TR> 350 : 351 : * <TR> 352 : * <TD> resolution</TD> 353 : * <TD> Frequency </TD> 354 : * <TD> </TD> 355 : * <TD> the effective spectral resolution of one channel (see note). </TD> 356 : * </TR> 357 : 358 : * <TR> 359 : * <TD> resolutionArray</TD> 360 : * <TD> std::vector<Frequency > </TD> 361 : * <TD> numChan </TD> 362 : * <TD> the array of frequency resolution. </TD> 363 : * </TR> 364 : 365 : * <TR> 366 : * <TD> numAssocValues(numAssocValues)</TD> 367 : * <TD> int </TD> 368 : * <TD> </TD> 369 : * <TD> the number of associated values. </TD> 370 : * </TR> 371 : 372 : * <TR> 373 : * <TD> assocNature</TD> 374 : * <TD> std::vector<SpectralResolutionTypeMod::SpectralResolutionType > </TD> 375 : * <TD> numAssocValues </TD> 376 : * <TD> the natures of the associations with the rows refered to by assocSpectralWindowId. </TD> 377 : * </TR> 378 : 379 : * <TR> 380 : * <TD> assocSpectralWindowId</TD> 381 : * <TD> std::vector<Tag> </TD> 382 : * <TD> numAssocValues </TD> 383 : * <TD> refers to a collection of associated rows in the table. </TD> 384 : * </TR> 385 : 386 : * <TR> 387 : * <TD> imageSpectralWindowId</TD> 388 : * <TD> Tag </TD> 389 : * <TD> </TD> 390 : * <TD> refers to a unique row in the table (image sideband description). </TD> 391 : * </TR> 392 : 393 : * <TR> 394 : * <TD> dopplerId</TD> 395 : * <TD> int </TD> 396 : * <TD> </TD> 397 : * <TD> refers to a collection of rows in DopplerTable. </TD> 398 : * </TR> 399 : 400 : 401 : * </TABLE> 402 : */ 403 : class SpectralWindowTable : public Representable { 404 : friend class ASDM; 405 : 406 : public: 407 : 408 : 409 : /** 410 : * Return the list of field names that make up key key 411 : * as an array of strings. 412 : * @return a vector of string. 413 : */ 414 : static const std::vector<std::string>& getKeyName(); 415 : 416 : 417 : virtual ~SpectralWindowTable(); 418 : 419 : /** 420 : * Return the container to which this table belongs. 421 : * 422 : * @return the ASDM containing this table. 423 : */ 424 : ASDM &getContainer() const; 425 : 426 : /** 427 : * Return the number of rows in the table. 428 : * 429 : * @return the number of rows in an unsigned int. 430 : */ 431 : unsigned int size() const; 432 : 433 : /** 434 : * Return the name of this table. 435 : * 436 : * This is a instance method of the class. 437 : * 438 : * @return the name of this table in a string. 439 : */ 440 : std::string getName() const; 441 : 442 : /** 443 : * Return the name of this table. 444 : * 445 : * This is a static method of the class. 446 : * 447 : * @return the name of this table in a string. 448 : */ 449 : static std::string name() ; 450 : 451 : /** 452 : * Return the version information about this table. 453 : * 454 : */ 455 : std::string getVersion() const ; 456 : 457 : /** 458 : * Return the names of the attributes of this table. 459 : * 460 : * @return a vector of string 461 : */ 462 : static const std::vector<std::string>& getAttributesNames(); 463 : 464 : /** 465 : * Return the default sorted list of attributes names in the binary representation of the table. 466 : * 467 : * @return a const reference to a vector of string 468 : */ 469 : static const std::vector<std::string>& defaultAttributesNamesInBin(); 470 : 471 : /** 472 : * Return this table's Entity. 473 : */ 474 : Entity getEntity() const; 475 : 476 : /** 477 : * Set this table's Entity. 478 : * @param e An entity. 479 : */ 480 : void setEntity(Entity e); 481 : 482 : /** 483 : * Produces an XML representation conform 484 : * to the schema defined for SpectralWindow (SpectralWindowTable.xsd). 485 : * 486 : * @returns a string containing the XML representation. 487 : * @throws ConversionException 488 : */ 489 : std::string toXML() ; 490 : 491 : #ifndef WITHOUT_ACS 492 : // Conversion Methods 493 : /** 494 : * Convert this table into a SpectralWindowTableIDL CORBA structure. 495 : * 496 : * @return a pointer to a SpectralWindowTableIDL 497 : */ 498 : asdmIDL::SpectralWindowTableIDL *toIDL() ; 499 : 500 : /** 501 : * Fills the CORBA data structure passed in parameter 502 : * with the content of this table. 503 : * 504 : * @param x a reference to the asdmIDL::SpectralWindowTableIDL to be populated 505 : * with the content of this. 506 : */ 507 : void toIDL(asdmIDL::SpectralWindowTableIDL& x) const; 508 : 509 : #endif 510 : 511 : #ifndef WITHOUT_ACS 512 : /** 513 : * Populate this table from the content of a SpectralWindowTableIDL Corba structure. 514 : * 515 : * @throws DuplicateKey Thrown if the method tries to add a row having a key that is already in the table. 516 : * @throws ConversionException 517 : */ 518 : void fromIDL(asdmIDL::SpectralWindowTableIDL x) ; 519 : #endif 520 : 521 : // 522 : // ====> Row creation. 523 : // 524 : 525 : /** 526 : * Create a new row with default values. 527 : * @return a pointer on a SpectralWindowRow 528 : */ 529 : SpectralWindowRow *newRow(); 530 : 531 : 532 : /** 533 : * Create a new row initialized to the specified values. 534 : * @return a pointer on the created and initialized row. 535 : 536 : * @param basebandName 537 : 538 : * @param netSideband 539 : 540 : * @param numChan 541 : 542 : * @param refFreq 543 : 544 : * @param sidebandProcessingMode 545 : 546 : * @param totBandwidth 547 : 548 : * @param windowFunction 549 : 550 : */ 551 : SpectralWindowRow *newRow(BasebandNameMod::BasebandName basebandName, NetSidebandMod::NetSideband netSideband, int numChan, Frequency refFreq, SidebandProcessingModeMod::SidebandProcessingMode sidebandProcessingMode, Frequency totBandwidth, WindowFunctionMod::WindowFunction windowFunction); 552 : 553 : 554 : 555 : /** 556 : * Create a new row using a copy constructor mechanism. 557 : * 558 : * The method creates a new SpectralWindowRow owned by this. Each attribute of the created row 559 : * is a (deep) copy of the corresponding attribute of row. The method does not add 560 : * the created row to this, its simply parents it to this, a call to the add method 561 : * has to be done in order to get the row added (very likely after having modified 562 : * some of its attributes). 563 : * If row is null then the method returns a new SpectralWindowRow with default values for its attributes. 564 : * 565 : * @param row the row which is to be copied. 566 : */ 567 : SpectralWindowRow *newRow(SpectralWindowRow *row); 568 : 569 : // 570 : // ====> Append a row to its table. 571 : // 572 : 573 : 574 : 575 : 576 : /** 577 : * Add a row. 578 : * If there table contains a row whose key's fields are equal 579 : * to x's ones then return a pointer on this row (i.e. no actual insertion is performed) 580 : * otherwise add x to the table and return x. 581 : * @param x . A pointer on the row to be added. 582 : * @returns a pointer to a SpectralWindowRow. 583 : */ 584 : 585 : SpectralWindowRow* add(SpectralWindowRow* x) ; 586 : 587 : 588 : 589 : // 590 : // ====> Methods returning rows. 591 : // 592 : 593 : /** 594 : * Get a collection of pointers on the rows of the table. 595 : * @return Alls rows in a vector of pointers of SpectralWindowRow. The elements of this vector are stored in the order 596 : * in which they have been added to the SpectralWindowTable. 597 : */ 598 : std::vector<SpectralWindowRow *> get() ; 599 : 600 : /** 601 : * Get a const reference on the collection of rows pointers internally hold by the table. 602 : * @return A const reference of a vector of pointers of SpectralWindowRow. The elements of this vector are stored in the order 603 : * in which they have been added to the SpectralWindowTable. 604 : * 605 : */ 606 : const std::vector<SpectralWindowRow *>& get() const ; 607 : 608 : 609 : 610 : 611 : 612 : /** 613 : * Returns a SpectralWindowRow* given a key. 614 : * @return a pointer to the row having the key whose values are passed as parameters, or 0 if 615 : * no row exists for that key. 616 : 617 : * @param spectralWindowId 618 : 619 : * 620 : */ 621 : SpectralWindowRow* getRowByKey(Tag spectralWindowId); 622 : 623 : 624 : 625 : 626 : 627 : /** 628 : * Look up the table for a row whose all attributes except the autoincrementable one 629 : * are equal to the corresponding parameters of the method. 630 : * @return a pointer on this row if any, null otherwise. 631 : * 632 : 633 : * @param basebandName 634 : 635 : * @param netSideband 636 : 637 : * @param numChan 638 : 639 : * @param refFreq 640 : 641 : * @param sidebandProcessingMode 642 : 643 : * @param totBandwidth 644 : 645 : * @param windowFunction 646 : 647 : */ 648 : SpectralWindowRow* lookup(BasebandNameMod::BasebandName basebandName, NetSidebandMod::NetSideband netSideband, int numChan, Frequency refFreq, SidebandProcessingModeMod::SidebandProcessingMode sidebandProcessingMode, Frequency totBandwidth, WindowFunctionMod::WindowFunction windowFunction); 649 : 650 : 651 : void setUnknownAttributeBinaryReader(const std::string& attributeName, BinaryAttributeReaderFunctor* barFctr); 652 : BinaryAttributeReaderFunctor* getUnknownAttributeBinaryReader(const std::string& attributeName) const; 653 : 654 : private: 655 : 656 : /** 657 : * Create a SpectralWindowTable. 658 : * <p> 659 : * This constructor is private because only the 660 : * container can create tables. All tables must know the container 661 : * to which they belong. 662 : * @param container The container to which this table belongs. 663 : */ 664 : SpectralWindowTable (ASDM & container); 665 : 666 : ASDM & container; 667 : 668 : bool archiveAsBin; // If true archive binary else archive XML 669 : bool fileAsBin ; // If true file binary else file XML 670 : 671 : std::string version ; 672 : 673 : Entity entity; 674 : 675 : 676 : 677 : 678 : 679 : // A map for the autoincrementation algorithm 680 : std::map<std::string,int> noAutoIncIds; 681 : void autoIncrement(std::string key, SpectralWindowRow* x); 682 : 683 : 684 : /** 685 : * If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and throw exception if not. 686 : * Check if *x verifies the key uniqueness rule and throw an exception if not. 687 : * Append x to its table. 688 : * @throws DuplicateKey 689 : 690 : * @throws UniquenessViolationException 691 : 692 : */ 693 : SpectralWindowRow* checkAndAdd(SpectralWindowRow* x, bool skipCheckUniqueness=false) ; 694 : 695 : /** 696 : * Brutally append an SpectralWindowRow x to the collection of rows already stored in this table. No uniqueness check is done ! 697 : * 698 : * @param SpectralWindowRow* x a pointer onto the SpectralWindowRow to be appended. 699 : */ 700 : void append(SpectralWindowRow* x) ; 701 : 702 : /** 703 : * Brutally append an SpectralWindowRow x to the collection of rows already stored in this table. No uniqueness check is done ! 704 : * 705 : * @param SpectralWindowRow* x a pointer onto the SpectralWindowRow to be appended. 706 : */ 707 : void addWithoutCheckingUnique(SpectralWindowRow* x) ; 708 : 709 : 710 : 711 : 712 : 713 : // A data structure to store the pointers on the table's rows. 714 : 715 : // In all cases we maintain a private vector of SpectralWindowRow s. 716 : std::vector<SpectralWindowRow * > privateRows; 717 : 718 : 719 : 720 : std::vector<SpectralWindowRow *> row; 721 : 722 : 723 : void error() ; //throw(ConversionException); 724 : 725 : 726 : /** 727 : * Populate this table from the content of a XML document that is required to 728 : * be conform to the XML schema defined for a SpectralWindow (SpectralWindowTable.xsd). 729 : * @throws ConversionException 730 : * 731 : */ 732 : void fromXML(std::string& xmlDoc) ; 733 : 734 : std::map<std::string, BinaryAttributeReaderFunctor *> unknownAttributes2Functors; 735 : 736 : /** 737 : * Private methods involved during the build of this table out of the content 738 : * of file(s) containing an external representation of a SpectralWindow table. 739 : */ 740 : void setFromMIMEFile(const std::string& directory); 741 : /* 742 : void openMIMEFile(const std::string& directory); 743 : */ 744 : void setFromXMLFile(const std::string& directory); 745 : 746 : /** 747 : * Serialize this into a stream of bytes and encapsulates that stream into a MIME message. 748 : * @returns a string containing the MIME message. 749 : * 750 : * @param byteOrder a const pointer to a static instance of the class ByteOrder. 751 : * 752 : */ 753 : std::string toMIME(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity); 754 : 755 : 756 : /** 757 : * Extracts the binary part of a MIME message and deserialize its content 758 : * to fill this with the result of the deserialization. 759 : * @param mimeMsg the string containing the MIME message. 760 : * @throws ConversionException 761 : */ 762 : void setFromMIME(const std::string & mimeMsg); 763 : 764 : /** 765 : * Private methods involved during the export of this table into disk file(s). 766 : */ 767 : std::string MIMEXMLPart(const asdm::ByteOrder* byteOrder=asdm::ByteOrder::Machine_Endianity); 768 : 769 : /** 770 : * Stores a representation (binary or XML) of this table into a file. 771 : * 772 : * Depending on the boolean value of its private field fileAsBin a binary serialization of this (fileAsBin==true) 773 : * will be saved in a file "SpectralWindow.bin" or an XML representation (fileAsBin==false) will be saved in a file "SpectralWindow.xml". 774 : * The file is always written in a directory whose name is passed as a parameter. 775 : * @param directory The name of directory where the file containing the table's representation will be saved. 776 : * 777 : */ 778 : void toFile(std::string directory); 779 : 780 : /** 781 : * Load the table in memory if necessary. 782 : */ 783 : bool loadInProgress; 784 843 : void checkPresenceInMemory() { 785 843 : if (!presentInMemory && !loadInProgress) { 786 4 : loadInProgress = true; 787 4 : setFromFile(getContainer().getDirectory()); 788 4 : presentInMemory = true; 789 4 : loadInProgress = false; 790 : } 791 843 : } 792 : /** 793 : * Reads and parses a file containing a representation of a SpectralWindowTable as those produced by the toFile method. 794 : * This table is populated with the result of the parsing. 795 : * @param directory The name of the directory containing the file te be read and parsed. 796 : * @throws ConversionException If any error occurs while reading the 797 : * files in the directory or parsing them. 798 : * 799 : */ 800 : void setFromFile(const std::string& directory); 801 : 802 : }; 803 : 804 : } // End namespace asdm 805 : 806 : #endif /* SpectralWindowTable_CLASS */