cppDataPipeline 0.3.0
C++ Implementation of the FAIR Data Pipeline API
Loading...
Searching...
No Matches
distribution.hxx
1#ifndef __FDP_DISTRIBUTION_HXX__
2#define __FDP_DISTRIBUTION_HXX__
3
4#include <string>
5#include <ghc/filesystem.hpp>
6
7namespace FairDataPipeline {
13
14 public:
15 Distribution(const std::string &name, double mu, double sigma):
16 _name(name),
17 _mu(mu),
18 _sigma(sigma),
19 _component("0"){};
20 Distribution(const std::string &name, double mu, double sigma, const std::string &component):
21 _name(name),
22 _mu(mu),
23 _sigma(sigma),
24 _component(component){};
25 explicit Distribution(const std::string &file_name);
26 Distribution(const std::string &file_name, const std::string &component);
27 virtual ~Distribution() = default;
28 std::string get_name() const {return _name;}
29 double get_mu() const {return _mu;}
30 double get_sigma() const {return _sigma;}
31 std::string get_component() const {return _component;}
32
33 std::string write_to_toml(std::string &file_name);
34 std::string write_to_toml(std::string &component, std::string &file_name);
35
36 private:
37 std::string _name;
38 double _mu;
39 double _sigma;
40 std::string _component;
41
42 protected:
43 void read_from_toml(const ghc::filesystem::path &file_path, const std::string &component);
44 virtual bool isEqual(const Distribution& dist) const;
45 friend bool operator==(const Distribution& lhs, const Distribution& rhs){
46 return typeid(lhs) == typeid(rhs) && lhs.isEqual(rhs);
47 }
48 };
49
50}; // namespace FairDataPipeline
51
52#endif
Class for API objects.
Definition: distribution.hxx:12