mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-19 18:47:13 +02:00
compiler generated constructors and reduced warnings
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
#include "aare/FileInterface.hpp"
|
||||
|
||||
namespace aare{
|
||||
|
@ -17,7 +17,7 @@ class NumpyFile : public FileInterface {
|
||||
uint32_t header_len{};
|
||||
uint8_t header_len_size{};
|
||||
ssize_t header_size{};
|
||||
header_t m_header;
|
||||
NumpyHeader m_header;
|
||||
uint8_t major_ver_{};
|
||||
uint8_t minor_ver_{};
|
||||
|
||||
@ -29,7 +29,7 @@ class NumpyFile : public FileInterface {
|
||||
|
||||
|
||||
NumpyFile(const std::filesystem::path& fname);
|
||||
NumpyFile(FileConfig, header_t);
|
||||
NumpyFile(FileConfig, NumpyHeader);
|
||||
void write(Frame &frame) override;
|
||||
Frame read() override { return get_frame(this->current_frame++); }
|
||||
|
||||
|
@ -14,28 +14,20 @@
|
||||
#include "aare/DType.hpp"
|
||||
#include "aare/defs.hpp"
|
||||
|
||||
namespace aare {
|
||||
|
||||
using shape_t = std::vector<size_t>;
|
||||
|
||||
struct header_t {
|
||||
header_t() : dtype(aare::DType(aare::DType::ERROR)), fortran_order(false), shape(shape_t()){};
|
||||
header_t(aare::DType dtype, bool fortran_order, shape_t shape)
|
||||
: dtype(dtype), fortran_order(fortran_order), shape(shape){};
|
||||
aare::DType dtype;
|
||||
bool fortran_order;
|
||||
shape_t shape;
|
||||
std::string to_string() {
|
||||
std::stringstream sstm;
|
||||
sstm << "dtype: " << dtype.str() << ", fortran_order: " << fortran_order << ' ';
|
||||
struct NumpyHeader {
|
||||
DType dtype{aare::DType::ERROR};
|
||||
bool fortran_order{false};
|
||||
shape_t shape{};
|
||||
|
||||
sstm << "shape: (";
|
||||
for (auto item : shape)
|
||||
sstm << item << ',';
|
||||
sstm << ')';
|
||||
return sstm.str();
|
||||
}
|
||||
std::string to_string() const;
|
||||
};
|
||||
|
||||
namespace aare::NumpyHelpers {
|
||||
namespace NumpyHelpers {
|
||||
|
||||
const constexpr std::array<char, 6> magic_str{'\x93', 'N', 'U', 'M', 'P', 'Y'};
|
||||
const uint8_t magic_string_length{6};
|
||||
|
||||
@ -59,8 +51,9 @@ template <typename T, size_t N> bool in_array(T val, const std::array<T, N> &arr
|
||||
bool is_digits(const std::string &str);
|
||||
|
||||
aare::DType parse_descr(std::string typestring);
|
||||
size_t write_header(std::filesystem::path fname, const header_t &header) ;
|
||||
size_t write_header(std::ostream &out, const header_t &header) ;
|
||||
bool is_digits(const std::string &str);
|
||||
size_t write_header(std::filesystem::path fname, const NumpyHeader &header) ;
|
||||
size_t write_header(std::ostream &out, const NumpyHeader &header) ;
|
||||
|
||||
} // namespace aare::NumpyHelpers
|
||||
|
||||
} // namespace NumpyHelpers
|
||||
} // namespace aare
|
@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
#include "aare/FileFactory.hpp"
|
||||
#include "aare/RawFile.hpp"
|
||||
|
||||
|
Reference in New Issue
Block a user