Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. const auto att = dataSet.openAttribute(attributeName);
  2. if (att.getDataType() == H5::PredType::NATIVE_DOUBLE) {
  3. att.read(att.getDataType(), &attributeValue);
  4. }
  5. else if (att.getDataType() == H5::PredType::NATIVE_FLOAT) {
  6. float temp = 0.F;
  7. att.read(att.getDataType(), &temp);
  8. attributeValue = static_cast<double>(temp);
  9. }
  10. else {
  11. // we throw an exception indicating we don't support the type
  12. }
  13.  
  14. func (s *Attribute) Read(data interface{}, dtype *Datatype) error
  15.  
  16. func (s *Attribute) GetType() Identifier
  17.  
  18. if attr.GetType().ID() == hdf5.T_NATIVE_DOUBLE.ID() {
  19. // handle as a double
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement