moving code into aare:: namespace

This commit is contained in:
Erik Frojdh
2024-04-02 12:26:51 +02:00
parent 449c5119a4
commit 0a6030aa3e
35 changed files with 122 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
#include "aare/FileInterface.hpp"
namespace aare{
class File {
private:
FileInterface *file_impl;
@@ -32,3 +32,5 @@ class File {
~File();
};
} // namespace aare

View File

@@ -4,6 +4,8 @@
#include "aare/utils/logger.hpp"
#include <filesystem>
namespace aare{
class FileFactory {
// Class that will be used to create FileInterface objects
// follows the factory pattern
@@ -35,3 +37,5 @@ class FileFactory {
virtual void parse_fname(FileInterface *) = 0;
virtual ~FileFactory() = default;
};
} // namespace aare

View File

@@ -6,6 +6,8 @@
#include <filesystem>
#include <vector>
namespace aare {
struct FileConfig {
std::filesystem::path fname;
aare::DType dtype = aare::DType(typeid(uint16_t));
@@ -93,3 +95,5 @@ class FileInterface {
ssize_t m_cols{};
ssize_t m_bitdepth{};
};
}

View File

@@ -5,6 +5,8 @@
#include <iostream>
#include <numeric>
namespace aare{
class NumpyFile : public FileInterface {
FILE *fp = nullptr;
size_t initial_header_len = 0;
@@ -42,4 +44,6 @@ class NumpyFile : public FileInterface {
size_t current_frame{};
void get_frame_into(size_t, std::byte *);
Frame get_frame(size_t frame_number);
};
};
} // namespace aare

View File

@@ -4,7 +4,7 @@
#include "aare/defs.hpp"
#include <fstream>
namespace aare {
class NumpyFileFactory : public FileFactory {
private:
@@ -18,4 +18,6 @@ class NumpyFileFactory : public FileFactory {
NumpyFile* load_file_write(FileConfig) override;
void parse_fname(FileInterface*)override{};
};
};
} // namespace aare

View File

@@ -4,6 +4,8 @@
#include "aare/SubFile.hpp"
#include "aare/defs.hpp"
namespace aare {
class RawFile : public FileInterface {
using config = RawFileConfig;
@@ -69,4 +71,6 @@ class RawFile : public FileInterface {
size_t current_frame{};
void get_frame_into(size_t frame_number, std::byte *image_buf);
Frame get_frame(size_t frame_number);
};
};
}

View File

@@ -1,5 +1,8 @@
#include "aare/FileFactory.hpp"
#include "aare/RawFile.hpp"
namespace aare {
class RawFileFactory : public FileFactory {
private:
void parse_json_metadata(RawFile *file);
@@ -16,3 +19,5 @@ class RawFileFactory : public FileFactory {
sls_detector_header read_header(const std::filesystem::path &fname);
void find_geometry(FileInterface *);
};
}

View File

@@ -5,6 +5,8 @@
#include <map>
#include <variant>
namespace aare {
class SubFile {
protected:
FILE *fp = nullptr;
@@ -42,3 +44,5 @@ class SubFile {
inline size_t bytes_per_part() { return (m_bitdepth / 8) * m_rows * m_cols; }
inline size_t pixels_per_part() { return m_rows * m_cols; }
};
} // namespace aare

View File

@@ -4,5 +4,8 @@
#include <filesystem>
#include <fmt/core.h>
namespace aare {
bool is_master_file(std::filesystem::path fpath);
}