#include <DefaultMerger.h>
|  | 
|  | DefaultMerger (hsize_t mergeAxis=0, int chunkSize=-1, bool requireSameFormat=true, std::size_t bufferSize=-1, bool bufferInRows=false) | 
|  | Create the merger.  More... 
 | 
|  | 
|  | ~DefaultMerger () | 
|  | 
| void | merge (H5::Group &target, const H5::Group &source) override | 
|  | Merge a source group into a target group.  More... 
 | 
|  | 
| void | merge (H5::DataSet &target, const H5::DataSet &source) override | 
|  | Merge a source dataset into a target dataset.  More... 
 | 
|  | 
| H5::DataSet | createFrom (H5::H5Location &targetLocation, const H5::DataSet &source) override | 
|  | Make a new dataset from information in a source dataset.  More... 
 | 
|  | 
| virtual void | merge (H5::H5File &target, const H5::H5File &source) | 
|  | Merge a source file into a target file.  More... 
 | 
|  | 
| virtual void | merge (H5::Group &target, const H5::Group &source)=0 | 
|  | Merge a source group into a target group.  More... 
 | 
|  | 
| virtual void | merge (H5::DataSet &target, const H5::DataSet &source)=0 | 
|  | Merge a source dataset into a target dataset.  More... 
 | 
|  | 
| virtual H5::Group | createFrom (H5::H5Location &targetLocation, const H5::Group &source) | 
|  | Make a new group from information in a source group.  More... 
 | 
|  | 
| virtual H5::DataSet | createFrom (H5::H5Location &targetLocation, const H5::DataSet &source)=0 | 
|  | Make a new dataset from information in a source dataset.  More... 
 | 
|  | 
| virtual void | merge (H5::H5File &target, const H5::H5File &source) | 
|  | Merge a source file into a target file.  More... 
 | 
|  | 
| virtual H5::Group | createFrom (H5::H5Location &targetLocation, const H5::Group &source) | 
|  | Make a new group from information in a source group.  More... 
 | 
|  | 
Definition at line 21 of file DefaultMerger.h.
 
◆ DefaultMerger()
      
        
          | H5Utils::DefaultMerger::DefaultMerger | ( | hsize_t | mergeAxis = 0, | 
        
          |  |  | int | chunkSize = -1, | 
        
          |  |  | bool | requireSameFormat = true, | 
        
          |  |  | std::size_t | bufferSize = -1, | 
        
          |  |  | bool | bufferInRows = false | 
        
          |  | ) |  |  | 
      
 
Create the merger. 
- Parameters
- 
  
    | mergeAxis | The axis to merge along |  | chunkSize | The chunk size to apply. If negative then the value found in the input datasets will be used. |  | requireSameFormat | Require all input files to have the same groups and datasets. |  | bufferSize | The maximum size of the buffer to use while merging datasets |  | bufferInRows | Whether the buffer size is specified in rows or bytes |  
 
Definition at line 12 of file DefaultMerger.cxx.
 
 
◆ ~DefaultMerger()
      
        
          | H5Utils::DefaultMerger::~DefaultMerger | ( |  | ) |  | 
      
 
 
◆ createFrom() [1/4]
  
  | 
        
          | H5::DataSet H5Utils::DefaultMerger::createFrom | ( | H5::H5Location & | targetLocation, |  
          |  |  | const H5::DataSet & | source |  
          |  | ) |  |  |  | overridevirtual | 
 
Make a new dataset from information in a source dataset. 
- Parameters
- 
  
    | targetLocation | Where the new dataset will be created |  | source | The dataset to use to create the new dataset |  
 
Implements H5Utils::IH5Merger.
Definition at line 113 of file DefaultMerger.cxx.
 
 
◆ createFrom() [2/4]
      
        
          | virtual H5::DataSet H5Utils::IH5Merger::createFrom | 
      
 
Make a new dataset from information in a source dataset. 
- Parameters
- 
  
    | targetLocation | Where the new dataset will be created |  | source | The dataset to use to create the new dataset |  
 
 
 
◆ createFrom() [3/4]
      
        
          | H5::Group H5Utils::IH5Merger::createFrom | 
      
 
Make a new group from information in a source group. 
- Parameters
- 
  
    | targetLocation | Where the new group will be created |  | source | The group to use to create the new group |  
 
The default implementation provided here just copies the source group's name then uses the merge function. 
Definition at line 61 of file IH5Merger.cxx.
 
 
◆ createFrom() [4/4]
  
  | 
        
          | H5::Group H5Utils::IH5Merger::createFrom | ( | H5::H5Location & | targetLocation, |  
          |  |  | const H5::Group & | source |  
          |  | ) |  |  |  | virtualinherited | 
 
Make a new group from information in a source group. 
- Parameters
- 
  
    | targetLocation | Where the new group will be created |  | source | The group to use to create the new group |  
 
