From 578f834064b3591bbb78e8349e893f0251fedbca Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Thu, 18 Nov 2010 09:23:56 +0000 Subject: [PATCH] remove ostream operator (now handled by GFitsTableCol base class) --- include/GFitsTable.hpp | 25 +++++++++++++++---------- include/GFitsTableBitCol.hpp | 4 +--- include/GFitsTableBoolCol.hpp | 4 +--- include/GFitsTableDoubleCol.hpp | 4 +--- include/GFitsTableFloatCol.hpp | 4 +--- include/GFitsTableLongCol.hpp | 4 +--- include/GFitsTableLongLongCol.hpp | 4 +--- include/GFitsTableShortCol.hpp | 4 +--- include/GFitsTableStringCol.hpp | 4 +--- include/GFitsTableULongCol.hpp | 4 +--- include/GFitsTableUShortCol.hpp | 4 +--- src/fits/GFitsTableBitCol.cpp | 30 ++++-------------------------- src/fits/GFitsTableBoolCol.cpp | 19 ++----------------- src/fits/GFitsTableDoubleCol.cpp | 17 +---------------- src/fits/GFitsTableFloatCol.cpp | 17 +---------------- src/fits/GFitsTableLongCol.cpp | 17 +---------------- src/fits/GFitsTableLongLongCol.cpp | 17 +---------------- src/fits/GFitsTableShortCol.cpp | 17 +---------------- src/fits/GFitsTableStringCol.cpp | 20 ++------------------ src/fits/GFitsTableULongCol.cpp | 17 +---------------- src/fits/GFitsTableUShortCol.cpp | 17 +---------------- 21 files changed, 40 insertions(+), 213 deletions(-) diff --git a/include/GFitsTable.hpp b/include/GFitsTable.hpp index 3ee15dc..43f8649 100644 --- a/include/GFitsTable.hpp +++ b/include/GFitsTable.hpp @@ -20,6 +20,8 @@ #define GFITSTABLE_HPP /* __ Includes ___________________________________________________________ */ +#include +#include "GLog.hpp" #include "GFitsHDU.hpp" #include "GFitsTableCol.hpp" @@ -39,6 +41,7 @@ class GFitsTable : public GFitsHDU { // I/O friends friend std::ostream& operator<< (std::ostream& os, const GFitsTable& table); + friend GLog& operator<< (GLog& log, const GFitsTable& table); public: // Constructors and destructors @@ -65,16 +68,15 @@ public: protected: // Protected methods - void init_members(void); - void copy_members(const GFitsTable& table); - void free_members(void); - void data_open(void* vptr); - void data_save(void); - void data_close(void); - void data_connect(void* vptr); - char* get_ttype(const int& colnum) const; - char* get_tform(const int& colnum) const; - char* get_tunit(const int& colnum) const; + void data_open(void* vptr); + void data_save(void); + void data_close(void); + void data_connect(void* vptr); + std::ostream& data_dump(std::ostream& os) const; + GLog& data_dump(GLog& log) const; + char* get_ttype(const int& colnum) const; + char* get_tform(const int& colnum) const; + char* get_tunit(const int& colnum) const; // Protected data area int m_type; //!< Table type (1=ASCII, 2=Binary) @@ -84,6 +86,9 @@ protected: private: // Private methods + void init_members(void); + void copy_members(const GFitsTable& table); + void free_members(void); }; #endif /* GFITSTABLE_HPP */ diff --git a/include/GFitsTableBitCol.hpp b/include/GFitsTableBitCol.hpp index ff27ca6..3588683 100644 --- a/include/GFitsTableBitCol.hpp +++ b/include/GFitsTableBitCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLEBITCOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -34,9 +35,6 @@ ***************************************************************************/ class GFitsTableBitCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableBitCol& column); - public: // Constructors and destructors GFitsTableBitCol(void); diff --git a/include/GFitsTableBoolCol.hpp b/include/GFitsTableBoolCol.hpp index 072f08d..924496c 100644 --- a/include/GFitsTableBoolCol.hpp +++ b/include/GFitsTableBoolCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLEBOOLCOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -35,9 +36,6 @@ ***************************************************************************/ class GFitsTableBoolCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableBoolCol& column); - public: // Constructors and destructors GFitsTableBoolCol(void); diff --git a/include/GFitsTableDoubleCol.hpp b/include/GFitsTableDoubleCol.hpp index 1e8c4c6..22b7bb7 100644 --- a/include/GFitsTableDoubleCol.hpp +++ b/include/GFitsTableDoubleCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLEDOUBLECOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -32,9 +33,6 @@ ***************************************************************************/ class GFitsTableDoubleCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableDoubleCol& column); - public: // Constructors and destructors GFitsTableDoubleCol(void); diff --git a/include/GFitsTableFloatCol.hpp b/include/GFitsTableFloatCol.hpp index b7fb267..50986ce 100644 --- a/include/GFitsTableFloatCol.hpp +++ b/include/GFitsTableFloatCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLEFLOATCOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -32,9 +33,6 @@ ***************************************************************************/ class GFitsTableFloatCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableFloatCol& column); - public: // Constructors and destructors GFitsTableFloatCol(void); diff --git a/include/GFitsTableLongCol.hpp b/include/GFitsTableLongCol.hpp index 10bb983..c75543f 100644 --- a/include/GFitsTableLongCol.hpp +++ b/include/GFitsTableLongCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLELONGCOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -32,9 +33,6 @@ ***************************************************************************/ class GFitsTableLongCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableLongCol& column); - public: // Constructors and destructors GFitsTableLongCol(void); diff --git a/include/GFitsTableLongLongCol.hpp b/include/GFitsTableLongLongCol.hpp index 71b65b7..2ad8b9a 100644 --- a/include/GFitsTableLongLongCol.hpp +++ b/include/GFitsTableLongLongCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLELONGLONGCOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -32,9 +33,6 @@ ***************************************************************************/ class GFitsTableLongLongCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableLongLongCol& column); - public: // Constructors and destructors GFitsTableLongLongCol(void); diff --git a/include/GFitsTableShortCol.hpp b/include/GFitsTableShortCol.hpp index 8d8443c..3ddeb79 100644 --- a/include/GFitsTableShortCol.hpp +++ b/include/GFitsTableShortCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLESHORTCOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -32,9 +33,6 @@ ***************************************************************************/ class GFitsTableShortCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableShortCol& column); - public: // Constructors and destructors GFitsTableShortCol(void); diff --git a/include/GFitsTableStringCol.hpp b/include/GFitsTableStringCol.hpp index 483f6c8..8c93878 100644 --- a/include/GFitsTableStringCol.hpp +++ b/include/GFitsTableStringCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLESTRINGCOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -32,9 +33,6 @@ ***************************************************************************/ class GFitsTableStringCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableStringCol& column); - public: // Constructors and destructors GFitsTableStringCol(void); diff --git a/include/GFitsTableULongCol.hpp b/include/GFitsTableULongCol.hpp index 1cb4414..66127fc 100644 --- a/include/GFitsTableULongCol.hpp +++ b/include/GFitsTableULongCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLEULONGCOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -32,9 +33,6 @@ ***************************************************************************/ class GFitsTableULongCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableULongCol& column); - public: // Constructors and destructors GFitsTableULongCol(void); diff --git a/include/GFitsTableUShortCol.hpp b/include/GFitsTableUShortCol.hpp index 5721eca..c4914d0 100644 --- a/include/GFitsTableUShortCol.hpp +++ b/include/GFitsTableUShortCol.hpp @@ -20,6 +20,7 @@ #define GFITSTABLEUSHORTCOL_HPP /* __ Includes ___________________________________________________________ */ +#include #include "GFitsTableCol.hpp" @@ -32,9 +33,6 @@ ***************************************************************************/ class GFitsTableUShortCol : public GFitsTableCol { - // I/O friends - friend std::ostream& operator<< (std::ostream& os, const GFitsTableUShortCol& column); - public: // Constructors and destructors GFitsTableUShortCol(void); diff --git a/src/fits/GFitsTableBitCol.cpp b/src/fits/GFitsTableBitCol.cpp index 6ee1301..2a365be 100644 --- a/src/fits/GFitsTableBitCol.cpp +++ b/src/fits/GFitsTableBitCol.cpp @@ -15,7 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -522,17 +522,10 @@ void GFitsTableBitCol::load_column(void) // Compute number of Bytes and Bits per row m_bytes_per_row = (m_number > 0) ? ((m_number-1) / 8) + 1 : 0; m_bits_per_row = m_bytes_per_row * 8; - + // Compute length of memory array m_size = m_bytes_per_row * m_length; -/* -std::cout << m_name - << " size=" << m_size - << " bits=" << m_bits - << " bytes_per_row=" << m_bytes_per_row - << " bits_per_row=" << m_bits_per_row << std::endl; -*/ - + // Load only if the column has a positive size if (m_size > 0) { @@ -629,7 +622,7 @@ void GFitsTableBitCol::get_bit(const int& row, const int& inx) if (row < 0 || row >= m_length) throw GException::out_of_range(G_GET_BIT, row, 0, m_length-1); #endif - + // Check inx value #if defined(G_RANGE_CHECK) if (inx < 0 || inx >= m_number) @@ -680,18 +673,3 @@ void GFitsTableBitCol::set_pending(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream. - * @param[in] column Column to put in output stream. - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableBitCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} diff --git a/src/fits/GFitsTableBoolCol.cpp b/src/fits/GFitsTableBoolCol.cpp index ad33194..b79b4f8 100644 --- a/src/fits/GFitsTableBoolCol.cpp +++ b/src/fits/GFitsTableBoolCol.cpp @@ -15,7 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -193,7 +193,7 @@ std::string GFitsTableBoolCol::string(const int& row, const int& inx) // Convert bool into string std::string result = (m_data[offset(row,inx)]) ? "T" : "F"; - + // Return value return result; } @@ -582,18 +582,3 @@ void GFitsTableBoolCol::free_buffer(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream. - * @param[in] column Column to put in output stream. - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableBoolCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} diff --git a/src/fits/GFitsTableDoubleCol.cpp b/src/fits/GFitsTableDoubleCol.cpp index 30d42e9..de213a4 100644 --- a/src/fits/GFitsTableDoubleCol.cpp +++ b/src/fits/GFitsTableDoubleCol.cpp @@ -15,7 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -479,18 +479,3 @@ void GFitsTableDoubleCol::init_data(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream - * @param[in] column Column to put in output stream - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableDoubleCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} diff --git a/src/fits/GFitsTableFloatCol.cpp b/src/fits/GFitsTableFloatCol.cpp index 5e37c2c..bfc5900 100644 --- a/src/fits/GFitsTableFloatCol.cpp +++ b/src/fits/GFitsTableFloatCol.cpp @@ -15,7 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -479,18 +479,3 @@ void GFitsTableFloatCol::init_data(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream. - * @param[in] column Column to put in output stream. - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableFloatCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} diff --git a/src/fits/GFitsTableLongCol.cpp b/src/fits/GFitsTableLongCol.cpp index a1fb82e..2e2bc4d 100644 --- a/src/fits/GFitsTableLongCol.cpp +++ b/src/fits/GFitsTableLongCol.cpp @@ -15,7 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -479,18 +479,3 @@ void GFitsTableLongCol::init_data(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream. - * @param[in] column Column to put in output stream. - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableLongCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} diff --git a/src/fits/GFitsTableLongLongCol.cpp b/src/fits/GFitsTableLongLongCol.cpp index 931b7a6..1bc531a 100644 --- a/src/fits/GFitsTableLongLongCol.cpp +++ b/src/fits/GFitsTableLongLongCol.cpp @@ -15,7 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -479,18 +479,3 @@ void GFitsTableLongLongCol::init_data(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream - * @param[in] column Column to put in output stream - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableLongLongCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} diff --git a/src/fits/GFitsTableShortCol.cpp b/src/fits/GFitsTableShortCol.cpp index 534e817..02567ee 100644 --- a/src/fits/GFitsTableShortCol.cpp +++ b/src/fits/GFitsTableShortCol.cpp @@ -15,7 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -479,18 +479,3 @@ void GFitsTableShortCol::init_data(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream - * @param[in] column Column to put in output stream - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableShortCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} diff --git a/src/fits/GFitsTableStringCol.cpp b/src/fits/GFitsTableStringCol.cpp index a743c21..1129764 100644 --- a/src/fits/GFitsTableStringCol.cpp +++ b/src/fits/GFitsTableStringCol.cpp @@ -15,8 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -328,7 +327,7 @@ void GFitsTableStringCol::copy_members(const GFitsTableStringCol& column) // Copy NULL value if (column.m_nulval != NULL) { m_nulval = new char[m_width+1]; - strncpy(m_nulval, column.m_nulval, m_width); + strncpy(m_nulval, column.m_nulval, m_width); } // Small memory option: release column if it was fetch above @@ -622,18 +621,3 @@ void GFitsTableStringCol::free_buffer(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream. - * @param[in] column Column to put in output stream. - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableStringCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} diff --git a/src/fits/GFitsTableULongCol.cpp b/src/fits/GFitsTableULongCol.cpp index 7eaec71..35c16fd 100644 --- a/src/fits/GFitsTableULongCol.cpp +++ b/src/fits/GFitsTableULongCol.cpp @@ -15,7 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -476,18 +476,3 @@ void GFitsTableULongCol::init_data(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream. - * @param[in] column Column to put in output stream. - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableULongCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} diff --git a/src/fits/GFitsTableUShortCol.cpp b/src/fits/GFitsTableUShortCol.cpp index 875289f..a7e7f76 100644 --- a/src/fits/GFitsTableUShortCol.cpp +++ b/src/fits/GFitsTableUShortCol.cpp @@ -15,7 +15,7 @@ #ifdef HAVE_CONFIG_H #include #endif -#include +#include #include "GException.hpp" #include "GTools.hpp" #include "GFitsCfitsio.hpp" @@ -476,18 +476,3 @@ void GFitsTableUShortCol::init_data(void) = Friends = = = ==========================================================================*/ - -/***********************************************************************//** - * @brief Output operator - * - * @param[in] os Output stream. - * @param[in] column Column to put in output stream. - ***************************************************************************/ -std::ostream& operator<< (std::ostream& os, const GFitsTableUShortCol& column) -{ - // Dump column in output stream - column.dump_column(os, column.m_data); - - // Return output stream - return os; -} -- libgit2 0.21.4