ocssw
V2022
|
DataProvider.hpp
Go to the documentation of this file.
26 return std::find_if(provide.cbegin(), provide.cend(), [&needle](const auto* haystack){return haystack->matches(*needle);}) != provide.cend();
34 auto it = std::find_if(need.cbegin(), need.cend(), [&new_need](const auto& this_need){return *this_need == *new_need;});
42 DataProviderPathPart(DataProvider* provider_, std::unordered_set<Product*> provide_) : provider{provider_}, provide{provide_} {
45 DataProviderPathPart(DataProvider* provider_, bool is_input_) : provider{provider_}, is_input{is_input_} {} // obsolete
46 DataProviderPathPart(DataProvider* provider_, bool is_input_, bool is_output_) : provider{provider_}, is_input{is_input_}, is_output{is_output_} {} // obsolete
53 std::vector<std::shared_ptr<DataProviderPathPart>>& processing_path_) : data_record{data_record_}, processing_path{processing_path_} {}
61 DataProvider(const std::string& name, const std::string& description) : name_{name}, description_{description} {}
72 virtual void initialize(DataProviderConfiguration& configuration, std::unordered_set<Product*>& provide){(void)configuration;(void)provide;}
76 virtual void process_tile(DataProviderConfiguration& configuration, DataRecord &data_record, TileParameters& tile_params) = 0;
79 virtual void set_needs(std::unordered_set<std::shared_ptr<Product>>& provide){(void)provide;} // only providers that dynamically create needs/provides during path searching need to utilize this
81 virtual std::vector<std::shared_ptr<Product>> needs(std::unordered_set<Product*>& provide){ // TODO: should this get renamed?
89 //TODO: fulfills needs to be overloadable for providers that only need to check certain attributes.
90 // These won't have to be a perfect match because they may be able to assume that the rest of the attributes will be filled in by whatever they require.
117 return std::any_of(other.cbegin(), other.cend(), [&](const auto& o){ return contains_any(this->provides(), o->needs()); });
140 static bool contains_all(const std::vector<Product>& haystack, const std::vector<std::shared_ptr<Product>>& needles) {
148 static bool contains_any(const std::vector<Product>& haystack, const std::vector<std::shared_ptr<Product>>& needles) {
169 static bool is_contained_in(const Product& hay, const std::vector<std::shared_ptr<Product>>& needles){
bool partially_fulfills(const Product &other)
Definition: DataProvider.hpp:107
virtual void set_needs(std::unordered_set< std::shared_ptr< Product >> &provide)
Definition: DataProvider.hpp:79
virtual std::vector< std::shared_ptr< Product > > needs(std::unordered_set< Product * > &provide)
Definition: DataProvider.hpp:81
std::unordered_set< Product * > provide
Definition: DataProvider.hpp:20
virtual std::vector< Product > & provides()
DataProvider(const std::string &name, const std::string &description)
Definition: DataProvider.hpp:61
DataProvider(const std::string &name)
Definition: DataProvider.hpp:62
std::ostream & operator<<(std::ostream &out, focs::DataProvider &in)
std::shared_ptr< Product > add_or_find_need(std::shared_ptr< Product > new_need)
Definition: DataProvider.hpp:33
bool is_partially_fulfilled_by(const std::vector< Product > &other)
Definition: DataProvider.hpp:119
DataProviderPathPart(DataProvider *provider_)
Definition: DataProvider.hpp:41
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in out
Definition: HISTORY.txt:422
virtual void post_initialize(DataProviderConfiguration &configuration)
Definition: DataProvider.hpp:73
u5 which has been done in the LOCALGRANULEID metadata should have an extension NRT It is requested to identify the NRT production Changes from v6 which may affect scientific output
Definition: HISTORY.txt:186
bool provides(const std::shared_ptr< Product > needle) const
Definition: DataProvider.hpp:25
bool is_fulfilled_by(DataProvider &other)
Definition: DataProvider.hpp:104
virtual ~DataProvider()
virtual void process_tile(DataProviderConfiguration &configuration, DataRecord &data_record, TileParameters &tile_params)=0
bool is_partially_fulfilled_by(DataProvider &other)
Definition: DataProvider.hpp:122
bool partially_fulfills(const std::vector< std::shared_ptr< Product >> &other)
Definition: DataProvider.hpp:110
Definition: DataProvider.hpp:18
Definition: Product.hpp:303
Definition: DataProvider.hpp:59
bool is_partially_fulfilled_by(const Product &other)
Definition: DataProvider.hpp:126
virtual std::vector< std::shared_ptr< Product > > & needs()
DataProviderPathPart(DataProvider *provider_, bool is_input_)
Definition: DataProvider.hpp:45
static std::vector< std::shared_ptr< DataProviderPathPart > > processing_paths(KvStore &configuration, std::vector< DataProvider * > &input, std::vector< DataProvider * > &data_providers, std::vector< DataProvider * > &output)
bool partially_fulfills(const std::vector< DataProvider * > other)
Definition: DataProvider.hpp:116
virtual void pre_initialize(DataProviderConfiguration &configuration)
Definition: DataProvider.hpp:71
DataProviderPathPart(DataProvider *provider_, bool is_input_, bool is_output_)
Definition: DataProvider.hpp:46
bool fulfills(const std::vector< std::shared_ptr< Product >> &other)
Definition: DataProvider.hpp:95
virtual void initialize(DataProviderConfiguration &configuration, std::unordered_set< Product * > &provide)
Definition: DataProvider.hpp:72
Definition: DataRecord.hpp:80
Definition: DataRecord.hpp:14
const std::string & description() const
Definition: DataProvider.hpp:67
bool partially_fulfills(DataProvider &other)
Definition: DataProvider.hpp:113
std::unordered_set< std::shared_ptr< Product > > need
Definition: DataProvider.hpp:21
bool is_fulfilled_by(const std::vector< Product > &other)
Definition: DataProvider.hpp:101
virtual bool fulfills(const Product &other)
Definition: DataProvider.hpp:92
DataProviderPathPart(DataProvider *provider_, std::unordered_set< Product * > provide_)
Definition: DataProvider.hpp:42
DataProviderConfiguration(DataRecord &data_record_, std::vector< std::shared_ptr< DataProviderPathPart >> &processing_path_)
Definition: DataProvider.hpp:52
std::vector< std::shared_ptr< DataProviderPathPart > > & processing_path
Definition: DataProvider.hpp:57
Definition: DataProvider.hpp:16
void update_needs(std::vector< std::shared_ptr< Product >> new_needs)
Definition: DataProvider.hpp:28