Skip to content

Commit

Permalink
Replaced the storage container for HDU from vector to deque (#164)
Browse files Browse the repository at this point in the history
is helps to prevent reference invalidation in fits_reader
  • Loading branch information
gopi487krishna authored Nov 28, 2020
1 parent aa10d57 commit f56fb61
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions include/boost/astronomy/io/fits_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ file License.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ASTRONOMY_IO_FITS_READER_HPP
#define BOOST_ASTRONOMY_IO_FITS_READER_HPP

#include <vector>
#include <deque>
#include <string>
#include <stdexcept>
#include <map>

#include <boost/astronomy/io/header.hpp>
Expand Down Expand Up @@ -59,7 +58,7 @@ namespace boost { namespace astronomy { namespace io {
struct fits_io {
private:
FileReader file_reader;
std::vector<typename ExtensionsSupported::Extension> hdu_list;
std::deque<typename ExtensionsSupported::Extension> hdu_list;
control_block hdus_control_block;
public:
/**
Expand Down Expand Up @@ -162,14 +161,14 @@ namespace boost { namespace astronomy { namespace io {
/**
* @brief Returns the list of hdu objects associated with a FITS file
*/
std::vector<typename ExtensionsSupported::Extension> get_hdu_list() {
std::deque<typename ExtensionsSupported::Extension> get_hdu_list() const {
return hdu_list;
}

/**
* @brief Returns the control block containing the hdu cache information
*/
control_block get_control_block_info() {
control_block get_control_block_info() const {
return hdus_control_block;
}

Expand Down

0 comments on commit f56fb61

Please sign in to comment.