mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-12 23:37:13 +02:00
better file structure for better separation
This commit is contained in:
@ -72,7 +72,7 @@ set(SUPPRESSED_WARNINGS "-Wno-return-type")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${OPTIONAL_FLAGS} ${OPTIMIZATION_FLAGS} ${SUPPRESSED_WARNINGS}")
|
||||
|
||||
|
||||
include_directories(include)
|
||||
add_subdirectory(src)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Your First C++ Program
|
||||
#include <iostream>
|
||||
#include <FileHandler.hpp>
|
||||
#include "file_io/FileHandler.hpp"
|
||||
|
||||
using JFileHandler = FileHandler<DetectorType::Jungfrau,uint16_t>;
|
||||
using JFile = File<DetectorType::Jungfrau,uint16_t>;
|
||||
@ -19,9 +19,7 @@ void test(JFileHandler* f,int frame_number){
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::filesystem::path fpath("/home/l_bechir/github/aare/data/jungfrau_single_master_0.json");
|
||||
std::filesystem::path fpath("/home/bb/github/aare/data/jungfrau_single_master_0.json");
|
||||
auto fileHandler = new JFileHandler (fpath);
|
||||
|
||||
delete fileHandler;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "defs.hpp"
|
||||
#include "Frame.hpp"
|
||||
#include "common/defs.hpp"
|
||||
#include "core/Frame.hpp"
|
||||
#include "SubFile.hpp"
|
||||
#include <filesystem>
|
||||
#include <fmt/core.h>
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <filesystem>
|
||||
#include "File.hpp"
|
||||
#include "file_io/File.hpp"
|
||||
template <DetectorType detector,typename DataType>
|
||||
class FileFactory{
|
||||
// Class that will be used to create File objects
|
@ -1,6 +1,6 @@
|
||||
#include <filesystem>
|
||||
#include "FileFactory.hpp"
|
||||
#include "File.hpp"
|
||||
#include "file_io/FileFactory.hpp"
|
||||
#include "file_io/File.hpp"
|
||||
template <DetectorType detector,typename DataType>
|
||||
class FileHandler{
|
||||
private:
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include "File.hpp"
|
||||
#include "Frame.hpp"
|
||||
#include "defs.hpp"
|
||||
#include "file_io/File.hpp"
|
||||
#include "core/Frame.hpp"
|
||||
#include "common/defs.hpp"
|
||||
template <DetectorType detector, typename DataType>
|
||||
class JsonFile : public File<detector, DataType> {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "FileFactory.hpp"
|
||||
#include "file_io/FileFactory.hpp"
|
||||
template <DetectorType detector,typename DataType>
|
||||
class JsonFileFactory: public FileFactory<detector,DataType>
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
#include "File.hpp"
|
||||
#include "file_io/File.hpp"
|
||||
#include <filesystem>
|
||||
template<DetectorType detector,typename DataType>
|
||||
class RawFileFactory{
|
@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "defs.hpp"
|
||||
#include "common/defs.hpp"
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <variant>
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "File.hpp"
|
||||
#include "file_io/File.hpp"
|
||||
#include <filesystem>
|
||||
#include <fmt/core.h>
|
||||
|
@ -1,7 +1,5 @@
|
||||
add_library(common "${CMAKE_CURRENT_SOURCE_DIR}/defs.cpp")
|
||||
|
||||
target_include_directories(common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
target_link_libraries(common PUBLIC fmt::fmt)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "defs.hpp"
|
||||
#include "common/defs.hpp"
|
||||
|
||||
template <> std::string toString(DetectorType type) {
|
||||
switch (type) {
|
||||
|
@ -5,8 +5,6 @@
|
||||
|
||||
add_library(core "${CMAKE_CURRENT_SOURCE_DIR}/Frame.cpp")
|
||||
|
||||
target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
target_link_libraries(core PUBLIC common)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "Frame.hpp"
|
||||
#include "core/Frame.hpp"
|
||||
#include <iostream>
|
||||
|
||||
template <typename DataType>
|
||||
|
@ -4,7 +4,6 @@ set(FILE_IO_SOURCES "file/File.cpp"
|
||||
"file/SubFile.cpp"
|
||||
"file_factory/FileFactory.cpp"
|
||||
"file_factory/JsonFileFactory.cpp"
|
||||
"file_factory/RawFileFactory.cpp"
|
||||
"helpers.cpp"
|
||||
)
|
||||
# append ${CMAKE_CURRENT_SOURCE_DIR} to the list of sources using for loop
|
||||
@ -14,10 +13,4 @@ endforeach()
|
||||
|
||||
add_library(file_io ${FILE_IO_SOURCES_WITH_PATH})
|
||||
|
||||
|
||||
target_include_directories(file_io PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/file")
|
||||
target_include_directories(file_io PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/file_factory")
|
||||
target_include_directories(file_io PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
|
||||
target_link_libraries(file_io common fmt::fmt core nlohmann_json::nlohmann_json)
|
@ -1,4 +1,4 @@
|
||||
#include "File.hpp"
|
||||
#include "file_io/File.hpp"
|
||||
template <DetectorType detector, typename DataType>
|
||||
File<detector,DataType>::~File<detector,DataType>() {
|
||||
for (auto& subfile : subfiles) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "JsonFile.hpp"
|
||||
#include "file_io/JsonFile.hpp"
|
||||
#include <typeinfo>
|
||||
|
||||
template <DetectorType detector,typename DataType>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "SubFile.hpp"
|
||||
#include "file_io/SubFile.hpp"
|
||||
#include <iostream>
|
||||
// #include <filesystem>
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "FileFactory.hpp"
|
||||
#include "File.hpp"
|
||||
#include "JsonFileFactory.hpp"
|
||||
#include "RawFileFactory.hpp"
|
||||
#include "file_io/FileFactory.hpp"
|
||||
#include "file_io/File.hpp"
|
||||
#include "file_io/JsonFileFactory.hpp"
|
||||
#include <iostream>
|
||||
|
||||
template <DetectorType detector, typename DataType>
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "JsonFileFactory.hpp"
|
||||
#include "JsonFile.hpp"
|
||||
#include "SubFile.hpp"
|
||||
#include "defs.hpp"
|
||||
#include "helpers.hpp"
|
||||
#include "file_io/JsonFileFactory.hpp"
|
||||
#include "file_io/JsonFile.hpp"
|
||||
#include "file_io/SubFile.hpp"
|
||||
#include "common/defs.hpp"
|
||||
#include "file_io/helpers.hpp"
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "helpers.hpp"
|
||||
#include "file_io/helpers.hpp"
|
||||
|
||||
|
||||
bool is_master_file(std::filesystem::path fpath) {
|
||||
|
Reference in New Issue
Block a user