Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Kernel::NexusHDF5Descriptor Class Reference

#include <NexusHDF5Descriptor.h>

Public Member Functions

const std::map< std::string, std::set< std::string > > & getAllEntries () const noexcept
 Returns a const reference of the internal map holding all entries in the NeXus HDF5 file. More...
 
std::string getFilename () const noexcept
 Returns a copy of the current file name. More...
 
bool isEntry (const std::string &entryName) const noexcept
 Checks if a full-path entry exists in a Nexus dataset. More...
 
bool isEntry (const std::string &entryName, const std::string &groupClass) const noexcept
 Checks if a full-path entry exists for a particular groupClass in a Nexus dataset. More...
 
 NexusHDF5Descriptor ()=delete
 
 NexusHDF5Descriptor (std::string filename)
 Unique constructor. More...
 
 ~NexusHDF5Descriptor ()=default
 Using RAII components, no need to deallocate explicitly. More...
 

Static Public Member Functions

static bool isReadable (const std::string &filename)
 Returns true if the file is considered to store data in a hierarchy. More...
 

Private Member Functions

std::map< std::string, std::set< std::string > > initAllEntries ()
 Sets m_allEntries, called in HDF5 constructor. More...
 

Private Attributes

const std::map< std::string, std::set< std::string > > m_allEntries
 All entries metadata. More...
 
std::string m_filename
 NeXus HDF5 file name. More...
 

Detailed Description

Definition at line 18 of file NexusHDF5Descriptor.h.

Constructor & Destructor Documentation

◆ NexusHDF5Descriptor() [1/2]

Mantid::Kernel::NexusHDF5Descriptor::NexusHDF5Descriptor ( std::string  filename)

Unique constructor.

Parameters
filenameinput HDF5 Nexus file name

Definition at line 173 of file NexusHDF5Descriptor.cpp.

◆ NexusHDF5Descriptor() [2/2]

Mantid::Kernel::NexusHDF5Descriptor::NexusHDF5Descriptor ( )
delete

◆ ~NexusHDF5Descriptor()

Mantid::Kernel::NexusHDF5Descriptor::~NexusHDF5Descriptor ( )
default

Using RAII components, no need to deallocate explicitly.

Member Function Documentation

◆ getAllEntries()

const std::map< std::string, std::set< std::string > > & Mantid::Kernel::NexusHDF5Descriptor::getAllEntries ( ) const
noexcept

Returns a const reference of the internal map holding all entries in the NeXus HDF5 file.

Returns
map holding all entries by group class
  key: group_class (e.g. NXentry, NXlog)
  value: set with absolute entry names for the group_class key
         (e.g. /entry/log)

Definition at line 179 of file NexusHDF5Descriptor.cpp.

References m_allEntries.

Referenced by Mantid::DataHandling::LoadEventNexus::confidence(), Mantid::DataHandling::LoadMcStasNexus::confidence(), Mantid::MDAlgorithms::LoadMD::confidence(), Mantid::DataObjects::MDBoxFlatTree::loadExperimentInfos(), Mantid::API::LogManager::loadNexus(), Mantid::API::Run::loadNexus(), and Mantid::DataHandling::LoadEventNexus::runLoadInstrument().

◆ getFilename()

std::string Mantid::Kernel::NexusHDF5Descriptor::getFilename ( ) const
noexcept

Returns a copy of the current file name.

Returns

Definition at line 177 of file NexusHDF5Descriptor.cpp.

References m_filename.

Referenced by Mantid::DataHandling::LoadMuonNexusV2::confidence().

◆ initAllEntries()

std::map< std::string, std::set< std::string > > Mantid::Kernel::NexusHDF5Descriptor::initAllEntries ( )
private

Sets m_allEntries, called in HDF5 constructor.

m_filename must be set

Definition at line 184 of file NexusHDF5Descriptor.cpp.

References m_filename, and std::to_string().

◆ isEntry() [1/2]

bool Mantid::Kernel::NexusHDF5Descriptor::isEntry ( const std::string &  entryName) const
noexcept

Checks if a full-path entry exists in a Nexus dataset.

Parameters
entryNamefull path for an entry name /entry/NXlogs
Returns
true: entryName exists, otherwise false

Definition at line 222 of file NexusHDF5Descriptor.cpp.

◆ isEntry() [2/2]

bool Mantid::Kernel::NexusHDF5Descriptor::isEntry ( const std::string &  entryName,
const std::string &  groupClass 
) const
noexcept

Checks if a full-path entry exists for a particular groupClass in a Nexus dataset.

Parameters
groupClasse.g. NxLog , Nexus entry attribute
entryNamefull path for an entry name /entry/NXlogs
Returns
true: entryName exists for a groupClass, otherwise false

Definition at line 208 of file NexusHDF5Descriptor.cpp.

Referenced by Mantid::DataHandling::LoadEventNexus::confidence(), Mantid::DataHandling::LoadMuonNexusV2::confidence(), Mantid::MDAlgorithms::LoadMD::confidence(), Mantid::DataHandling::LoadEventNexus::loadEntryMetadata(), Mantid::Kernel::PropertyNexus::loadProperty(), and Mantid::DataHandling::numEvents().

◆ isReadable()

bool Mantid::Kernel::NexusHDF5Descriptor::isReadable ( const std::string &  filename)
static

Returns true if the file is considered to store data in a hierarchy.

Definition at line 168 of file NexusHDF5Descriptor.cpp.

References Mantid::Kernel::NexusDescriptor::isReadable(), and Mantid::Kernel::NexusDescriptor::Version5.

Referenced by Mantid::API::FileLoaderRegistryImpl::canLoad(), and Mantid::API::FileLoaderRegistryImpl::chooseLoader().

Member Data Documentation

◆ m_allEntries

const std::map<std::string, std::set<std::string> > Mantid::Kernel::NexusHDF5Descriptor::m_allEntries
private

All entries metadata.

  key: group_class (e.g. NXentry, NXlog)
  value: set with absolute entry names for the group_class key
         (e.g. /entry/log)

Definition at line 89 of file NexusHDF5Descriptor.h.

Referenced by getAllEntries().

◆ m_filename

std::string Mantid::Kernel::NexusHDF5Descriptor::m_filename
private

NeXus HDF5 file name.

Definition at line 79 of file NexusHDF5Descriptor.h.

Referenced by getFilename(), and initAllEntries().


The documentation for this class was generated from the following files: