h5cpp  0.3.3
A modern C++ wrapper for the HDF5 C library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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>
42 #include <h5cpp/error/error.hpp>
43 
44 namespace hdf5 {
45 namespace node {
46 
47 class Selection;
48 
49 class DLL_EXPORT Dataset : public Node
50 {
51  public:
60  Dataset() = default;
61 
67  Dataset(const Dataset &) = default;
68 
78  Dataset(const Node &node);
79 
91  Dataset(const Group &base,const Path &path,
92  const datatype::Datatype &type,
93  const dataspace::Dataspace &space = dataspace::Scalar(),
97 
106  dataspace::Dataspace dataspace() const;
107 
117  property::DatasetCreationList creation_list() const;
118 
128  property::DatasetAccessList access_list() const;
129 
139  datatype::Datatype datatype() const;
140 
155  void extent(const Dimensions &dims) const;
156 
157 
158 
159  void extent(size_t dim,ssize_t delta_elements) const;
160 
161 
175  void resize(const Dimensions &dims) const;
176 
177 
178 
179 #if H5_VERSION_GE(1,10,0)
180  void refresh() const;
181 #endif
182 
183 
201  template<typename T>
202  void write(const T &data,const datatype::Datatype &mem_type,
203  const dataspace::Dataspace &mem_space,
204  const dataspace::Dataspace &file_space,
205  const property::DatasetTransferList &dtpl =
207 
214  template<typename T>
215  void write(const T &data,const datatype::Datatype &mem_type,
216  const dataspace::Dataspace &mem_space,
217  const property::DatasetTransferList &dtpl =
219 
237  template<typename T>
238  void read(T &data,const datatype::Datatype &mem_type,
239  const dataspace::Dataspace &mem_space,
240  const dataspace::Dataspace &file_space,
241  const property::DatasetTransferList &dtpl =
243 
244  template<typename T>
245  void read(T &data,
246  const datatype::Datatype &mem_type,
247  const dataspace::Dataspace &mem_space,
248  const property::DatasetTransferList &dtpl =
250 
251 
262  template<typename T>
263  void write(const T &data,const property::DatasetTransferList &dtpl =
265 
266  void write(const char *data,const property::DatasetTransferList &dtpl =
268 
281  template<typename T>
282  void write_chunk(const T &data,
283  std::vector<long long unsigned int> offset,
284  std::uint32_t filter_mask = 0,
285  const property::DatasetTransferList &dtpl =
287 
288 #if H5_VERSION_GE(1,10,2)
289 
302  template<typename T>
303  std::uint32_t read_chunk(T &data,
304  std::vector<long long unsigned int> offset,
305  const property::DatasetTransferList &dtpl =
307 
308 
320  long long unsigned int chunk_storage_size( std::vector<long long unsigned int> offset) const;
321 
322 #endif
323 
334  template<typename T>
335  void read(T &data,const property::DatasetTransferList &dtpl =
337 
349  template<typename T>
350  void write(const T &data,const dataspace::Selection &selection,
351  const property::DatasetTransferList &dtpl =
353 
368  template<typename T>
369  void read(T &data,const dataspace::Selection &selection,
370  const property::DatasetTransferList &dtpl =
372 
383  template<typename T>
384  void read(T &data,
385  const datatype::Datatype &memory_type,
386  const dataspace::Dataspace &memory_space,
387  const dataspace::Selection &file_selection,
389 
390 
391  private:
398  static Node create_dataset(const Group &base,
399  const Path &path,
400  const datatype::Datatype &type,
401  const dataspace::Dataspace &space,
402  const property::LinkCreationList &lcpl,
403  const property::DatasetCreationList &dcpl,
404  const property::DatasetAccessList &dapl);
405 
406  //
407  // writing template methods for various data configurations
408  //
409  template<typename T>
410  void write_variable_length_data(const T &data,
411  const datatype::Datatype &mem_type,
412  const dataspace::Dataspace &mem_space,
413  const datatype::Datatype &,
414  const dataspace::Dataspace &file_space,
415  const property::DatasetTransferList &dtpl) const
416  {
417  VarLengthDataBuffer buffer;
419  if(H5Dwrite(static_cast<hid_t>(*this),
420  static_cast<hid_t>(mem_type),
421  static_cast<hid_t>(mem_space),
422  static_cast<hid_t>(file_space),
423  static_cast<hid_t>(dtpl),
424  buffer.data())<0)
425  {
426  std::stringstream ss;
427  ss<<"Failure to write variable length data to dataset ["<<link().path()<<"]!";
429  }
430  }
431 
432  template<typename T>
433  void write_contiguous_data(const T &data,
434  const datatype::Datatype &mem_type,
435  const dataspace::Dataspace &mem_space,
436  const datatype::Datatype &,
437  const dataspace::Dataspace &file_space,
438  const property::DatasetTransferList &dtpl) const
439  {
440  if(H5Dwrite(static_cast<hid_t>(*this),
441  static_cast<hid_t>(mem_type),
442  static_cast<hid_t>(mem_space),
443  static_cast<hid_t>(file_space),
444  static_cast<hid_t>(dtpl),
445  dataspace::cptr(data))<0)
446  {
447  std::stringstream ss;
448  ss<<"Failure to write contiguous data to dataset ["<<link().path()<<"]!";
450  }
451  }
452 
453  template<typename T>
454  void write_variable_length_string_data(const T &data,
455  const datatype::Datatype &mem_type,
456  const dataspace::Dataspace &mem_space,
457  const datatype::Datatype &,
458  const dataspace::Dataspace &file_space,
459  const property::DatasetTransferList &dtpl) const
460  {
461  using Trait = VarLengthStringTrait<T>;
462  auto buffer = Trait::to_buffer(data);
463 
464  if(H5Dwrite(static_cast<hid_t>(*this),
465  static_cast<hid_t>(mem_type),
466  static_cast<hid_t>(mem_space),
467  static_cast<hid_t>(file_space),
468  static_cast<hid_t>(dtpl),
469  reinterpret_cast<void*>(buffer.data()))<0)
470  {
471  std::stringstream ss;
472  ss<<"Failure to write variable length string data to dataset ["<<link().path()<<"]!";
474  }
475  }
476 
477  template<typename T>
478  void write_fixed_length_string_data(const T &data,
479  const datatype::Datatype &mem_type,
480  const dataspace::Dataspace &mem_space,
481  const datatype::Datatype &,
482  const dataspace::Dataspace &file_space,
483  const property::DatasetTransferList &dtpl) const
484  {
485  using Trait = FixedLengthStringTrait<T>;
486  auto buffer = Trait::to_buffer(data,mem_type,mem_space);
487 
488  if(H5Dwrite(static_cast<hid_t>(*this),
489  static_cast<hid_t>(mem_type),
490  static_cast<hid_t>(mem_space),
491  static_cast<hid_t>(file_space),
492  static_cast<hid_t>(dtpl),
493  reinterpret_cast<void*>(buffer.data()))<0)
494  {
495  std::stringstream ss;
496  ss<<"Failure to write fixed length string data to dataset ["<<link().path()<<"]!";
498  }
499 
500 
501  }
502 
503  //
504  // reading template methods for various data configurations
505  //
506  template<typename T>
507  void read_variable_length_data(T &data,
508  const datatype::Datatype &mem_type,
509  const dataspace::Dataspace &mem_space,
510  const datatype::Datatype &file_type,
511  const dataspace::Dataspace &file_space,
512  const property::DatasetTransferList &dtpl) const
513  {
514  VarLengthDataBuffer buffer;
515  if(file_space.selection.type() != dataspace::SelectionType::ALL)
516  {
517  buffer.resize(file_space.selection.size());
518  }
519  else
520  {
521  buffer.resize(file_space.size());
522  }
523 
524  if(H5Dread(static_cast<hid_t>(*this),
525  static_cast<hid_t>(mem_type),
526  static_cast<hid_t>(mem_space),
527  static_cast<hid_t>(file_space),
528  static_cast<hid_t>(dtpl),
529  buffer.data())<0)
530  {
531  std::stringstream ss;
532  ss<<"Failure to read variable length data from dataset ["<<link().path()<<"]!";
534  }
535 
537 
538  if(H5Dvlen_reclaim(static_cast<hid_t>(file_type),
539  static_cast<hid_t>(file_space),
540  static_cast<hid_t>(dtpl),
541  buffer.data())<0)
542  {
543  error::Singleton::instance().throw_with_stack("Error reclaiming variable length memory!");
544  }
545  }
546 
547  template<typename T>
548  void read_contiguous_data(T &data,
549  const datatype::Datatype &mem_type,
550  const dataspace::Dataspace &mem_space,
551  const datatype::Datatype &,
552  const dataspace::Dataspace &file_space,
553  const property::DatasetTransferList &dtpl) const
554  {
555  if(H5Dread(static_cast<hid_t>(*this),
556  static_cast<hid_t>(mem_type),
557  static_cast<hid_t>(mem_space),
558  static_cast<hid_t>(file_space),
559  static_cast<hid_t>(dtpl),
560  dataspace::ptr(data))<0)
561  {
562  std::stringstream ss;
563  ss<<"Failure to read contiguous data from dataset ["<<link().path()<<"]!";
565  }
566  }
567 
568  template<typename T>
569  void read_variable_length_string_data(T &data,
570  const datatype::Datatype &mem_type,
571  const dataspace::Dataspace &mem_space,
572  const datatype::Datatype &,
573  const dataspace::Dataspace &file_space,
574  const property::DatasetTransferList &dtpl) const
575  {
576  using Trait = VarLengthStringTrait<T>;
577 
578  typename Trait::BufferType buffer(mem_space.size());
579 
580 
581  if(H5Dread(static_cast<hid_t>(*this),
582  static_cast<hid_t>(mem_type),
583  static_cast<hid_t>(mem_space),
584  static_cast<hid_t>(file_space),
585  static_cast<hid_t>(dtpl),
586  buffer.data())<0)
587  {
588  std::stringstream ss;
589  ss<<"Failure to read variable length string data from dataset ["
590  <<link().path()<<"]!";
592  }
593 
594  Trait::from_buffer(buffer,data);
595 
596  if(buffer.size() > 0)
597  {
598  if(H5Dvlen_reclaim(static_cast<hid_t>(mem_type),
599  static_cast<hid_t>(mem_space),
600  static_cast<hid_t>(dtpl),
601  buffer.data())<0)
602  {
603  std::stringstream ss;
604  ss<<"Error reclaiming memory from variable length string data in "
605  <<"dataset ["<<link().path()<<"]!";
607  }
608  }
609  }
610 
611  template<typename T>
612  void read_fixed_length_string_data(T &data,
613  const datatype::Datatype &mem_type,
614  const dataspace::Dataspace &mem_space,
615  const datatype::Datatype &,
616  const dataspace::Dataspace &file_space,
617  const property::DatasetTransferList &dtpl) const
618  {
619  using Trait = FixedLengthStringTrait<T>;
620 
621  auto buffer = Trait::BufferType::create(mem_type,mem_space);
622 
623  if(file_space.size() > 0)
624  {
625  if(H5Dread(static_cast<hid_t>(*this),
626  static_cast<hid_t>(mem_type),
627  static_cast<hid_t>(mem_space),
628  static_cast<hid_t>(file_space),
629  static_cast<hid_t>(dtpl),
630  buffer.data())<0)
631  {
632  std::stringstream ss;
633  ss<<"Failure to read fixed length string data to dataset ["<<link().path()<<"]!";
635  }
636 
637  //get data out of the buffer
638  data = Trait::from_buffer(buffer,mem_type,mem_space);
639  }
640  }
641 };
642 
643 template<typename T>
644 void Dataset::write(const T &data,const datatype::Datatype &mem_type,
645  const dataspace::Dataspace &mem_space,
646  const dataspace::Dataspace &file_space,
647  const property::DatasetTransferList &dtpl) const
648 {
649  datatype::Datatype file_type = datatype();
650 
651  if(file_type.get_class() == datatype::Class::VARLENGTH)
652  {
653  write_variable_length_data(data,mem_type,mem_space,file_type,file_space,dtpl);
654  }
655  else if(file_type.get_class() == datatype::Class::STRING)
656  {
657  datatype::String string_type(file_type);
658  if(string_type.is_variable_length())
659  {
660  write_variable_length_string_data(data,mem_type,mem_space,file_type,file_space,dtpl);
661  }
662  else
663  {
664  write_fixed_length_string_data(data,mem_type,mem_space,file_type,file_space,dtpl);
665  }
666  }
667  else
668  {
669  write_contiguous_data(data,mem_type,mem_space,file_type,file_space,dtpl);
670  }
671 
672 }
673 
674 template<typename T>
675 void Dataset::write(const T &data,
676  const datatype::Datatype &mem_type,
677  const dataspace::Dataspace &mem_space,
678  const property::DatasetTransferList &dtpl) const
679 {
680  auto file_space = dataspace();
681  file_space.selection.all();
682 
683  write(data,mem_type,mem_space,file_space,dtpl);
684 
685 }
686 
687 template<typename T>
688 void Dataset::write_chunk(const T &data,
689  std::vector<long long unsigned int> offset,
690  std::uint32_t filter_mask,
691  const property::DatasetTransferList &dtpl) const
692 {
693  auto memory_space = hdf5::dataspace::create(data);
694  auto memory_type = hdf5::datatype::create(data);
695  size_t databytesize = memory_space.size() * memory_type.size();
696 
697  if(memory_type.get_class() == datatype::Class::INTEGER)
698  {
699 #if H5_VERSION_GE(1,10,3)
700  if(H5Dwrite_chunk(static_cast<hid_t>(*this),
701  static_cast<hid_t>(dtpl),
702  filter_mask,
703  offset.data(),
704  databytesize,
705  dataspace::cptr(data))<0)
706  {
707  std::stringstream ss;
708  ss<<"Failure to write chunk data to dataset ["<<link().path()<<"]!";
710  }
711 #else
712  if(H5DOwrite_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 #endif
724  }
725  else
726  {
727  std::stringstream ss;
728  ss<<"Failure to write non-integer chunk data to dataset ["<<link().path()<<"]!";
730  }
731 }
732 
733 #if H5_VERSION_GE(1,10,2)
734 
735 template<typename T>
736 std::uint32_t Dataset::read_chunk(T &data,
737  std::vector<long long unsigned int> offset,
738  const property::DatasetTransferList &dtpl) const
739 {
740  auto memory_type = hdf5::datatype::create(data);
741  std::uint32_t filter_mask;
742  if(memory_type.get_class() == datatype::Class::INTEGER)
743  {
744 #if H5_VERSION_GE(1,10,3)
745  if(H5Dread_chunk(static_cast<hid_t>(*this),
746  static_cast<hid_t>(dtpl),
747  offset.data(),
748  &filter_mask,
749  dataspace::ptr(data))<0)
750  {
751  std::stringstream ss;
752  ss<<"Failure to read chunk data from dataset ["<<link().path()<<"]!";
754  }
755 #else
756  if(H5DOread_chunk(static_cast<hid_t>(*this),
757  static_cast<hid_t>(dtpl),
758  offset.data(),
759  &filter_mask,
760  dataspace::ptr(data))<0)
761  {
762  std::stringstream ss;
763  ss<<"Failure to read chunk data from dataset ["<<link().path()<<"]!";
765  }
766 #endif
767  }
768  else
769  {
770  std::stringstream ss;
771  ss<<"Failure to read non-integer chunk data from dataset ["<<link().path()<<"]!";
773  }
774  return filter_mask;
775 }
776 
777 #endif
778 
779 template<typename T>
780 void Dataset::write(const T &data,const property::DatasetTransferList &dtpl) const
781 {
782  auto memory_space = hdf5::dataspace::create(data);
783  auto memory_type = hdf5::datatype::create(data);
784  auto file_space = dataspace();
785  file_space.selection.all();
786 
787  if (file_space.size() == memory_space.size() &&
788  memory_space.type() == dataspace::Type::SIMPLE &&
789  file_space.type() == dataspace::Type::SIMPLE){
790  const dataspace::Simple & mem_space = dataspace::Simple(memory_space);
791  const dataspace::Simple & fl_space = dataspace::Simple(file_space);
792  if(fl_space.rank() > 1 && mem_space.rank() == 1){
793  write(data,memory_type,file_space,file_space,dtpl);
794  return;
795  }
796  }
797  write(data,memory_type,memory_space,file_space,dtpl);
798 }
799 
800 
801 template<typename T>
802 void Dataset::read(T &data,const datatype::Datatype &mem_type,
803  const dataspace::Dataspace &mem_space,
804  const dataspace::Dataspace &file_space,
805  const property::DatasetTransferList &dtpl) const
806 {
807  datatype::Datatype file_type = datatype();
808  if(file_type.get_class() == datatype::Class::VARLENGTH)
809  {
810  read_variable_length_data(data,mem_type,mem_space,file_type,file_space,dtpl);
811  }
812  else if(file_type.get_class() == datatype::Class::STRING)
813  {
814  datatype::String string_type(file_type);
815  if(string_type.is_variable_length())
816  {
817  read_variable_length_string_data(data,mem_type,mem_space,file_type,file_space,dtpl);
818  }
819  else
820  {
821  read_fixed_length_string_data(data,mem_type,mem_space,file_type,file_space,dtpl);
822  }
823  }
824  else
825  {
826  read_contiguous_data(data,mem_type,mem_space,file_type,file_space,dtpl);
827  }
828 
829 }
830 
831 template<typename T>
832 void Dataset::read(T &data,const dataspace::Selection &selection,
833  const property::DatasetTransferList &dtpl) const
834 {
835  auto memory_space = hdf5::dataspace::create(data);
836  auto memory_type = hdf5::datatype::create(data);
837 
838  dataspace::Dataspace file_space = dataspace();
839  file_space.selection(dataspace::SelectionOperation::SET,selection);
840  try{
841  const dataspace::Hyperslab & hyper = dynamic_cast<const dataspace::Hyperslab &>(selection);
842  auto dims = hyper.block();
843  auto count = hyper.count();
844  for(Dimensions::size_type i = 0; i != dims.size(); i++)
845  dims[i] *= count[i];
846 
847  dataspace::Simple selected_space(dims);
848  if (selected_space.size() == memory_space.size())
849  read(data,memory_type,selected_space,file_space,dtpl);
850  else
851  read(data,memory_type,memory_space,file_space,dtpl);
852  }
853  catch(const std::bad_cast&){
854  read(data,memory_type,memory_space,file_space,dtpl);
855  }
856 }
857 
858 template<typename T>
859 void Dataset::read(T &data,
860  const datatype::Datatype &memory_type,
861  const dataspace::Dataspace &memory_space,
862  const dataspace::Selection &file_selection,
863  const property::DatasetTransferList &dtpl) const
864 {
865  dataspace::Dataspace file_space = dataspace();
866  file_space.selection(dataspace::SelectionOperation::SET,file_selection);
867  read(data,memory_type,memory_space,file_space,dtpl);
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 property::DatasetTransferList &dtpl) const
875 {
876  dataspace::Dataspace file_space = dataspace();
877  file_space.selection.all();
878  read(data,memory_type,memory_space,file_space,dtpl);
879 }
880 
881 template<typename T>
882 void Dataset::write(const T &data,const dataspace::Selection &selection,
883  const property::DatasetTransferList &dtpl) const
884 {
885  auto memory_space = hdf5::dataspace::create(data);
886  auto memory_type = hdf5::datatype::create(data);
887 
888  dataspace::Dataspace file_space = dataspace();
889  file_space.selection(dataspace::SelectionOperation::SET,selection);
890  if (memory_space.type() != dataspace::Type::SIMPLE) {
891  write(data,memory_type,memory_space,file_space,dtpl);
892  }
893  else{
894  try{
895 
896  const dataspace::Hyperslab & hyper = dynamic_cast<const dataspace::Hyperslab &>(selection);
897  const dataspace::Simple & mem_space = dataspace::Simple(memory_space);
898 
899  auto dims = hyper.block();
900  auto count = hyper.count();
901  for(Dimensions::size_type i = 0; i != dims.size(); i++)
902  dims[i] *= count[i];
903  dataspace::Simple selected_space(dims);
904  if(selected_space.rank() > 1 &&
905  mem_space.rank() == 1 &&
906  selected_space.size() == memory_space.size())
907  write(data,memory_type,selected_space,file_space,dtpl);
908  else
909  write(data,memory_type,memory_space,file_space,dtpl);
910 
911  }
912  catch(const std::bad_cast&){
913  write(data,memory_type,memory_space,file_space,dtpl);
914  }
915  }
916 }
917 
918 
919 template<typename T>
920 void Dataset::read(T &data,const property::DatasetTransferList &dtpl) const
921 {
922  auto memory_space = hdf5::dataspace::create(data);
923  auto memory_type = hdf5::datatype::create(data);
924  auto file_space = dataspace();
925  file_space.selection.all();
926 
927  if (file_space.size() == memory_space.size()){
928  read(data,memory_type,file_space,file_space,dtpl);
929  }
930  else{
931  read(data,memory_type,memory_space,file_space,dtpl);
932  }
933 
934 }
935 
936 
949 DLL_EXPORT void resize_by(const Dataset &dataset,size_t dimension_index,ssize_t delta);
950 
951 
952 
953 } // namespace node
954 } // 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:802
void count(size_t index, size_t value)
set count value for a particular dimension
SelectionType type() const
get the type of the current selection
Definition: dataset.hpp:49
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:644
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
void write_chunk(const T &data, std::vector< long long unsigned int > offset, std::uint32_t filter_mask=0, const property::DatasetTransferList &dtpl=property::DatasetTransferList()) const
write dataset chunk
Definition: dataset.hpp:688
DLL_EXPORT 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.
simple multidimensional dataspace
Definition: simple.hpp:39
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
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
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
DLL_EXPORT void resize_by(const Dataset &dataset, size_t dimension_index, ssize_t delta)
resize a dataset by a particular offset
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