source: trunk/src/Outputs/ASCIICatalogueWriter.hh @ 1071

Last change on this file since 1071 was 1071, checked in by MatthewWhiting, 12 years ago

Moving ASCIICatalogueWriter under FileCatalogueWriter?, to handle basic ofstream opening/closing. Still need the extra code to handle screen output.

File size: 2.8 KB
RevLine 
[1069]1// -----------------------------------------------------------------------
2// ASCIICatalogueWriter.hh: Writing output catalogues to basic ASCII-format
3//                          files (or the screen).
4// -----------------------------------------------------------------------
5// Copyright (C) 2006, Matthew Whiting, ATNF
6//
7// This program is free software; you can redistribute it and/or modify it
8// under the terms of the GNU General Public License as published by the
9// Free Software Foundation; either version 2 of the License, or (at your
10// option) any later version.
11//
12// Duchamp is distributed in the hope that it will be useful, but WITHOUT
13// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15// for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with Duchamp; if not, write to the Free Software Foundation,
19// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
20//
21// Correspondence concerning Duchamp may be directed to:
22//    Internet email: Matthew.Whiting [at] atnf.csiro.au
23//    Postal address: Dr. Matthew Whiting
24//                    Australia Telescope National Facility, CSIRO
25//                    PO Box 76
26//                    Epping NSW 1710
27//                    AUSTRALIA
28// -----------------------------------------------------------------------
[1046]29#ifndef DUCHAMP_ASCII_CATALOGUE_WRITER_H_
30#define DUCHAMP_ASCII_CATALOGUE_WRITER_H_
31
32#include <duchamp/Outputs/CatalogueWriter.hh>
[1071]33#include <duchamp/Outputs/FileCatalogueWriter.hh>
[1061]34#include <duchamp/Outputs/columns.hh>
[1046]35#include <duchamp/Detection/detection.hh>
[1049]36#include <ios>
[1046]37#include <iostream>
[1048]38#include <fstream>
[1046]39
40namespace duchamp {
41
[1071]42  class ASCIICatalogueWriter : public FileCatalogueWriter
[1046]43  {
44  public:
45    ASCIICatalogueWriter();
46    ASCIICatalogueWriter(std::string name);
[1061]47    ASCIICatalogueWriter(Catalogues::DESTINATION dest);
48    ASCIICatalogueWriter(std::string name, Catalogues::DESTINATION dest);
[1046]49    ASCIICatalogueWriter(const ASCIICatalogueWriter& other);
50    ASCIICatalogueWriter& operator= (const ASCIICatalogueWriter& other);
[1048]51    virtual ~ASCIICatalogueWriter(){};
[1046]52   
53    /// @brief open the catalogue for writing
[1049]54    bool openCatalogue(std::ios_base::openmode mode = std::ios_base::out );
[1046]55
56    /// @brief Write header information - not including parameters
57    void writeHeader();
[1049]58    void writeCommandLineEntry(int argc, char *argv[]);
[1046]59
[1048]60    void writeParameters();
61    void writeStats();
[1046]62    void writeTableHeader();
[1048]63    void writeEntries();
64    void writeEntry(Detection *object);
[1049]65    void writeCubeSummary();
[1048]66    void writeFooter(){};
[1046]67
68    bool closeCatalogue();
69
[1048]70
[1046]71  protected:
[1048]72    std::ostream *itsStream;
[1061]73    Catalogues::DESTINATION itsDestination;
[1048]74     
[1046]75
76  };
77
78
79}
80
81
82#endif
Note: See TracBrowser for help on using the repository browser.