h5cpp  0.4.1
A modern C++ wrapper for the HDF5 C library
dataset.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2017 DESY,ESS
3 //
4 // This file is part of h5cpp.
5 //
6 // This library is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU Lesser General Public License as published
8 // by the Free Software Foundation; either version 2.1 of the License, or
9 // (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY
13 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 // License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the
18 // Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
19 // Boston, MA 02110-1301 USA
20 // ===========================================================================
21 //
22 // Authors:
23 // Eugen Wintersberger <eugen.wintersberger@desy.de>
24 // Jan Kotanski <jan.kotanski@desy.de>
25 //
26 // Created on: Sep 7, 2017
27 //
28 #pragma once
29 
30 #include <h5cpp/node/node.hpp>
35 #include <h5cpp/core/types.hpp>
38 #include <h5cpp/core/windows.hpp>
43 #include <h5cpp/error/error.hpp>
44 
45 namespace hdf5 {
46 namespace node {
47 
48 class Selection;
49 
50 class DLL_EXPORT Dataset : public Node
51 {
52  public:
61  Dataset() = default;
62 
68  Dataset(const Dataset &) = default;
69 
79  Dataset(const Node &node);
80 
93  Dataset(const Group &base,const Path &path,
94  const datatype::Datatype &type,
95  const dataspace::Dataspace &space = dataspace::Scalar(),
99 
108  dataspace::Dataspace dataspace() const;
109 
119  property::DatasetCreationList creation_list() const;
120 
130  property::DatasetAccessList access_list() const;
131 
141  datatype::Datatype datatype() const;
142 
157  void extent(const Dimensions &dims) const;
158 
159 
160 
161  void extent(size_t dim,ssize_t delta_elements) const;
162 
163 
177  void resize(const Dimensions &dims) const;
178 
179 
180 
181 #if H5_VERSION_GE(1,10,0)
182  void refresh() const;
183 #endif
184 
185 
203  template<typename T>
204  void write(const T &data,const datatype::Datatype &mem_type,
205  const dataspace::Dataspace &mem_space,
206  const dataspace::Dataspace &file_space,
207  const property::DatasetTransferList &dtpl =
209 
216  template<typename T>
217  void write(const T &data,const datatype::Datatype &mem_type,
218  const dataspace::Dataspace &mem_space,
219  const property::DatasetTransferList &dtpl =
221 
239  template<typename T>
240  void read(T &data,const datatype::Datatype &mem_type,
241  const dataspace::Dataspace &mem_space,
242  const dataspace::Dataspace &file_space,
243  const property::DatasetTransferList &dtpl =
245 
246  template<typename T>
247  void read(T &data,
248  const datatype::Datatype &mem_type,
249  const dataspace::Dataspace &mem_space,
250  const property::DatasetTransferList &dtpl =
252 
253 
264  template<typename T>
265  void write(const T &data,const property::DatasetTransferList &dtpl =
267 
268  void write(const char *data,const property::DatasetTransferList &dtpl =
270 
283  template<typename T>
284  void write_chunk(const T &data,
285  std::vector<unsigned long long> offset,
286  std::uint32_t filter_mask = 0,
287  const property::DatasetTransferList &dtpl =
289 
290 #if H5_VERSION_GE(1,10,2)
291 
304  template<typename T>
305  std::uint32_t read_chunk(T &data,
306  std::vector<unsigned long long> offset,
307  const property::DatasetTransferList &dtpl =
309 
310 
322  unsigned long long chunk_storage_size( std::vector<unsigned long long> offset) const;
323 
324 #endif
325 
336  template<typename T>
337  void read(T &data,const property::DatasetTransferList &dtpl =
339 
351  template<typename T>
352  void write(const T &data,const dataspace::Selection &selection,
353  const property::DatasetTransferList &dtpl =
355 
370  template<typename T>
371  void read(T &data,const dataspace::Selection &selection,
372  const property::DatasetTransferList &dtpl =
374 
385  template<typename T>
386  void read(T &data,
387  const datatype::Datatype &memory_type,
388  const dataspace::Dataspace &memory_space,
389  const dataspace::Selection &file_selection,
391 
401  filter::ExternalFilters filters() const;
402 
403  private:
410  static Node create_dataset(const Group &base,
411  const Path &path,
412  const datatype::Datatype &type,
413  const dataspace::Dataspace &space,
414  const property::LinkCreationList &lcpl,
415  const property::DatasetCreationList &dcpl,
416  const property::DatasetAccessList &dapl);
417 
418  //
419  // writing template methods for various data configurations
420  //
421  template<typename T>
422  void write_variable_length_data(const T &data,
423  const datatype::Datatype &mem_type,
424  const dataspace::Dataspace &mem_space,
425  const datatype::Datatype &,
426  const dataspace::Dataspace &file_space,
427  const property::DatasetTransferList &dtpl) const
428  {
429  VarLengthDataBuffer buffer;
431  if(H5Dwrite(static_cast<hid_t>(*this),
432  static_cast<hid_t>(mem_type),
433  static_cast<hid_t>(mem_space),
434  static_cast<hid_t>(file_space),
435  static_cast<hid_t>(dtpl),
436  buffer.data())<0)
437  {
438  std::stringstream ss;
439  ss<<"Failure to write variable length data to dataset ["<<link().path()<<"]!";
441  }
442  }
443 
444  template<typename T>
445  void write_contiguous_data(const T &data,
446  const datatype::Datatype &mem_type,
447  const dataspace::Dataspace &mem_space,
448  const datatype::Datatype &,
449  const dataspace::Dataspace &file_space,
450  const property::DatasetTransferList &dtpl) const
451  {
452  if(H5Dwrite(static_cast<hid_t>(*this),
453  static_cast<hid_t>(mem_type),
454  static_cast<hid_t>(mem_space),
455  static_cast<hid_t>(file_space),
456  static_cast<hid_t>(dtpl),
457  dataspace::cptr(data))<0)
458  {
459  std::stringstream ss;
460  ss<<"Failure to write contiguous data to dataset ["<<link().path()<<"]!";
462  }
463  }
464 
465  template<typename T>
466  void write_variable_length_string_data(const T &data,
467  const datatype::Datatype &mem_type,
468  const dataspace::Dataspace &mem_space,
469  const datatype::Datatype &,
470  const dataspace::Dataspace &file_space,
471  const property::DatasetTransferList &dtpl) const
472  {
473  using Trait = VarLengthStringTrait<T>;
474  auto buffer = Trait::to_buffer(data);
475 
476  if(H5Dwrite(static_cast<hid_t>(*this),
477  static_cast<hid_t>(mem_type),
478  static_cast<hid_t>(mem_space),
479  static_cast<hid_t>(file_space),
480  static_cast<hid_t>(dtpl),
481  reinterpret_cast<void*>(buffer.data()))<0)
482  {
483  std::stringstream ss;
484  ss<<"Failure to write variable length string data to dataset ["<<link().path()<<"]!";
486  }
487  }
488 
489  template<typename T>
490  void write_fixed_length_string_data(const T &data,
491  const datatype::Datatype &mem_type,
492  const dataspace::Dataspace &mem_space,
493  const datatype::Datatype &,
494  const dataspace::Dataspace &file_space,
495  const property::DatasetTransferList &dtpl) const
496  {
497  using Trait = FixedLengthStringTrait<T>;
498  auto buffer = Trait::to_buffer(data,mem_type,mem_space);
499 
500  if(H5Dwrite(static_cast<hid_t>(*this),
501  static_cast<hid_t>(mem_type),
502  static_cast<hid_t>(mem_space),
503  static_cast<hid_t>(file_space),
504  static_cast<hid_t>(dtpl),
505  reinterpret_cast<void*>(buffer.data()))<0)
506  {
507  std::stringstream ss;
508  ss<<"Failure to write fixed length string data to dataset ["<<link().path()<<"]!";
510  }
511 
512 
513  }
514 
515  //
516  // reading template methods for various data configurations
517  //
518  template<typename T>
519  void read_variable_length_data(T &data,
520  const datatype::Datatype &mem_type,
521  const dataspace::Dataspace &mem_space,
522  const datatype::Datatype &file_type,
523  const dataspace::Dataspace &file_space,
524  const property::DatasetTransferList &dtpl) const
525  {
526  VarLengthDataBuffer buffer;
527  if(file_space.selection.type() != dataspace::SelectionType::ALL)
528  {
529  buffer.resize(file_space.selection.size());
530  }
531  else
532  {
533  buffer.resize(file_space.size());
534  }
535 
536  if(H5Dread(static_cast<hid_t>(*this),
537  static_cast<hid_t>(mem_type),
538  static_cast<hid_t>(mem_space),
539  static_cast<hid_t>(file_space),
540  static_cast<hid_t>(dtpl),
541  buffer.data())<0)
542  {
543  std::stringstream ss;
544  ss<<"Failure to read variable length data from dataset ["<<link().path()<<"]!";
546  }
547 
549 
550  if(H5Dvlen_reclaim(static_cast<hid_t>(file_type),
551  static_cast<hid_t>(file_space),
552  static_cast<hid_t>(dtpl),
553  buffer.data())<0)
554  {
555  error::Singleton::instance().throw_with_stack("Error reclaiming variable length memory!");
556  }
557  }
558 
559  template<typename T>
560  void read_contiguous_data(T &data,
561  const datatype::Datatype &mem_type,
562  const dataspace::Dataspace &mem_space,
563  const datatype::Datatype &,
564  const dataspace::Dataspace &file_space,
565  const property::DatasetTransferList &dtpl) const
566  {
567  if(H5Dread(static_cast<hid_t>(*this),
568  static_cast<hid_t>(mem_type),
569  static_cast<hid_t>(mem_space),
570  static_cast<hid_t>(file_space),
571  static_cast<hid_t>(dtpl),
572  dataspace::ptr(data))<0)
573  {
574  std::stringstream ss;
575  ss<<"Failure to read contiguous data from dataset ["<<link().path()<<"]!";
577  }
578  }
579 
580  template<typename T>
581  void read_variable_length_string_data(T &data,
582  const datatype::Datatype &mem_type,
583  const dataspace::Dataspace &mem_space,
584  const datatype::Datatype &,
585  const dataspace::Dataspace &file_space,
586  const property::DatasetTransferList &dtpl) const
587  {
588  using Trait = VarLengthStringTrait<T>;
589 
590  typename Trait::BufferType buffer(mem_space.size());
591 
592 
593  if(H5Dread(static_cast<hid_t>(*this),
594  static_cast<hid_t>(mem_type),
595  static_cast<hid_t>(mem_space),
596  static_cast<hid_t>(file_space),
597  static_cast<hid_t>(dtpl),
598  buffer.data())<0)
599  {
600  std::stringstream ss;
601  ss<<"Failure to read variable length string data from dataset ["
602  <<link().path()<<"]!";
604  }
605 
606  Trait::from_buffer(buffer,data);
607 
608  if(buffer.size() > 0)
609  {
610  if(H5Dvlen_reclaim(static_cast<hid_t>(mem_type),
611  static_cast<hid_t>(mem_space),
612  static_cast<hid_t>(dtpl),
613  buffer.data())<0)
614  {
615  std::stringstream ss;
616  ss<<"Error reclaiming memory from variable length string data in "
617  <<"dataset ["<<link().path()<<"]!";
619  }
620  }
621  }
622 
623  template<typename T>
624  void read_fixed_length_string_data(T &data,
625  const datatype::Datatype &mem_type,
626  const dataspace::Dataspace &mem_space,
627  const datatype::Datatype &,
628  const dataspace::Dataspace &file_space,
629  const property::DatasetTransferList &dtpl) const
630  {
631  using Trait = FixedLengthStringTrait<T>;
632 
633  auto buffer = Trait::BufferType::create(mem_type,mem_space);
634 
635  if(file_space.size() > 0)
636  {
637  if(H5Dread(static_cast<hid_t>(*this),
638  static_cast<hid_t>(mem_type),
639  static_cast<hid_t>(mem_space),
640  static_cast<hid_t>(file_space),
641  static_cast<hid_t>(dtpl),
642  buffer.data())<0)
643  {
644  std::stringstream ss;
645  ss<<"Failure to read fixed length string data to dataset ["<<link().path()<<"]!";
647  }
648 
649  //get data out of the buffer
650  data = Trait::from_buffer(buffer,mem_type,mem_space);
651  }
652  }
653 };
654 
655 template<typename T>
656 void Dataset::write(const T &data,const datatype::Datatype &mem_type,
657  const dataspace::Dataspace &mem_space,
658  const dataspace::Dataspace &file_space,
659  const property::DatasetTransferList &dtpl) const
660 {
661  datatype::Datatype file_type = datatype();
662 
663  if(file_type.get_class() == datatype::Class::VARLENGTH)
664  {
665  write_variable_length_data(data,mem_type,mem_space,file_type,file_space,dtpl);
666  }
667  else if(file_type.get_class() == datatype::Class::STRING)
668  {
669  datatype::String string_type(file_type);
670  if(string_type.is_variable_length())
671  {
672  write_variable_length_string_data(data,mem_type,mem_space,file_type,file_space,dtpl);
673  }
674  else
675  {
676  write_fixed_length_string_data(data,mem_type,mem_space,file_type,file_space,dtpl);
677  }
678  }
679  else
680  {
681  write_contiguous_data(data,mem_type,mem_space,file_type,file_space,dtpl);
682  }
683 
684 }
685 
686 template<typename T>
687 void Dataset::write(const T &data,
688  const datatype::Datatype &mem_type,
689  const dataspace::Dataspace &mem_space,
690  const property::DatasetTransferList &dtpl) const
691 {
692  auto file_space = dataspace();
693  file_space.selection.all();
694 
695  write(data,mem_type,mem_space,file_space,dtpl);
696 
697 }
698 
699 template<typename T>
700 void Dataset::write_chunk(const T &data,
701  std::vector<unsigned long long> offset,
702  std::uint32_t filter_mask,
703  const property::DatasetTransferList &dtpl) const
704 {
705  auto memory_space = hdf5::dataspace::create(data);
706  auto memory_type = hdf5::datatype::create(data);
707  size_t databytesize = memory_space.size() * memory_type.size();
708 
709  if(memory_type.get_class() == datatype::Class::INTEGER)
710  {
711 #if H5_VERSION_GE(1,10,3)
712  if(H5Dwrite_chunk(static_cast<hid_t>(*this),
713  static_cast<hid_t>(dtpl),
714  filter_mask,
715  offset.data(),
716  databytesize,
717  dataspace::cptr(data))<0)
718  {
719  std::stringstream ss;
720  ss<<"Failure to write chunk data to dataset ["<<link().path()<<"]!";
722  }
723 #else
724  if(H5DOwrite_chunk(static_cast<hid_t>(*this),
725  static_cast<hid_t>(dtpl),
726  filter_mask,
727  offset.data(),
728  databytesize,
729  dataspace::cptr(data))<0)
730  {
731  std::stringstream ss;
732  ss<<"Failure to write chunk data to dataset ["<<link().path()<<"]!";
734  }
735 #endif
736  }
737  else
738  {
739  std::stringstream ss;
740  ss<<"Failure to write non-integer chunk data to dataset ["<<link().path()<<"]!";
742  }
743 }
744 
745 #if H5_VERSION_GE(1,10,2)
746 
747 template<typename T>
748 std::uint32_t Dataset::read_chunk(T &data,
749  std::vector<unsigned long long> offset,
750  const property::DatasetTransferList &dtpl) const
751 {
752  auto memory_type = hdf5::datatype::create(data);
753  std::uint32_t filter_mask;
754  if(memory_type.get_class() == datatype::Class::INTEGER)
755  {
756 #if H5_VERSION_GE(1,10,3)
757  if(H5Dread_chunk(static_cast<hid_t>(*this),
758  static_cast<hid_t>(dtpl),
759  offset.data(),
760  &filter_mask,
761  dataspace::ptr(data))<0)
762  {
763  std::stringstream ss;
764  ss<<"Failure to read chunk data from dataset ["<<link().path()<<"]!";
766  }
767 #else
768  if(H5DOread_chunk(static_cast<hid_t>(*this),
769  static_cast<hid_t>(dtpl),
770  offset.data(),
771  &filter_mask,
772  dataspace::ptr(data))<0)
773  {
774  std::stringstream ss;
775  ss<<"Failure to read chunk data from dataset ["<<link().path()<<"]!";
777  }
778 #endif
779  }
780  else
781  {
782  std::stringstream ss;
783  ss<<"Failure to read non-integer chunk data from dataset ["<<link().path()<<"]!";
785  }
786  return filter_mask;
787 }
788 
789 #endif
790 
791 template<typename T>
792 void Dataset::write(const T &data,const property::DatasetTransferList &dtpl) const
793 {
794  auto memory_space = hdf5::dataspace::create(data);
795  auto memory_type = hdf5::datatype::create(data);
796  auto file_space = dataspace();
797  file_space.selection.all();
798 
799  if (file_space.size() == memory_space.size() &&
800  memory_space.type() == dataspace::Type::SIMPLE &&
801  file_space.type() == dataspace::Type::SIMPLE){
802  const dataspace::Simple & mem_space = dataspace::Simple(memory_space);
803  const dataspace::Simple & fl_space = dataspace::Simple(file_space);
804  if(fl_space.rank() > 1 && mem_space.rank() == 1){
805  write(data,memory_type,file_space,file_space,dtpl);
806  return;
807  }
808  }
809  write(data,memory_type,memory_space,file_space,dtpl);
810 }
811 
812 
813 template<typename T>
814 void Dataset::read(T &data,const datatype::Datatype &mem_type,
815  const dataspace::Dataspace &mem_space,
816  const dataspace::Dataspace &file_space,
817  const property::DatasetTransferList &dtpl) const
818 {
819  datatype::Datatype file_type = datatype();
820  if(file_type.get_class() == datatype::Class::VARLENGTH)
821  {
822  read_variable_length_data(data,mem_type,mem_space,file_type,file_space,dtpl);
823  }
824  else if(file_type.get_class() == datatype::Class::STRING)
825  {
826  datatype::String string_type(file_type);
827  if(string_type.is_variable_length())
828  {
829  read_variable_length_string_data(data,mem_type,mem_space,file_type,file_space,dtpl);
830  }
831  else
832  {
833  read_fixed_length_string_data(data,mem_type,mem_space,file_type,file_space,dtpl);
834  }
835  }
836  else
837  {
838  read_contiguous_data(data,mem_type,mem_space,file_type,file_space,dtpl);
839  }
840 
841 }
842 
843 template<typename T>
844 void Dataset::read(T &data,const dataspace::Selection &selection,
845  const property::DatasetTransferList &dtpl) const
846 {
847  auto memory_space = hdf5::dataspace::create(data);
848  auto memory_type = hdf5::datatype::create(data);
849 
850  dataspace::Dataspace file_space = dataspace();
851  file_space.selection(dataspace::SelectionOperation::SET,selection);
852  try{
853  const dataspace::Hyperslab & hyper = dynamic_cast<const dataspace::Hyperslab &>(selection);
854  auto dims = hyper.block();
855  auto count = hyper.count();
856  for(Dimensions::size_type i = 0; i != dims.size(); i++)
857  dims[i] *= count[i];
858 
859  dataspace::Simple selected_space(dims);
860  if (selected_space.size() == memory_space.size())
861  read(data,memory_type,selected_space,file_space,dtpl);
862  else
863  read(data,memory_type,memory_space,file_space,dtpl);
864  }
865  catch(const std::bad_cast&){
866  read(data,memory_type,memory_space,file_space,dtpl);
867  }
868 }
869 
870 template<typename T>
871 void Dataset::read(T &data,
872  const datatype::Datatype &memory_type,
873  const dataspace::Dataspace &memory_space,
874  const dataspace::Selection &file_selection,
875  const property::DatasetTransferList &dtpl) const
876 {
877  dataspace::Dataspace file_space = dataspace();
878  file_space.selection(dataspace::SelectionOperation::SET,file_selection);
879  read(data,memory_type,memory_space,file_space,dtpl);
880 }
881 
882 template<typename T>
883 void Dataset::read(T &data,
884  const datatype::Datatype &memory_type,
885  const dataspace::Dataspace &memory_space,
886  const property::DatasetTransferList &dtpl) const
887 {
888  dataspace::Dataspace file_space = dataspace();
889  file_space.selection.all();
890  read(data,memory_type,memory_space,file_space,dtpl);
891 }
892 
893 template<typename T>
894 void Dataset::write(const T &data,const dataspace::Selection &selection,
895  const property::DatasetTransferList &dtpl) const
896 {
897  auto memory_space = hdf5::dataspace::create(data);
898  auto memory_type = hdf5::datatype::create(data);
899 
900  dataspace::Dataspace file_space = dataspace();
901  file_space.selection(dataspace::SelectionOperation::SET,selection);
902  if (memory_space.type() != dataspace::Type::SIMPLE) {
903  write(data,memory_type,memory_space,file_space,dtpl);
904  }
905  else{
906  try{
907 
908  const dataspace::Hyperslab & hyper = dynamic_cast<const dataspace::Hyperslab &>(selection);
909  const dataspace::Simple & mem_space = dataspace::Simple(memory_space);
910 
911  auto dims = hyper.block();
912  auto count = hyper.count();
913  for(Dimensions::size_type i = 0; i != dims.size(); i++)
914  dims[i] *= count[i];
915  dataspace::Simple selected_space(dims);
916  if(selected_space.rank() > 1 &&
917  mem_space.rank() == 1 &&
918  selected_space.size() == memory_space.size())
919  write(data,memory_type,selected_space,file_space,dtpl);
920  else
921  write(data,memory_type,memory_space,file_space,dtpl);
922 
923  }
924  catch(const std::bad_cast&){
925  write(data,memory_type,memory_space,file_space,dtpl);
926  }
927  }
928 }
929 
930 
931 template<typename T>
932 void Dataset::read(T &data,const property::DatasetTransferList &dtpl) const
933 {
934  auto memory_space = hdf5::dataspace::create(data);
935  auto memory_type = hdf5::datatype::create(data);
936  auto file_space = dataspace();
937  file_space.selection.all();
938 
939  if (file_space.size() == memory_space.size()){
940  read(data,memory_type,file_space,file_space,dtpl);
941  }
942  else{
943  read(data,memory_type,memory_space,file_space,dtpl);
944  }
945 
946 }
947 
948 
961 DLL_EXPORT void resize_by(const Dataset &dataset,size_t dimension_index,ssize_t delta);
962 
963 
964 
965 } // namespace node
966 } // namespace hdf5
TypeTrait< T >::DataspaceType create(const T &value)
factory function for dataspaces
Definition: type_trait.hpp:115
dataspace base class
Definition: dataspace.hpp:41
scalar dataspace
Definition: scalar.hpp:40
Definition: link_creation.hpp:35
static Singleton & instance()
reference to singleton
Definition: error.hpp:50
size_t rank() const
get number of dimensions
void throw_with_stack(const std::string &message)
throws an exception, potentially nested with error stack
string datatype
Definition: string.hpp:39
indicates an integer type
selection base class
Definition: selection.hpp:42
void all() const
select everything
void read(T &data, const datatype::Datatype &mem_type, const dataspace::Dataspace &mem_space, const dataspace::Dataspace &file_space, const property::DatasetTransferList &dtpl=property::DatasetTransferList()) const
read data from the dataset
Definition: dataset.hpp:814
void count(size_t index, size_t value)
set count value for a particular dimension
File from_buffer(T &data, ImageFlags flags=ImageFlags::READONLY)
load an image file from a buffer
Definition: functions.hpp:120
SelectionType type() const
get the type of the current selection
Definition: dataset.hpp:50
const void * cptr(const T &value)
Definition: type_trait.hpp:125
hyperslab selection class
Definition: hyperslab.hpp:51
Definition: group.hpp:46
void write(const T &data, const datatype::Datatype &mem_type, const dataspace::Dataspace &mem_space, const dataspace::Dataspace &file_space, const property::DatasetTransferList &dtpl=property::DatasetTransferList()) const
write data to the dataset
Definition: dataset.hpp:656
utility container for external filters
Definition: external_filter.hpp:116
bool is_variable_length() const
return true if type is a variable length string
dataset creation property list
Definition: dataset_creation.hpp:110
dataset access property list
Definition: dataset_access.hpp:73
std::vector< hvl_t > VarLengthDataBuffer
Definition: types.hpp:38
virtual hssize_t size() const
number of elements in the dataspace
Definition: attribute.hpp:43
void block(size_t index, size_t value)
set block size for dimension
simple multidimensional dataspace
Definition: simple.hpp:39
void link(const Node &target, const Group &link_base, const Path &link_path, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList())
Create a soft or external link.
size_t size() const
return the number of elements in the current selection
Definition: node.hpp:39
static void from_buffer(const VarLengthDataBuffer &, T &)
Definition: types.hpp:52
void resize_by(const Dataset &dataset, size_t dimension_index, ssize_t delta)
resize a dataset by a particular offset
TypeTrait< typename std::remove_const< T >::type >::TypeClass create(const T &v=T())
factory function for creating data types
Definition: factory.hpp:38
Definition: dataset_transfer.hpp:53
std::vector< hsize_t > Dimensions
Definition: types.hpp:36
void * ptr(T &value)
Definition: type_trait.hpp:120
path to a node object
Definition: path.hpp:49
#define DLL_EXPORT
Definition: windows.hpp:35
static void to_buffer(const T &, VarLengthDataBuffer &)
Definition: types.hpp:49
void write_chunk(const T &data, std::vector< unsigned long long > offset, std::uint32_t filter_mask=0, const property::DatasetTransferList &dtpl=property::DatasetTransferList()) const
write dataset chunk
Definition: dataset.hpp:700
SelectionManager selection
access to selection manager
Definition: dataspace.hpp:151
Class get_class() const
returns the datatypes class
indicates a string type
Definition: fixed_length_string.hpp:56
variable length string buffer trait
Definition: variable_length_string.hpp:53
base class for all data types
Definition: datatype.hpp:41
indicates a variable length type