Utopia  2
Framework for studying models of complex & adaptive systems.
Namespaces | Classes | Typedefs | Enumerations | Functions
Utopia::DataIO Namespace Reference

Namespaces

 _chunk_helpers
 
 _DMUtils
 
 Default
 
 Detail
 
 GraphLoad
 
 GraphUtilsHelper
 

Classes

struct  DataManagerTraits
 Type traits for the DataManager This allows to specify custom types for the DataManager. Usually, you only need to touch this if you do not want to use the defaults or if you want to need to explicitly specify a common base class because it cannot be deduced automatically. More...
 
class  DataManager
 Manage different tasks of writing out data from a source in a uniform yet flexible way. This is a class which, when being supplied with appropriate callables, manages their execution. More...
 
struct  DatasetDescriptor
 Descriptor for a dataset. Contains: path: string giving the path of the dataset in its group or file with_time_postfix: whether the current model time is appended to the dataset path dataset_capacity: vector giving capacity of the dataset per dimension dataset_chunksize: vector giving chunksize per dimension of the dataset dataset_compression: integer giving compression strength (0 to 10) More...
 
class  TaskFactory
 Functor for building a writetask from arguments. More...
 
class  DataManagerFactory
 Factory function which produces a Datamanager of type Default::DefaultDataManager<Model> from a config and argumets from which to construct writetasks. More...
 
struct  WriteTask
 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...
 
class  HDFAttribute
 Class for hdf5 attribute, which can be attached to groups and datasets. More...
 
class  HDFBufferFactory
 Class which turns non-vector or plain-array containers into vectors. If the value_types are containers themselves, these are turned into vectors as well, because HDF5 cannot write something else. More...
 
class  HDFDataset
 Class representing a HDFDataset, wich reads and writes data and attributes. More...
 
class  HDFDataspace
 Class that wraps an HDF5 dataspace and takes care of managing its resources. More...
 
class  HDFFile
 Class representing a HDF5 file. More...
 
class  HDFGroup
 Class represting a HDFGroup, an object analogous to a folder for HDFFiles. More...
 
class  HDFIdentifier
 Wrapper class around an hdf5 identifier, used to manage reference counts of the object this identifier refers to. More...
 
class  HDFObject
 Common base class for all HDF5 classes in the DATAIO Module i.e., for all classes that wrap HDF5-C-Library functionality like HDFDataset, HDFGroup, HDFFile. This class is not intendet as something to be used independently, but only as a base class to be inherited from. More...
 
class  HDFType
 Class which handles the conversion of C-types into hdf5types. More...
 
struct  is_callable
 Test whether an object is callable. More...
 
class  MonitorTimer
 The MonitorTimer keeps track of the time when to emit monitor data. More...
 
class  MonitorManager
 The MonitorManager manages the monitor entries and MonitorTimer. More...
 
class  Monitor
 The Monitor monitors entries that are emitted if a given time has passed. More...
 

Typedefs

using Config = YAML::Node
 Type of a variadic dictionary-like data structure used throughout Utopia. More...
 

Enumerations

enum class  TypeTag {
  plain , vertex_property , edge_property , vertex_descriptor ,
  edge_descriptor
}
 TypeTag enumerates the kind of access which is used to write data. It became necessary after integrating graphs. Has 5 values: plain : use for everything that is not a graph vertex_property : for writing graphs using boost::vertex_property edge_property : for writing graphs using boost::edge_property vertex_descriptor : for writing graphs using boost::vertex_descriptor edge_descriptor : for writing graphs using boost::edge_descriptor. More...
 
enum class  HDFCategory {
  file = H5I_FILE , group = H5I_GROUP , datatype = H5I_DATATYPE , dataspace = H5I_DATASPACE ,
  dataset = H5I_DATASET , attribute = H5I_ATTR
}
 Enumerate the different HDF5 object types for use in HDFObject class. More...
 

Functions

template<class Exc >
YAML::Exception improve_yaml_exception (const Exc &e, const Config &node, std::string prefix={})
 Improves yaml-cpp exceptions occurring for a given node. More...
 
std::string to_string (const Config &node)
 Given a config node, returns a string representation of it. More...
 
template<typename CVecT , DimType dim = 0>
CVecT get_as_arma_vec (const std::string &key, const DataIO::Config &node)
 Retrieve a config entry as Armadillo column vector using get_. More...
 
template<class BGB , class DW , class DB , class AWG , class AWD >
void swap (WriteTask< BGB, DW, DB, AWG, AWD > &lhs, WriteTask< BGB, DW, DB, AWG, AWD > &rhs)
 Swaps the state of lhs and rhs. More...
 
template<typename Basegroupbuilder , typename Writertype , typename Buildertype , typename AWritertypeG , typename AWritertypeD >
 WriteTask (Basegroupbuilder &&bgb, Writertype &&w, Buildertype &&b, AWritertypeG &&ad, AWritertypeD &&ag) -> WriteTask< std::decay_t< Basegroupbuilder >, std::decay_t< Writertype >, std::decay_t< Buildertype >, std::decay_t< AWritertypeG >, std::decay_t< AWritertypeD > >
 
std::string expanduser (const std::string &path)
 Expands a path with a leading ~ character into an absolute path. More...
 
std::string get_abs_filepath (const Config &cfg)
 Extracts an absolute file path from a configuration. More...
 
template<typename Graph >
std::shared_ptr< HDFGroupcreate_graph_group (const Graph &g, const std::shared_ptr< HDFGroup > &parent_grp, const std::string &name)
 
template<typename Graph >
void save_graph (const Graph &g, const std::shared_ptr< HDFGroup > &grp)
 Write function for a boost::Graph. More...
 
template<typename Graph , typename PropertyMap >
void save_graph (const Graph &g, const std::shared_ptr< HDFGroup > &grp, const PropertyMap vertex_ids)
 Write function for a boost::Graph. More...
 
template<IterateOver iterate_over, typename Graph , typename... Adaptors>
void save_graph_entity_properties (const Graph &g, const std::shared_ptr< HDFGroup > &nw_grp, const std::string &label, const std::tuple< Adaptors... > &adaptor_tuple)
 
template<typename Graph , typename... Adaptors>
void save_vertex_properties (Graph &&g, const std::shared_ptr< HDFGroup > &nw_grp, const std::string &label, const std::tuple< Adaptors... > &adaptor_tuple)
 
template<typename Graph , typename... Adaptors>
void save_edge_properties (Graph &&g, const std::shared_ptr< HDFGroup > &nw_grp, const std::string &label, const std::tuple< Adaptors... > &adaptor_tuple)
 
void swap (HDFAttribute &lhs, HDFAttribute &rhs)
 Swaps the states of Attributes rhs and lhs. More...
 
template<typename Cont = std::vector< hsize_t >>
const Cont calc_chunksize (const hsize_t typesize, const Cont io_extend, Cont max_extend={}, const bool opt_inf_dims=true, const bool larger_high_dims=true, const unsigned int CHUNKSIZE_MAX=1048576, const unsigned int CHUNKSIZE_MIN=8192, const unsigned int CHUNKSIZE_BASE=262144)
 Try to guess a good chunksize for a dataset. More...
 
void swap (HDFDataset &lhs, HDFDataset &rhs)
 Exchange state between lhs and rhs. More...
 
void swap (HDFDataspace &lhs, HDFDataspace &rhs)
 Swap states of lhs and rhs. More...
 
void swap (HDFGroup &lhs, HDFGroup &rhs)
 Swap lhs and rhs. More...
 
bool operator== (const HDFIdentifier &lhs, const HDFIdentifier &rhs)
 Comparsion operator for equality. More...
 
bool operator!= (const HDFIdentifier &lhs, const HDFIdentifier &rhs)
 Comparsion operator for inequality. More...
 
void swap (HDFIdentifier &lhs, HDFIdentifier &rhs)
 Exchange the states of lhs and rhs. More...
 
template<HDFCategory cat>
void swap (HDFObject< cat > &lhs, HDFObject< cat > &rhs)
 Exchange state of lhs and rhs. More...
 
bool operator== (const HDFType &lhs, const HDFType &rhs)
 Check equality of argument typefactories. Two typefactories are considered equal when they refer to the same HDF5 type, e.g., H5T_INTEGER, or H5T_VLEN. More...
 
bool operator!= (const HDFType &lhs, const HDFType &rhs)
 TODO. More...
 
bool check_validity (htri_t valid, const std::string_view object_name)
 Check for validity of a hdf5 htri_t type or similar. More...
 
htri_t path_exists (hid_t loc_id, std::string path, hid_t link_property_list=H5P_DEFAULT)
 Checks iteratively if each segment of a path exists. More...
 
auto path_is_valid (hid_t id, std::string path)
 Check if the path given relative to the object identified by 'id' exists and points to a valid hdf5 object. More...
 
template<HDFCategory category>
std::string category_to_string ()
 Turn category enum into a string that names it. More...
 
template<class Object >
std::string generate_object_name (const Object &object)
 Use category and path variable of object to make a string that identifies the object it is applied to. More...
 
template<typename Object >
hid_t open_dataspace (Object &&object)
 Depending on object category, opens a dataset or attribute dataspace. More...
 
template<typename Object >
hid_t open_type (Object &&object)
 Depending on object category, invokes H5Dget_type or H5Aget_type. More...