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

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

Adding the licensing text to files that didn't have it.

File size: 2.7 KB
Line 
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// -----------------------------------------------------------------------
29#ifndef DUCHAMP_ASCII_CATALOGUE_WRITER_H_
30#define DUCHAMP_ASCII_CATALOGUE_WRITER_H_
31
32#include <duchamp/Outputs/CatalogueWriter.hh>
33#include <duchamp/Outputs/columns.hh>
34#include <duchamp/Detection/detection.hh>
35#include <ios>
36#include <iostream>
37#include <fstream>
38
39namespace duchamp {
40
41  class ASCIICatalogueWriter : public CatalogueWriter
42  {
43  public:
44    ASCIICatalogueWriter();
45    ASCIICatalogueWriter(std::string name);
46    ASCIICatalogueWriter(Catalogues::DESTINATION dest);
47    ASCIICatalogueWriter(std::string name, Catalogues::DESTINATION dest);
48    ASCIICatalogueWriter(const ASCIICatalogueWriter& other);
49    ASCIICatalogueWriter& operator= (const ASCIICatalogueWriter& other);
50    virtual ~ASCIICatalogueWriter(){};
51   
52    /// @brief open the catalogue for writing
53    bool openCatalogue(std::ios_base::openmode mode = std::ios_base::out );
54
55    /// @brief Write header information - not including parameters
56    void writeHeader();
57    void writeCommandLineEntry(int argc, char *argv[]);
58
59    void writeParameters();
60    void writeStats();
61    void writeTableHeader();
62    void writeEntries();
63    void writeEntry(Detection *object);
64    void writeCubeSummary();
65    void writeFooter(){};
66
67    bool closeCatalogue();
68
69
70  protected:
71    std::ostream *itsStream;
72    std::ofstream itsFileStream;
73    Catalogues::DESTINATION itsDestination;
74     
75
76  };
77
78
79}
80
81
82#endif
Note: See TracBrowser for help on using the repository browser.