mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-02-03 10:38:40 +01:00
moving code into aare:: namespace
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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{};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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);
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
@@ -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 *);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -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
|
||||
@@ -4,5 +4,8 @@
|
||||
#include <filesystem>
|
||||
#include <fmt/core.h>
|
||||
|
||||
namespace aare {
|
||||
|
||||
bool is_master_file(std::filesystem::path fpath);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user