Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Nexus::NXRoot Class Reference

Implements NXroot Nexus class. More...

#include <NexusClasses.h>

Inheritance diagram for Mantid::Nexus::NXRoot:
Mantid::Nexus::NXClass Mantid::Nexus::NXObject

Public Member Functions

bool isStandard () const
 True if complies with our understanding of the www.nexusformat.org definition.
 
std::string NX_class () const override
 Return the NX class for a class (HDF group) or "SDS" for a data set;.
 
 NXRoot (std::string fname)
 Constructor.
 
 NXRoot (std::string fname, const std::string &entry)
 Constructor.
 
NXEntry openEntry (const std::string &name)
 Opens an entry – a topmost Nexus class.
 
NXEntry openFirstEntry ()
 Open the first NXentry in the file.
 
 ~NXRoot () override
 Destructor.
 
- Public Member Functions inherited from Mantid::Nexus::NXClass
void close ()
 Close this class.
 
bool containsDataSet (const std::string &query) const
 Returns whether an individual dataset is present.
 
bool containsGroup (const std::string &query) const
 Returns whether an individual group (or group) is present.
 
std::vector< NXInfo > & datasets () const
 Returns a list of all datasets in this NXClass.
 
NXInfo getDataSetInfo (const std::string &name) const
 Returns NXInfo for a dataset.
 
double getDouble (const std::string &name) const
 Returns a double.
 
float getFloat (const std::string &name) const
 Returns a float.
 
int32_t getInt (const std::string &name) const
 Returns a int.
 
std::string getString (const std::string &name) const
 Returns a string.
 
std::vector< NXClassInfo > & groups () const
 Returns a list of all classes (or groups) in this NXClass.
 
bool isValid (const std::string &address) const
 Check if a address exists relative to the current class address.
 
 NXClass (NXClass const &parent, std::string const &name)
 Constructor.
 
void open ()
 Opens this NXClass using File::openGroupAddress(). Can be slow (or is slow)
 
bool openLocal (const std::string &nxclass="")
 Opens this NXClass using File::openGroup().
 
NXChar openNXChar (const std::string &name) const
 Creates and opens a char dataset.
 
template<class NX >
NX openNXClass (const std::string &name) const
 Templated method for creating derived NX classes.
 
template<class T >
NXDataSetTyped< T > openNXDataSet (const std::string &name) const
 Templated method for creating datasets.
 
NXDouble openNXDouble (const std::string &name) const
 Creates and opens a double dataset.
 
NXFloat openNXFloat (const std::string &name) const
 Creates and opens a float dataset.
 
NXClass openNXGroup (const std::string &name) const
 Creates and opens an arbitrary (non-standard) class (group).
 
NXInt openNXInt (const std::string &name) const
 Creates and opens an integer dataset.
 
NXUInt64 openNXSize (const std::string &name) const
 Creates and opens a size_t dataset.
 
- Public Member Functions inherited from Mantid::Nexus::NXObject
NexusAddress const & address () const
 Returns the absolute address to the object.
 
std::string name () const
 Returns the name of the object.
 
 NXObject (File *fileID, NXClass const *parent, std::string const &name)
 NXObject constructor.
 
 NXObject (std::shared_ptr< File > const &fileID, NXClass const *parent, std::string const &name)
 NXObject constructor.
 
virtual ~NXObject ()=default
 

Private Attributes

const std::string m_filename
 The file name.
 

Additional Inherited Members

- Public Attributes inherited from Mantid::Nexus::NXObject
std::shared_ptr< File > m_fileID
 Nexus file id.
 
- Protected Member Functions inherited from Mantid::Nexus::NXClass
void clear ()
 Deletes content of m_groups and m_datasets.
 
void readAllInfo ()
 Fills in m_groups and m_datasets.
 
- Protected Attributes inherited from Mantid::Nexus::NXClass
std::shared_ptr< std::vector< NXInfo > > m_datasets
 Holds info about the datasets in this NXClass.
 
std::shared_ptr< std::vector< NXClassInfo > > m_groups
 Holds info about the child NXClasses.
 
- Protected Attributes inherited from Mantid::Nexus::NXObject
NexusAddress m_address
 Keeps the absolute address to the object.
 
bool m_open
 Set to true if the object has been open.
 

Detailed Description

Implements NXroot Nexus class.

Definition at line 693 of file NexusClasses.h.

Constructor & Destructor Documentation

◆ NXRoot() [1/2]

Mantid::Nexus::NXRoot::NXRoot ( std::string  fname)

Constructor.

On creation opens the Nexus file for reading only.

Parameters
fname:: The file name to open

Definition at line 264 of file NexusClasses.cpp.

References Mantid::Nexus::NXObject::m_fileID, m_filename, READ, and Mantid::Nexus::NXClass::readAllInfo().

◆ NXRoot() [2/2]

Mantid::Nexus::NXRoot::NXRoot ( std::string  fname,
const std::string &  entry 
)

Constructor.

Creates a new Nexus file. The first root entry will be also created.

Parameters
fname:: The file name to create
entry:: The name of the first entry in the new file

Definition at line 280 of file NexusClasses.cpp.

References CREATE5, Mantid::Nexus::NXObject::m_fileID, m_filename, and UNUSED_ARG.

◆ ~NXRoot()

Mantid::Nexus::NXRoot::~NXRoot ( )
override

Destructor.

Definition at line 286 of file NexusClasses.cpp.

References Mantid::Nexus::NXObject::m_fileID.

Member Function Documentation

◆ isStandard()

bool Mantid::Nexus::NXRoot::isStandard ( ) const

True if complies with our understanding of the www.nexusformat.org definition.

Definition at line 294 of file NexusClasses.cpp.

◆ NX_class()

std::string Mantid::Nexus::NXRoot::NX_class ( ) const
inlineoverridevirtual

Return the NX class for a class (HDF group) or "SDS" for a data set;.

Reimplemented from Mantid::Nexus::NXClass.

Definition at line 702 of file NexusClasses.h.

◆ openEntry()

NXEntry Mantid::Nexus::NXRoot::openEntry ( const std::string &  name)
inline

◆ openFirstEntry()

NXEntry Mantid::Nexus::NXRoot::openFirstEntry ( )

Member Data Documentation

◆ m_filename

const std::string Mantid::Nexus::NXRoot::m_filename
private

The file name.

Definition at line 715 of file NexusClasses.h.

Referenced by NXRoot(), and NXRoot().


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