The default implementation provided here just copies the source group's name then uses the merge function. 
Definition at line 18 of file IH5Merger.cxx.
 
 
◆ merge() [1/6]
  
  | 
        
          | void H5Utils::DefaultMerger::merge | ( | H5::DataSet & | target, |  
          |  |  | const H5::DataSet & | source |  
          |  | ) |  |  |  | overridevirtual | 
 
Merge a source dataset into a target dataset. 
- Parameters
- 
  
    | target | The dataset to merge into |  | source | The dataset to merge from |  
 
Implements H5Utils::IH5Merger.
Definition at line 98 of file DefaultMerger.cxx.
  107         std::overflow_error(
"Requested buffer would overflow the register!");
 
 
 
 
◆ merge() [2/6]
      
        
          | virtual void H5Utils::IH5Merger::merge | 
      
 
Merge a source dataset into a target dataset. 
- Parameters
- 
  
    | target | The dataset to merge into |  | source | The dataset to merge from |  
 
 
 
◆ merge() [3/6]
  
  | 
        
          | void H5Utils::DefaultMerger::merge | ( | H5::Group & | target, |  
          |  |  | const H5::Group & | source |  
          |  | ) |  |  |  | overridevirtual | 
 
Merge a source group into a target group. 
- Parameters
- 
  
    | target | The group to merge into |  | source | The group to merge from |  
 
Implements H5Utils::IH5Merger.
Definition at line 26 of file DefaultMerger.cxx.
   31     bool isEmpty = 
target.getNumObjs() == 0;
 
   34     for (hsize_t ii = 0; ii < 
source.getNumObjs(); ++ii) {
 
   35       H5G_obj_t childType = 
source.getObjTypeByIdx(ii);
 
   36       std::string childName = 
source.getObjnameByIdx(ii);
 
   38       hsize_t targetIdx = 0;
 
   39       for (; targetIdx < 
target.getNumObjs(); ++targetIdx) 
 
   40         if (
target.getObjnameByIdx(targetIdx) == childName)
 
   45         if (
target.getObjTypeByIdx(targetIdx) != childType)
 
   46           throw std::invalid_argument(
 
   47               "Both target and source contain " + childName +
 
   48               " but they have different types!");
 
   51         throw std::invalid_argument(
 
   52             "Target and source have different formats!");
 
   59               target.openGroup(childName) : 
 
   65               std::cerr << 
"Encountered an error merging child " << childName << std::endl;
 
   72             H5::DataSet 
sd = 
source.openDataSet(childName);
 
   73             if (
sd.getSpace().getSimpleExtentNdims() == 0) {
 
   74               std::cerr << 
"WARNING: skipping scalar '" 
   75                         << childName << 
"'" << std::endl;
 
   78             H5::DataSet td = 
found ? 
 
   79               target.openDataSet(childName) : 
 
   85               std::cerr << 
"Encountered an error merging child " << childName << std::endl;
 
 
 
 
◆ merge() [4/6]
      
        
          | virtual void H5Utils::IH5Merger::merge | 
      
 
Merge a source group into a target group. 
- Parameters
- 
  
    | target | The group to merge into |  | source | The group to merge from |  
 
 
 
◆ merge() [5/6]
  
  | 
        
          | void H5Utils::IH5Merger::merge | ( | H5::H5File & | target, |  
          |  |  | const H5::H5File & | source |  
          |  | ) |  |  |  | virtualinherited | 
 
Merge a source file into a target file. 
- Parameters
- 
  
    | target | The file to merge into |  | source | The file to merge from |  
 
The default implementation provided here just forwards this to the group function. 
Definition at line 11 of file IH5Merger.cxx.
 
 
◆ merge() [6/6]
      
        
          | void H5Utils::IH5Merger::merge | 
      
 
Merge a source file into a target file. 
- Parameters
- 
  
    | target | The file to merge into |  | source | The file to merge from |  
 
The default implementation provided here just forwards this to the group function. 
Definition at line 37 of file IH5Merger.cxx.
 
 
◆ m_bufferSize
  
  | 
        
          | std::size_t H5Utils::DefaultMerger::m_bufferSize |  | protected | 
 
 
◆ m_chunkSize
  
  | 
        
          | int H5Utils::DefaultMerger::m_chunkSize |  | protected | 
 
 
◆ m_measureBufferInRows
  
  | 
        
          | bool H5Utils::DefaultMerger::m_measureBufferInRows |  | protected | 
 
Whether to measure the buffer in bytes or rows. 
Definition at line 81 of file DefaultMerger.h.
 
 
◆ m_mergeAxis
  
  | 
        
          | hsize_t H5Utils::DefaultMerger::m_mergeAxis |  | protected | 
 
 
◆ m_requireSameFormat
  
  | 
        
          | bool H5Utils::DefaultMerger::m_requireSameFormat |  | protected | 
 
Whether to require the same group structure. 
Definition at line 77 of file DefaultMerger.h.
 
 
The documentation for this class was generated from the following files:
 
H5::DataSet createDataSet(H5::H5Location &targetLocation, const H5::DataSet &source, hsize_t mergeAxis, int chunkSize=-1, int mergeExtent=-1)
Make a new dataset using the properties of another.