Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD > Struct Template Referencefinal

Encapsulate a task for writing data to a destination. Containes a callable 'writer' responisible for writing data to a held dataset. Contains a callabel 'build_dataset' which builds or opens a dataset for writing to in a held HDFGroup. A WriteTask is bound to a group for its entire lifetime. More...

#include <write_task.hh>

Public Types

using BasegroupBuilder = BGB
 
using Writer = DW
 
using Builder = DB
 
using AttributeWriterGroup = AWG
 
using AttributeWriterDataset = AWD
 

Public Member Functions

std::string get_active_path ()
 Get the path of active dataset relative to the base_group.
 
std::string get_base_path ()
 Get the path to the base group object.
 
void swap (WriteTask &other)
 Swap the state of the caller with 'other'.
 
template<typename Basegroupbuilder , typename Writertype , typename Buildertype , typename AWritertypeG , typename AWritertypeD >
 WriteTask (Basegroupbuilder &&bgb, Writertype &&w, Buildertype &&b, AWritertypeG &&ag, AWritertypeD &&ad)
 Construct a new Write Task object.
 
 WriteTask ()=default
 Construct a new writer Task object.
 
 WriteTask (const WriteTask &other)=default
 
 WriteTask (WriteTask &&other)=default
 Construct a new writer Task object.
 
WriteTaskoperator= (const WriteTask &other)=default
 Copy assign caller from 'other'.
 
WriteTaskoperator= (WriteTask &&other)=default
 Move assign from 'other'.
 
 ~WriteTask ()=default
 Destroy the writer Task object.
 

Public Attributes

BasegroupBuilder build_basegroup
 Function building a base group.
 
std::shared_ptr< HDFGroupbase_group
 pointer to the hdfgroup in which all produced datasets live.
 
std::shared_ptr< HDFDatasetactive_dataset
 pointer to the dataset which is currently active
 
Writer write_data
 Callable to write data.
 
Builder build_dataset
 Callable to build new dataset.
 
AttributeWriterDataset write_attribute_active_dataset
 Callable to write attributes to dataset; invoked after task write.
 
AttributeWriterGroup write_attribute_basegroup
 Callabel to write attributes to base group, invoked after task build.
 

Detailed Description

template<class BGB, class DW, class DB, class AWG, class AWD>
struct Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >

Encapsulate a task for writing data to a destination. Containes a callable 'writer' responisible for writing data to a held dataset. Contains a callabel 'build_dataset' which builds or opens a dataset for writing to in a held HDFGroup. A WriteTask is bound to a group for its entire lifetime.

Template Parameters
BGBBasegroup builder type, automatically determined
DWData writer type, automatically determined
DBDataset builder type, automatically deterimned
AWGGroup attribute writer type, automatically determined
AWDDataset attribute writer type, automatically determined

Member Typedef Documentation

◆ AttributeWriterDataset

template<class BGB , class DW , class DB , class AWG , class AWD >
using Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::AttributeWriterDataset = AWD

◆ AttributeWriterGroup

template<class BGB , class DW , class DB , class AWG , class AWD >
using Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::AttributeWriterGroup = AWG

◆ BasegroupBuilder

template<class BGB , class DW , class DB , class AWG , class AWD >
using Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::BasegroupBuilder = BGB

◆ Builder

template<class BGB , class DW , class DB , class AWG , class AWD >
using Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::Builder = DB

◆ Writer

Constructor & Destructor Documentation

◆ WriteTask() [1/4]

Construct a new Write Task object.

Template Parameters
BasegroupbuilderAutomatically determined.
WritertypeAutomatically determined.
BuildertypeAutomatically determined.
AWritertypeGAutomatically determined.
AWritertypeDAutomatically determined.
Parameters
bgbbuilder function for basegroup
wwriter function for wrtiing data
bbuilder function for dataset
aggroup attribute writer
addataset attribute writer
178 :
180 base_group(nullptr), active_dataset(nullptr), write_data(w),
183 {
184 }
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213
Writer write_data
Callable to write data.
Definition write_task.hh:75
std::shared_ptr< HDFDataset > active_dataset
pointer to the dataset which is currently active
Definition write_task.hh:70
BasegroupBuilder build_basegroup
Function building a base group.
Definition write_task.hh:60
Builder build_dataset
Callable to build new dataset.
Definition write_task.hh:80
std::shared_ptr< HDFGroup > base_group
pointer to the hdfgroup in which all produced datasets live.
Definition write_task.hh:65
AttributeWriterDataset write_attribute_active_dataset
Callable to write attributes to dataset; invoked after task write.
Definition write_task.hh:85
AttributeWriterGroup write_attribute_basegroup
Callabel to write attributes to base group, invoked after task build.
Definition write_task.hh:91

◆ WriteTask() [2/4]

template<class BGB , class DW , class DB , class AWG , class AWD >
Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::WriteTask ( )
default

Construct a new writer Task object.

◆ WriteTask() [3/4]

template<class BGB , class DW , class DB , class AWG , class AWD >
Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::WriteTask ( const WriteTask< BGB, DW, DB, AWG, AWD > &  other)
default
Parameters
otherWriteTask object to copy from

◆ WriteTask() [4/4]

template<class BGB , class DW , class DB , class AWG , class AWD >
Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::WriteTask ( WriteTask< BGB, DW, DB, AWG, AWD > &&  other)
default

Construct a new writer Task object.

Parameters
otherWriteTask to move from

◆ ~WriteTask()

template<class BGB , class DW , class DB , class AWG , class AWD >
Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::~WriteTask ( )
default

Destroy the writer Task object.

Member Function Documentation

◆ get_active_path()

template<class BGB , class DW , class DB , class AWG , class AWD >
std::string Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::get_active_path ( )
inline

Get the path of active dataset relative to the base_group.

Returns
std::string
100 {
101 if (active_dataset != nullptr)
102 {
103 return active_dataset->get_path();
104 }
105 else
106 {
107 return "";
108 }
109 }

◆ get_base_path()

template<class BGB , class DW , class DB , class AWG , class AWD >
std::string Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::get_base_path ( )
inline

Get the path to the base group object.

Returns
std::string
118 {
119 if (base_group != nullptr)
120 {
121 return base_group->get_path();
122 }
123 else
124 {
125 return "";
126 }
127 }

◆ operator=() [1/2]

template<class BGB , class DW , class DB , class AWG , class AWD >
WriteTask & Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::operator= ( const WriteTask< BGB, DW, DB, AWG, AWD > &  other)
default

Copy assign caller from 'other'.

Parameters
otherObject to assign from
Returns
WriteTask&

◆ operator=() [2/2]

template<class BGB , class DW , class DB , class AWG , class AWD >
WriteTask & Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::operator= ( WriteTask< BGB, DW, DB, AWG, AWD > &&  other)
default

Move assign from 'other'.

Parameters
otherObject to assign from.
Returns
WriteTask&

◆ swap()

template<class BGB , class DW , class DB , class AWG , class AWD >
void Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::swap ( WriteTask< BGB, DW, DB, AWG, AWD > &  other)
inline

Swap the state of the caller with 'other'.

Parameters
otherDifferent WriteTask object
136 {
137 if (this == &other)
138 {
139 return;
140 }
141 else
142 {
143 using std::swap;
144 swap(build_basegroup, other.build_basegroup);
145 swap(base_group, other.base_group);
146 swap(active_dataset, other.active_dataset);
147 swap(write_data, other.write_data);
148 swap(build_dataset, other.build_dataset);
150 other.write_attribute_active_dataset);
151 swap(write_attribute_basegroup, other.write_attribute_basegroup);
152 }
153 }
void swap(WriteTask &other)
Swap the state of the caller with 'other'.
Definition write_task.hh:135

Member Data Documentation

◆ active_dataset

template<class BGB , class DW , class DB , class AWG , class AWD >
std::shared_ptr< HDFDataset> Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::active_dataset

pointer to the dataset which is currently active

◆ base_group

template<class BGB , class DW , class DB , class AWG , class AWD >
std::shared_ptr< HDFGroup > Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::base_group

pointer to the hdfgroup in which all produced datasets live.

◆ build_basegroup

Function building a base group.

◆ build_dataset

template<class BGB , class DW , class DB , class AWG , class AWD >
Builder Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::build_dataset

Callable to build new dataset.

◆ write_attribute_active_dataset

template<class BGB , class DW , class DB , class AWG , class AWD >
AttributeWriterDataset Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::write_attribute_active_dataset

Callable to write attributes to dataset; invoked after task write.

◆ write_attribute_basegroup

template<class BGB , class DW , class DB , class AWG , class AWD >
AttributeWriterGroup Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::write_attribute_basegroup

Callabel to write attributes to base group, invoked after task build.

◆ write_data

template<class BGB , class DW , class DB , class AWG , class AWD >
Writer Utopia::DataIO::WriteTask< BGB, DW, DB, AWG, AWD >::write_data

Callable to write data.


The documentation for this struct was generated from the following file: