feat(composition): added composition module stub
This commit is contained in:
32
src/composition/meson.build
Normal file
32
src/composition/meson.build
Normal file
@@ -0,0 +1,32 @@
|
||||
# Define the library
|
||||
composition_sources = files(
|
||||
'private/composition.cpp',
|
||||
)
|
||||
|
||||
composition_headers = files(
|
||||
'public/composition.h'
|
||||
)
|
||||
|
||||
dependencies = [
|
||||
probe_dep,
|
||||
config_dep,
|
||||
quill_dep,
|
||||
]
|
||||
|
||||
# Define the libcomposition library so it can be linked against by other parts of the build system
|
||||
libcomposition = static_library('composition',
|
||||
composition_sources,
|
||||
include_directories: include_directories('public'),
|
||||
cpp_args: ['-fvisibility=default'],
|
||||
dependencies: dependencies,
|
||||
install : true)
|
||||
|
||||
composition_dep = declare_dependency(
|
||||
include_directories: include_directories('public'),
|
||||
link_with: libcomposition,
|
||||
dependencies: dependencies,
|
||||
sources: composition_sources,
|
||||
)
|
||||
|
||||
# Make headers accessible
|
||||
install_headers(composition_headers, subdir : '4DSSE/composition')
|
||||
36
src/composition/private/composition.h
Normal file
36
src/composition/private/composition.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef COMPOSITION_H
|
||||
#define COMPOSITION_H
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "quill/LogMacros.h
|
||||
|
||||
#include "probe.h"
|
||||
#include "config.h"
|
||||
|
||||
struct CompositionEntry {
|
||||
std::string symbol;
|
||||
std::string mass_fraction;
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const CompositionEntry& entry) {
|
||||
os << std::setw(5) << "<" << entry.symbol << " : " << entry.mass_fraction << ">";
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
class Composition {
|
||||
private:
|
||||
Config& m_config = Config::getInstance();
|
||||
Probe::LogManager& m_logManager = Probe::LogManager::getInstance();
|
||||
quill::Logger* m_logger = logManager.getLogger('log');
|
||||
|
||||
std::vector<std::string> m_registeredSymbols;
|
||||
std::unordered_map<std::string, CompositionEntry> m_compositions;
|
||||
|
||||
}
|
||||
|
||||
#endif // COMPOSITION_H
|
||||
Reference in New Issue
Block a user