Commit 9f139560725e379fbca038b6452616d1fe74c45e

Authored by Jürgen Knödlseder
1 parent 124728fd

Renamed GFitsTable::hascolumn() method to GFitsTable::contains().

Although GFitsTable does not derived from GContainer, it is basically a container class for FITS columns. Therefore, the check for existence of an element should be done using the contains() method.
... ... @@ -91,7 +91,8 @@ GFitsTable
91 91 The column table operator[] now returns a pointer instead of a
92 92 reference. Set set() method has been added for column setting.
93 93 The append_column() and insert_column() methods have been
94   - renamed to append() and insert().
  94 + renamed to append() and insert(). The hascolumn() method has
  95 + been renamed to contains().
95 96  
96 97 GFunction
97 98 The eval() method now takes a const reference to a double precisio
... ...
include/GFitsTable.hpp
... ... @@ -76,7 +76,7 @@ public:
76 76 void remove_rows(const int& row, const int& nrows);
77 77 const int& nrows(void) const;
78 78 const int& ncols(void) const;
79   - bool hascolumn(const std::string& colname) const;
  79 + bool contains(const std::string& colname) const;
80 80 std::string print(const GChatter& chatter = NORMAL) const;
81 81  
82 82 protected:
... ...
pyext/GFitsTable.i
... ... @@ -130,7 +130,7 @@ public:
130 130 void remove_rows(const int& row, const int& nrows);
131 131 const int& nrows(void) const;
132 132 const int& ncols(void) const;
133   - bool hascolumn(const std::string& colname) const;
  133 + bool contains(const std::string& colname) const;
134 134 };
135 135  
136 136  
... ...
src/fits/GFitsTable.cpp
... ... @@ -611,7 +611,7 @@ void GFitsTable::remove_rows(const int& row, const int& nrows)
611 611 * @param[in] colname Column name.
612 612 * @return True of the column exists, false otherwise.
613 613 ***************************************************************************/
614   -bool GFitsTable::hascolumn(const std::string& colname) const
  614 +bool GFitsTable::contains(const std::string& colname) const
615 615 {
616 616 // Get pointer in column
617 617 GFitsTableCol* ptr = ptr_column(colname);
... ...