Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced the storage container for HDU from vector to deque to prevent reference invalidation in fits_reader #164

Merged
merged 2 commits into from
Nov 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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