Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const auto att = dataSet.openAttribute(attributeName);
- if (att.getDataType() == H5::PredType::NATIVE_DOUBLE) {
- att.read(att.getDataType(), &attributeValue);
- }
- else if (att.getDataType() == H5::PredType::NATIVE_FLOAT) {
- float temp = 0.F;
- att.read(att.getDataType(), &temp);
- attributeValue = static_cast<double>(temp);
- }
- else {
- // we throw an exception indicating we don't support the type
- }
- func (s *Attribute) Read(data interface{}, dtype *Datatype) error
- func (s *Attribute) GetType() Identifier
- if attr.GetType().ID() == hdf5.T_NATIVE_DOUBLE.ID() {
- // handle as a double
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement