cppDataPipeline 0.3.0
C++ Implementation of the FAIR Data Pipeline API
Loading...
Searching...
No Matches
io_object.hxx
1#ifndef __FDP_IOOBJECT_HXX__
2#define __FDP_IOOBJECT_HXX__
3
4#include <string>
5#include <cstddef>
6#include <json/value.h>
7
8#include "fdp/utilities/logging.hxx"
9#include "fdp/objects/api_object.hxx"
10
11namespace FairDataPipeline {
16 class IOObject {
17 private:
18 std::string data_product_;
19 std::string use_data_product_;
20 std::string use_component_ = "None";
21 std::string use_version_;
22 std::string use_namespace_;
23 ghc::filesystem::path path_;
24 std::string data_product_description_ = "None";
25 std::string component_description_ = "None";
26 bool public_ = false;
27
28 ApiObject::sptr component_obj_;
29 ApiObject::sptr data_product_obj_;
30
31 public:
36 IOObject() = default;
49 IOObject (const std::string& data_product,
50 const std::string& use_data_product,
51 const std::string& use_version,
52 const std::string& use_namespace,
53 ghc::filesystem::path path,
54 const std::string& data_product_description,
55 bool isPublic)
56 :
57 data_product_(data_product),
58 use_data_product_(use_data_product),
59 use_version_(use_version),
60 use_namespace_(use_namespace),
61 path_(path),
62 data_product_description_(data_product_description),
63 public_(isPublic){};
64
77 IOObject( const std::string& data_product,
78 const std::string& use_data_product,
79 const std::string& use_version,
80 const std::string& use_namespace,
81 ghc::filesystem::path path,
82 ApiObject &component_obj,
83 ApiObject &data_product_obj)
84 :
85 data_product_(data_product),
86 use_data_product_(use_data_product),
87 use_version_(use_version),
88 use_namespace_(use_namespace),
89 path_(path),
90 component_obj_(std::make_shared<ApiObject>(component_obj)),
91 data_product_obj_(std::make_shared<ApiObject>(data_product_obj)){};
92
98 const std::string& get_data_product() const {return data_product_;}
99
105 const std::string& get_use_data_product() const {return use_data_product_;}
106
112 const std::string& get_use_component() const {return use_component_;}
113
119 const std::string& get_use_version() const {return use_version_;}
120
126 const std::string& get_use_namespace() const {return use_namespace_;}
127
133 ghc::filesystem::path get_path() const {return path_;}
134
140 const std::string& get_data_product_description() const {return data_product_description_;}
141
147 const std::string& get_component_description() const {return component_description_;}
148
155 bool is_public() const {return public_;}
156
162 ApiObject::sptr get_component_object() const {return component_obj_;}
163
164
170 ApiObject::sptr get_data_product_object() const {return data_product_obj_;}
171
177 void set_component_object(ApiObject& component_obj){component_obj_ = std::make_shared<ApiObject>(component_obj);}
178
184 void set_data_product_object(ApiObject &data_product_obj){data_product_obj_ = std::make_shared<ApiObject>(data_product_obj);}
185 };
186};
187
188#endif
Class for API objects.
Definition: api_object.hxx:15
Class for API objects.
Definition: io_object.hxx:16
IOObject()=default
Construct a new IOObject object (empty constructor)
ghc::filesystem::path get_path() const
Get the path of the data product.
Definition: io_object.hxx:133
const std::string & get_component_description() const
Get the component description as a string.
Definition: io_object.hxx:147
const std::string & get_use_component() const
Get the use component as a string.
Definition: io_object.hxx:112
ApiObject::sptr get_component_object() const
Get the component object object.
Definition: io_object.hxx:162
const std::string & get_data_product_description() const
Get the data product description as a string.
Definition: io_object.hxx:140
void set_component_object(ApiObject &component_obj)
Set the component object object.
Definition: io_object.hxx:177
void set_data_product_object(ApiObject &data_product_obj)
Set the data product object object.
Definition: io_object.hxx:184
ApiObject::sptr get_data_product_object() const
Get the data product object object.
Definition: io_object.hxx:170
const std::string & get_use_namespace() const
Get the use namespace as a string.
Definition: io_object.hxx:126
IOObject(const std::string &data_product, const std::string &use_data_product, const std::string &use_version, const std::string &use_namespace, ghc::filesystem::path path, const std::string &data_product_description, bool isPublic)
Construct a new IOObject object Used to store inputs and outputs for in the config.
Definition: io_object.hxx:49
const std::string & get_use_version() const
Get the use version as a string.
Definition: io_object.hxx:119
IOObject(const std::string &data_product, const std::string &use_data_product, const std::string &use_version, const std::string &use_namespace, ghc::filesystem::path path, ApiObject &component_obj, ApiObject &data_product_obj)
Construct a new IOObject object Used to store inputs and outputs for in the config.
Definition: io_object.hxx:77
const std::string & get_use_data_product() const
Get the use data product as a string.
Definition: io_object.hxx:105
const std::string & get_data_product() const
Get the data product as a string.
Definition: io_object.hxx:98
bool is_public() const
Check whether the data product is public.
Definition: io_object.hxx:155