Public Types | Static Public Member Functions | Static Protected Member Functions | List of all members
Reader Class Reference
Inheritance diagram for Reader:
Inheritance graph
[legend]
Collaboration diagram for Reader:
Collaboration graph
[legend]

Public Types

enum  Mode { ATTRIBUTES =1 , DATASETS =2 , EXCLUSIVE =4 }
 
typedef drain::EnumFlagger< drain::MultiFlagger< Mode > > ModeFlagger
 

Static Public Member Functions

static void readFile (const std::string &filename, Hi5Tree &tree, ModeFlagger::dvalue_t mode=(ATTRIBUTES|DATASETS))
 
static void h5FileToTree (hid_t file_id, const Hi5Tree::path_t &path, Hi5Tree &tree, ModeFlagger::dvalue_t mode=(ATTRIBUTES|DATASETS))
 Conversion from native HDF5 structure to Rack's hi5 tree structure. More...
 
static void h5FileToTree (hid_t fid, Hi5Tree &tree, ModeFlagger::dvalue_t mode=(ATTRIBUTES|DATASETS))
 Conversion from native HDF5 structure to Rack's hi5 tree structure. More...
 
template<class T >
static void h5AttributeToData (hid_t aid, hid_t datatype, drain::Variable &attribute, size_t elements=1)
 
static void h5DatasetToImage (hid_t id, const Hi5Tree::path_t &path, drain::image::Image &image)
 const Hi5Tree::path_t &path More...
 
- Static Public Member Functions inherited from Hi5Base
static void handleStatus (herr_t status, const std::string &message, drain::Logger &mout, int lineNo=0)
 
template<int L, class T >
static void handleStatus (drain::Logger &mout, herr_t status, const std::string &message, const T &arg, int lineNo=0)
 
static hid_t getH5StandardType (const std::type_info &type)
 Give a native C++ type, returns a standard(?) HDF5 data type.
 
static hid_t getH5NativeDataType (const std::type_info &t)
 Given a native C++ type, returns a native HDF5 data type. More...
 
template<class T >
static hid_t getH5NativeDataType ()
 Given a native C++ type, returns a native HDF5 data type.
 
static hid_t getH5StringVariableLength ()
 
static drain::image::ImagegetPalette (Hi5Tree &dst)
 Creates a 256-element RGB palette to be referenced with linkPalette().
 
static void linkPalette (const Hi5Tree &palette, Hi5Tree &dst)
 Links the palette that has been (or will be) created with createPalette().
 
static void writeText (const Hi5Tree &src, const std::list< typename Hi5Tree::path_t > &paths, std::ostream &ostr=std::cout)
 Dumps the H5 structure, attributes and data properties.
 
static void writeText (const Hi5Tree &src, std::ostream &ostr=std::cout)
 Dumps the H5 structure, attributes and data properties. (Calls writeText(src, src.getKeys(), ostr)).
 
static void readText (Hi5Tree &src, std::istream &istr=std::cin)
 Constructs a tree from formatted text. See writeText(). More...
 
static void parsePath (const std::string &line, Hi5Tree::path_t &path, std::string &attrKey, std::string &attrValue)
 Split full path string to path object and attribute key. More...
 
static void readTextLine (Hi5Tree &src, const std::string &line)
 Assign a value with optional type specification. More...
 
static void assignAttribute (Hi5Tree &dst, const std::string &assignment)
 
static void deleteExcluded (Hi5Tree &src)
 Traverse subtree setting exclude=true . More...
 

Static Protected Member Functions

static herr_t iterate_attribute (hid_t id, const char *attr_name, const H5A_info_t *ainfo, void *operator_data)
 
static herr_t iterate (hid_t group_id, const char *member_name, void *operator_data)
 Recursive traversal.
 

Member Enumeration Documentation

◆ Mode

enum Mode
Enumerator
DATASETS 

Read attributes

EXCLUSIVE 

Read data arrays

Member Function Documentation

◆ h5DatasetToImage()

void h5DatasetToImage ( hid_t  id,
const Hi5Tree::path_t &  path,
drain::image::Image image 
)
static

const Hi5Tree::path_t &path

Get the native data type. (The conversion will not store the original data type.)

For reading images with several channels

Added 2016 for sclutter

Todo: status check

◆ h5FileToTree() [1/2]

static void h5FileToTree ( hid_t  fid,
Hi5Tree &  tree,
ModeFlagger::dvalue_t  mode = (ATTRIBUTES | DATASETS) 
)
inlinestatic

Conversion from native HDF5 structure to Rack's hi5 tree structure.

Parameters
fid- input in native HDF5 structure
tree- output in hi5 structure
mode- switch for excluding attributes or datasets.

◆ h5FileToTree() [2/2]

void h5FileToTree ( hid_t  file_id,
const Hi5Tree::path_t &  path,
Hi5Tree &  tree,
ModeFlagger::dvalue_t  mode = (ATTRIBUTES | DATASETS) 
)
static

Conversion from native HDF5 structure to Rack's hi5 tree structure.

Parameters
fid- input in native HDF5 structure
path- subpath of input (typically the root, "/")
tree- output in hi5 structure
mode- switch for excluding attributes or datasets. Recursive , const std::string &path

◆ iterate_attribute()

herr_t iterate_attribute ( hid_t  id,
const char *  attr_name,
const H5A_info_t *  ainfo,
void *  operator_data 
)
staticprotected

Get the native data type. (The conversion will not store the original data type.)

WARNING: C/Cpp H5Aread is not well documented. The following code may be unstable.

WARNING: looks like here H5Aread expects void *s as a pointer to pointer, and a new array is created and assigned. Unclear who is responsible for deleting the object.

WARNING: looks like here H5Aread treats void *s 'normally', as a C string (char array) in which character are copied.


The documentation for this class was generated from the following files: