Functor for building a writetask from arguments.
More...
#include <factory.hh>
|
template<class SourceGetter , class Getter , class Group_attribute = Nothing, class Dataset_attribute = Nothing> |
std::pair< std::string, std::shared_ptr< Default::DefaultWriteTask< Model > > > | operator() (std::string name, std::string basegroup_path, DatasetDescriptor dataset_descriptor, SourceGetter &&get_source, Getter &&getter, Group_attribute &&group_attribute=Nothing{}, Dataset_attribute &&dataset_attribute=Nothing{}) |
| Basic factory function producing Default::DefaultWriteTask<Model> intstances, for writing out data. It is inteded to make the setup of a WriteTask simpler for common cases. More...
|
|
std::pair< std::string, std::shared_ptr< Default::DefaultWriteTask< Model > > > | operator() (std::string name, Default::DefaultBaseGroupBuilder group_builder, Default::DefaultDataWriter< Model > writer, Default::DefaultBuilder< Model > dataset_builder, Default::DefaultAttributeWriterGroup< Model > group_attr, Default::DefaultAttributeWriterDataset< Model > dset_attr) |
| Thin wrapper around the writetask constructor which allows to construct a writetask via the factory by providing all the functions the latter employs by hand. This is intended for cases where the other operator() is too restrictive. More...
|
|
|
static std::unordered_map< std::string, std::function< std::string(std::string, Model &) > > | _modifiers |
| Initialization of the modifier map. More...
|
|
template<class Model, TypeTag typetag = TypeTag::plain>
class Utopia::DataIO::TaskFactory< Model, typetag >
Functor for building a writetask from arguments.
- Template Parameters
-
Model | Model type. |
TypeTag::plain | Typetag, indicates what type of data source is used, has only to be changed when using graphs. |
◆ _adapt_graph_writer()
template<class Model , TypeTag typetag = TypeTag::plain>
template<class SourceGetter , class Getter >
Function which adapts getter functions for the correct graph accessor type, i.e., vertex_descriptor etc.
- Template Parameters
-
SourceGetter | automatically determined |
Getter | automatically determined |
- Parameters
-
get_source | Function which extracts the source to get data from from its superior structure, e.g., extracting a vertex list from a graph |
getter | Function which extracts the data to write from the source, e.g., from the vertex |
- Returns
- Default::DefaultDataWriter< Model >
◆ _make_attribute_writer()
template<class Model , TypeTag typetag = TypeTag::plain>
template<class Func , class AttributeHandle >
Function which produces functions for writing attributes to a dataset or group, and which are used by a writer task to write attributes to the dataset and basegroup it creates.
- Template Parameters
-
Func | Function type to produce |
Attribute | automatically determined |
- Parameters
-
attr | Either 'Nothing' if no attributes shall be written, or a tuple/pair (name, attribute_data) or a function convertible to type Func which takes care of writing dataset attributes, and receives a reference to a model as argument |
- Returns
- Func Function which writes attributes as constructed from arguments.
◆ _make_dataset_builder()
template<class Model , TypeTag typetag = TypeTag::plain>
Function producing a dataset builder function of type Default::DefaultBuilder<Model>, which is responsible for creating new HDF5 datasets on request.
- Parameters
-
dataset_descriptor | Describes dataset properties. |
- Returns
- auto Builder object
◆ operator()() [1/2]
template<class Model , TypeTag typetag = TypeTag::plain>
Thin wrapper around the writetask constructor which allows to construct a writetask via the factory by providing all the functions the latter employs by hand. This is intended for cases where the other operator() is too restrictive.
- Parameters
-
name | Name of the task to be build |
group_builder | Function to build a HDFGroup to store datasets in |
writer | Function which writes out data |
dataset_builder | Function to build Datasets |
group_attr | Function writing attributes to the task's base group |
dset_attr | Function writing attrbutes to the task's currently active dataset |
- Returns
- std::pair<std::string, Default::DefaultWriteTask<Model>>
◆ operator()() [2/2]
template<class Model , TypeTag typetag = TypeTag::plain>
template<class SourceGetter , class Getter , class Group_attribute = Nothing, class Dataset_attribute = Nothing>
Basic factory function producing Default::DefaultWriteTask<Model> intstances, for writing out data. It is inteded to make the setup of a WriteTask simpler for common cases.
- Template Parameters
-
Model | The model class the task refers to. The model is the ultimate source of data in utopia context, hence has to be given. |
SourceGetter | A container type, in this context something which has an iterator, automatically determined. |
Getter | Unary function type getting SourceGetter::value_type as argument and returning data to be written, automatically determined. |
Group_attribute | Either callable of type Default::GroupAttributeWriter or a tuplelike object. |
Dataset_attribute | Either callable of type Default::DatasetAttributeWriter or a tuplelike object. |
- Parameters
-
name | String naming this task, to be used with config. |
basegroup_path | Path in the HDF5 file to the base_group this task stores its produced datasets in. |
get_source | Function which returns a container or graph holding the data to use for write |
getter | Unary function getting a SourceGetter::value_type argument and returning data to be written. |
dataset_descriptor | DatasetDescriptor instance which gives the properties constructed datasets should have, at the very least its path in the basegroup. |
group_attribute | Either a callable of type DefaultGroupAttributeWriter or a tuplelike object containing [attribute_name, attribute_data]. Usually, the latter is a descriptive string. The last possiblity is to give 'Nothing', which means that the Attribute should be ignored |
dataset_attribute | Either a callable of type DefaultGroupAttributeWriter or some a tuplelike object containing [attribute_name, attribute_data]. Usually, the latter is a descriptive string. The last possiblity is to give 'Nothing', which means that the Attribute should be ignored |
- Returns
- std::pair<std::string, Default::DefaultWriteTask<Model>> pair containing a name and a writetask, to be used with the datamanager.
The documentation for this class was generated from the following file: