NexusCPP  3.5.0
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
nxcpp::NexusFile Class Reference

#include <nxfile.h>

Public Types

enum  OpenMode { NONE, READ, WRITE }
 Files open mode. More...
 

Public Member Functions

Constructors and destructor
 NexusFile (const char *pcszFullPath=NULL, OpenMode eMode=NONE, bool use_lock=false)
 
 ~NexusFile ()
 
File manipulation methods
void Create (const char *pcszFullPath, ENexusCreateMode eMode=NX_HDF5)
 
void OpenRead (const char *pcszFullPath)
 
void OpenReadWrite (const char *pcszFullPath)
 
void Close ()
 
void Flush ()
 Flushes all data to the NeXus file. More...
 
groups manipulations
void CreateGroup (const char *pcszName, const char *pcszClass, bool bOpen=true)
 
bool OpenGroup (const char *pcszName, const char *pcszClass, bool bThrowException=true)
 
void CloseGroup ()
 Closes current group. More...
 
void CloseAllGroups ()
 Closes all opened groups. More...
 
data sets manipulations
void CreateDataSet (const char *pcszName, NexusDataType eDataType, int iRank, int *piDim, int bOpen=true)
 
void CreateCompressedDataSet (const char *pcszName, NexusDataType eDataType, int iRank, int *piDim, int *piChunkDim, CompressionFilter filter=CompressZLIB, FilterConfig filter_config=FilterConfig(), int bOpen=true)
 
void CloseDataSet ()
 
void WriteData (const char *pcszName, void *pData, NexusDataType eDataType, int iRank, int *piDim, bool bCreate=true)
 
void WriteData (const char *pcszName, void *pData, NexusDataType eDataType, const std::vector< std::size_t > &Shape, bool bCreate=true)
 
void WriteDataSubSet (const char *pcszName, void *pData, NexusDataType eDataType, int iRank, int *piStart, int *piDim, bool bCreate=true, bool bNoDim=false)
 
void WriteData (const char *pcszName, float fValue, bool bCreate=true)
 'float' version of WriteData More...
 
void WriteData (const char *pcszName, double dValue, bool bCreate=true)
 'double' version of WriteData More...
 
void WriteData (const char *pcszName, long lValue, bool bCreate=true)
 'long' version of WriteData More...
 
void WriteData (const char *pcszName, const char *pcszValue, bool bCreate=true)
 'std::string' version of WriteData More...
 
void WriteData (const char *pcszName, void *pData, int _iLen, bool bCreate=true)
 'binary' version of WriteData More...
 
bool OpenDataSet (const char *pcszName, bool bThrowException=true)
 
void PutData (void *pData, const char *pcszName=NULL, int bFlush=false)
 
void PutDataSubSet (void *pData, int *piStart, int *piSize, const char *pcszName=NULL)
 
Data set reading
void GetData (NexusDataSet *pDataSet, const char *pcszDataSet=NULL)
 
void GetDataSubSet (NexusDataSet *pDataSet, const char *pcszDataSet=NULL)
 
void GetDataSetInfo (NexusDataSetInfo *pDataSetInfo, const char *pcszDataSet)
 
Getting attributes
void GetAttribute (const char *pcszAttr, int *piBufLen, void *pData, NexusDataType eDataType)
 
void GetAttribute (const char *pcszAttr, long *plValue)
 
void GetAttribute (const char *pcszAttr, double *pdValue)
 
void GetAttribute (const char *pcszAttr, float *pfValue)
 
void GetAttribute (const char *pcszAttr, std::string *pstrValue)
 
Putting attributes

Writes an attribute of the currently open data set. If no data set is open, a global attribute is generated. The attribute has both a name and a value.

void PutAttr (const char *pcszName, void *pValue, int iLen, NexusDataType eDataType)
 
void PutAttr (const char *pcszName, long lValue)
 
void PutAttr (const char *pcszName, const char *pcszValue)
 
void PutAttr (const char *pcszName, double dValue)
 
void PutAttr (const char *pcszName, float fValue)
 
Browsing methods
int ItemCount ()
 Get the number of items in the current group. More...
 
int AttrCount ()
 Get the number of attributes in the current data set. More...
 
int GetFirstItem (NexusItemInfo *pItemInfo)
 
int GetNextItem (NexusItemInfo *pItemInfo)
 
int GetFirstAttribute (NexusAttrInfo *pAttrInfo, const char *pcszDataSet=NULL)
 
int GetNextAttribute (NexusAttrInfo *pAttrInfo)
 
Item linking methods
void GetDataSetLink (NexusItemID *pnxl)
 
void GetGroupLink (NexusItemID *pnxl)
 
void LinkToCurrentGroup (const NexusItemID &nxl)
 
User pointer accessors
void * UserPtr () const
 Get user pointer. More...
 
void SetUserPtr (void *p)
 Set user pointer. More...
 
high level methods
bool OpenGroupPath (const char *pszPath, bool bThrowException=true)
 
bool CreateGroupPath (const char *pszPath)
 
int SearchGroup (const char *pszGroupName, const char *pszClassName, std::vector< std::string > *pvecPaths, const char *pszStartPath=NULL)
 
int SearchDataSetFromAttr (const char *pszAttrName, std::vector< std::string > *pvecDataSets, const std::string &strAttrVal="")
 
int SearchFirstDataSetFromAttr (const char *pszAttrName, std::string *pstrDataSet, const std::string &strAttrVal="")
 
int SearchDataSetFromAttrAndRank (const char *pszAttrName, int iRank, std::vector< std::string > *pvecDataSets, const std::string &strAttrVal="")
 
int SearchFirstDataSetFromAttrAndRank (const char *pszAttrName, int iRank, std::string *pstrDataSet, const std::string &strAttrVal="")
 
std::string GetAttributeAsString (const NexusAttrInfo &aAttrInfo)
 
bool HasAttribute (const char *pszAttrName, const char *pcszDataSet=NULL, const std::string &strAttrVal="")
 
bool GetAttributeAsString (const char *pszAttrName, const char *pcszDataSet, std::string *pstrValue)
 
bool BuildAxisDict (std::map< std::string, std::string > *pmapAxis, const char *pszGroupPath=NULL, const char *pcszDataSet=NULL)
 
bool BuildScanAxisDict (std::map< std::string, std::string > *pmapAxis, const char *pszGroupPath=NULL, const char *pcszDataSet=NULL)
 
int GetScanDim (const char *pszDataGroupPath)
 
std::string CurrentGroupName ()
 Current Group Name. More...
 
std::string CurrentGroupClass ()
 Current Group Class. More...
 
std::string CurrentGroupPath ()
 Currently opened group path inside NeXus file. More...
 
std::string CurrentDataset ()
 Currently opened dataset. More...
 
void GetGroupChildren (std::vector< std::string > *pvecDatasets, std::vector< std::string > *pvecGroupNames, std::vector< std::string > *pvecGroupClasses)
 
NexusItemInfoList GetGroupChildren ()
 
Deprecated methods
void GetAttribute (const char *, char *, int)
 

Static Public Member Functions

static void Initialize ()
 

Static Public Attributes

static const bool USE_LOCK = true
 

Detailed Description

NeXus File Class

This class allow manipulation of NeXus File with no need to known about nexus file handle

Remarks
This is wrapper class, the real job is make by a internal objet

Member Enumeration Documentation

◆ OpenMode

Files open mode.

Enumerator
NONE 
READ 

no mode specified

WRITE 

Constructor & Destructor Documentation

◆ NexusFile()

nxcpp::NexusFile::NexusFile ( const char *  pcszFullPath = NULL,
OpenMode  eMode = NONE,
bool  use_lock = false 
)

Constructor

Parameters
pcszFullPathpath + complete filename
eModeOpenMode (NONE/READ/WRITE)
use_lockif 'true' then use file-system locking for each file access

◆ ~NexusFile()

nxcpp::NexusFile::~NexusFile ( )

Destructor

Perform all operations needed such as closing open groups

Member Function Documentation

◆ AttrCount()

int nxcpp::NexusFile::AttrCount ( )

Get the number of attributes in the current data set.

◆ BuildAxisDict()

bool nxcpp::NexusFile::BuildAxisDict ( std::map< std::string, std::string > *  pmapAxis,
const char *  pszGroupPath = NULL,
const char *  pcszDataSet = NULL 
)

Build a dictionnary that contains axis datasets for each dimension belong to a given dataset Entries in the dictionnary are in the form : "axis_<axis>_<primary>=<dataset name>""

Parameters
pmapAxisMap of axis that will contains the axis datasets name
pszGroupPathGroup Path
pcszDataSetDataSet name
Returns
'true' if at least one axis has been found

◆ BuildScanAxisDict()

bool nxcpp::NexusFile::BuildScanAxisDict ( std::map< std::string, std::string > *  pmapAxis,
const char *  pszGroupPath = NULL,
const char *  pcszDataSet = NULL 
)

Build a dictionnary that contains axis values (readed and setted) datasets for each dimension belong to a given dataset Entries in the dictionnary are in the form : "axis-readed_<axis>_<primary> = <dataset name>" "axis-setted_<axis>_<primary> = <dataset name>"

Parameters
pmapAxisMap of axis that will contains the axis datasets name
pszGroupPathGroup Path
pcszDataSetDataSet name
Returns
'true' if at least one axis has been found

◆ Close()

void nxcpp::NexusFile::Close ( )

Closes currently opened file Frees all allocated objects (groups & data sets)

◆ CloseAllGroups()

void nxcpp::NexusFile::CloseAllGroups ( )

Closes all opened groups.

◆ CloseDataSet()

void nxcpp::NexusFile::CloseDataSet ( )

Closes currenly open dataset

◆ CloseGroup()

void nxcpp::NexusFile::CloseGroup ( )

Closes current group.

◆ Create()

void nxcpp::NexusFile::Create ( const char *  pcszFullPath,
ENexusCreateMode  eMode = NX_HDF5 
)

Creating file

Create Nexus file

Parameters
pcszFullPathpath + complete filename
eModecreating mode can be NX_HDF5, NX_HDF4 or NX_XML
Remarks
HDF4 and XML file modes are deprecated

◆ CreateCompressedDataSet()

void nxcpp::NexusFile::CreateCompressedDataSet ( const char *  pcszName,
NexusDataType  eDataType,
int  iRank,
int *  piDim,
int *  piChunkDim,
CompressionFilter  filter = CompressZLIB,
FilterConfig  filter_config = FilterConfig(),
int  bOpen = true 
)

Creates compressed data set

Parameters
pcszNameData set name
eDataTypeData type (see napi.h)
iRankData set rank
piDimPointer to array of dimensions
piChunkDimPointer to array of chunk dimensions
filtercompression filter to apply
filter_configfilter parameters
bOpenIf 'true' keep the data set open after its creation

◆ CreateDataSet()

void nxcpp::NexusFile::CreateDataSet ( const char *  pcszName,
NexusDataType  eDataType,
int  iRank,
int *  piDim,
int  bOpen = true 
)

Creates data set

Parameters
pcszNameData set name
eDataTypeData type
iRankData set rank
piDimPointer to array of dimensions
bOpenIf 'true' keep the data set open after its creation

◆ CreateGroup()

void nxcpp::NexusFile::CreateGroup ( const char *  pcszName,
const char *  pcszClass,
bool  bOpen = true 
)

Adds a new group

The new group is added under the currently opened group If no group is already open add the group at the top-level (hope this is a NXentry group)

Parameters
pcszNameGroup name
pcszClassNeXus class
bOpenIf 'true' automatically open the group

◆ CreateGroupPath()

bool nxcpp::NexusFile::CreateGroupPath ( const char *  pszPath)

Create and open a group from a given path This method may throw a exception

Parameters
pszPathpath to group in the form : "/<NXroot>/{Group name}<{group class}>/..." if no group name is specified then open the first group for the given class example : "/<NXroot>/scan_1<NXentry>/<NXdata>"

◆ CurrentDataset()

std::string nxcpp::NexusFile::CurrentDataset ( )

Currently opened dataset.

◆ CurrentGroupClass()

std::string nxcpp::NexusFile::CurrentGroupClass ( )

Current Group Class.

◆ CurrentGroupName()

std::string nxcpp::NexusFile::CurrentGroupName ( )

Current Group Name.

◆ CurrentGroupPath()

std::string nxcpp::NexusFile::CurrentGroupPath ( )

Currently opened group path inside NeXus file.

◆ Flush()

void nxcpp::NexusFile::Flush ( )

Flushes all data to the NeXus file.

◆ GetAttribute() [1/6]

void nxcpp::NexusFile::GetAttribute ( const char *  pcszAttr,
int *  piBufLen,
void *  pData,
NexusDataType  eDataType 
)

Gets a attribute

Parameters
pcszAttrAttribute name
piBufLenPointer to BufLen
pDataPointer to attribute value buffer
eDataTypeAttribute data value type
Remarks
The caller is responsible for allocating enough memory for the attribute values

◆ GetAttribute() [2/6]

void nxcpp::NexusFile::GetAttribute ( const char *  pcszAttr,
long *  plValue 
)

Gets a 'long' attribute. Call

Parameters
pcszAttrAttribute name
plValuePointer to attribute value buffer
Remarks
The caller is responsible for allocating enough memory for the attribute values

◆ GetAttribute() [3/6]

void nxcpp::NexusFile::GetAttribute ( const char *  pcszAttr,
double *  pdValue 
)

Gets a 'double' attribute

Parameters
pcszAttrAttribute name
pdValuePointer to attribute value buffer
Remarks
The caller is responsible for allocating enough memory for the attribute values

◆ GetAttribute() [4/6]

void nxcpp::NexusFile::GetAttribute ( const char *  pcszAttr,
float *  pfValue 
)

Gets a 'float' attribute

Parameters
pcszAttrAttribute name
pfValuePointer to attribute value buffer
Remarks
The caller is responsible for allocating enough memory for the attribute values

◆ GetAttribute() [5/6]

void nxcpp::NexusFile::GetAttribute ( const char *  pcszAttr,
std::string *  pstrValue 
)

Gets a 'std::string' attribute

Parameters
pcszAttrAttribute name
pstrValuePointer to attribute value

◆ GetAttribute() [6/6]

void nxcpp::NexusFile::GetAttribute ( const char *  ,
char *  ,
int   
)

◆ GetAttributeAsString() [1/2]

std::string nxcpp::NexusFile::GetAttributeAsString ( const NexusAttrInfo aAttrInfo)

Gets a attribute as a string regardless of its type

Parameters
aAttrInfoAttribute info object
Returns
The value as string

◆ GetAttributeAsString() [2/2]

bool nxcpp::NexusFile::GetAttributeAsString ( const char *  pszAttrName,
const char *  pcszDataSet,
std::string *  pstrValue 
)

Gets a attribute as a std::string regardless of its type

Parameters
pszAttrNameAttribute name
pcszDataSetName of the data set containing the attributge
pstrValuestd::string object to put the value in
Returns
true if attribute was found

◆ GetData()

void nxcpp::NexusFile::GetData ( NexusDataSet pDataSet,
const char *  pcszDataSet = NULL 
)

Reads data values from a data set in currently open group

Parameters
pDataSeta pointer to a NexusDataSet instanciate by caller
pcszDataSetData set name
Remarks
if the data set name isn't provided, supposes that pDataSet isn't empty

◆ GetDataSetInfo()

void nxcpp::NexusFile::GetDataSetInfo ( NexusDataSetInfo pDataSetInfo,
const char *  pcszDataSet 
)

Gets info about a data set

Parameters
pDataSetInfoa pointer to a NexusDataSetInfo instanciate by caller
pcszDataSetData set name

◆ GetDataSetLink()

void nxcpp::NexusFile::GetDataSetLink ( NexusItemID pnxl)

Get a handle on the currently open data set in order to link it with a group

Returns
a pointer to the handle, or NULL if no data set is open or no file is open

◆ GetDataSubSet()

void nxcpp::NexusFile::GetDataSubSet ( NexusDataSet pDataSet,
const char *  pcszDataSet = NULL 
)

Reads data values from a data set in currently open group

Parameters
pDataSeta pointer to a NexusDataSet instanciate by caller
pcszDataSetData set name
Note
if the data set name isn't provided, supposes that pDataSet isn't empty

◆ GetFirstAttribute()

int nxcpp::NexusFile::GetFirstAttribute ( NexusAttrInfo pAttrInfo,
const char *  pcszDataSet = NULL 
)

Get info about the first attribute of the specified data set

Parameters
pAttrInfoPointer to a NexusAttrInfo object
pcszDataSetName of the data set to search in
Returns
NX_OK if group found, NX_EOD if not
Remarks
if pcszDataSet is NULL searching will be performed in currently open data set or in global attribute std::list if no data set is open
You must call GetFirstAttribute in order to initialize the search process then call GetNextAttribute for retrieving information about the remaining attributes

◆ GetFirstItem()

int nxcpp::NexusFile::GetFirstItem ( NexusItemInfo pItemInfo)

Get info about the first item (data set or group) in the current group

Parameters
pItemInfoPointer to NexusItemInfo used to store info
Returns
NX_OK if data set found NX_EOD if not

◆ GetGroupChildren() [1/2]

void nxcpp::NexusFile::GetGroupChildren ( std::vector< std::string > *  pvecDatasets,
std::vector< std::string > *  pvecGroupNames,
std::vector< std::string > *  pvecGroupClasses 
)

Returns the children of the currently opened group

Parameters
pvecDatasetsempty std::vector for storing dataset names
pvecGroupNamesempty std::vector for storing subgroups names
pvecGroupClassesempty std::vector for storing subgroups classes

◆ GetGroupChildren() [2/2]

NexusItemInfoList nxcpp::NexusFile::GetGroupChildren ( )

Returns the children of the currently opened group

Returns
a list of NexusItemInfo object smart pointer (yat::SharedPtr)

◆ GetGroupLink()

void nxcpp::NexusFile::GetGroupLink ( NexusItemID pnxl)

Get a handle on the currently open group set in order to link it with a group

Returns
a pointer to the handle, or NULL if no file is open

◆ GetNextAttribute()

int nxcpp::NexusFile::GetNextAttribute ( NexusAttrInfo pAttrInfo)

Get info about the next attribute of the specified data set

Parameters
pAttrInfoPointer to a NexusAttrInfo object
Returns
NX_OK if group found NX_EOD if not
Remarks
You must call GetFirstAttribute in order to initialize the search process then call GetNextAttribute for retrieving information about the remaining attributes

◆ GetNextItem()

int nxcpp::NexusFile::GetNextItem ( NexusItemInfo pItemInfo)

Get info about the next item (data set or group) in the current group

Parameters
pItemInfoPointer to NexusItemInfo used to store info
Returns
NX_OK if data set found NX_EOD if not

◆ GetScanDim()

int nxcpp::NexusFile::GetScanDim ( const char *  pszDataGroupPath)

Get scam dimension

Reads NXdata group and look for variables datasets (with attribute axis) and return the biggest axis attribute value (note that in time scan case axis may be seeted to 0)

Parameters
pszDataGroupPathGroup Path
Returns
scan dimension (time scans are 1D scans), or 0 if no axis datasets was found

◆ HasAttribute()

bool nxcpp::NexusFile::HasAttribute ( const char *  pszAttrName,
const char *  pcszDataSet = NULL,
const std::string &  strAttrVal = "" 
)

Check if dataset has attribute

Parameters
pszAttrNameName of looked attribute
pcszDataSet(optionnal) Data set to open, if not specified look in currently opened dataset
strAttrValoptionnal attribute value to match
Returns
'true' if sds has attribute, otherwise 'false'

◆ Initialize()

static void nxcpp::NexusFile::Initialize ( )
static

◆ ItemCount()

int nxcpp::NexusFile::ItemCount ( )

Get the number of items in the current group.

◆ LinkToCurrentGroup()

void nxcpp::NexusFile::LinkToCurrentGroup ( const NexusItemID nxl)

Link a item to the currently open group

Parameters
nxlHandle of the item to link

◆ OpenDataSet()

bool nxcpp::NexusFile::OpenDataSet ( const char *  pcszName,
bool  bThrowException = true 
)

Opens a already existing data set

Parameters
pcszNameData set name
bThrowExceptionIf 'true' thrown an exception in case of error

◆ OpenGroup()

bool nxcpp::NexusFile::OpenGroup ( const char *  pcszName,
const char *  pcszClass,
bool  bThrowException = true 
)

Opens a existing group

Parameters
pcszNameGroup name
pcszClassNeXus class
bThrowExceptionif true this method may throw a exception
Returns

◆ OpenGroupPath()

bool nxcpp::NexusFile::OpenGroupPath ( const char *  pszPath,
bool  bThrowException = true 
)

Opens a existing group from a given path

Parameters
pszPathpath to group in the form : /<NXroot>/{Group name}<{group class}>/... if no group name is specified then open the first group for the given class example : "/<NXroot>/scan_1<NXentry>/<NXdata>"
bThrowExceptionif true this method may throw a exception
Returns
true if group has been succefully open

◆ OpenRead()

void nxcpp::NexusFile::OpenRead ( const char *  pcszFullPath)

Opens an existing file for read operations

Parameters
pcszFullPathpath + complete filename

◆ OpenReadWrite()

void nxcpp::NexusFile::OpenReadWrite ( const char *  pcszFullPath)

Opens an existing file for read/write operations

Parameters
pcszFullPathpath + complete filename

◆ PutAttr() [1/5]

void nxcpp::NexusFile::PutAttr ( const char *  pcszName,
void *  pValue,
int  iLen,
NexusDataType  eDataType 
)

Generic method for putting attribute

Parameters
pcszNameData set name
pValuepointer to value
iLenValue buffer length
eDataTypeNeXus Data type (see napi.h)

◆ PutAttr() [2/5]

void nxcpp::NexusFile::PutAttr ( const char *  pcszName,
long  lValue 
)

Puts a attribute of type 'long'

Parameters
pcszNameattribute name
lValueattribute value

◆ PutAttr() [3/5]

void nxcpp::NexusFile::PutAttr ( const char *  pcszName,
const char *  pcszValue 
)

Puts a attribute of type 'C-style string'

Parameters
pcszNameattribute name
pcszValueattribute value

◆ PutAttr() [4/5]

void nxcpp::NexusFile::PutAttr ( const char *  pcszName,
double  dValue 
)

Puts a attribute of type 'double'

Parameters
pcszNameattribute name
dValueattribute value

◆ PutAttr() [5/5]

void nxcpp::NexusFile::PutAttr ( const char *  pcszName,
float  fValue 
)

Puts a attribute of type 'float'

Parameters
pcszNameattribute name
fValueattribute value

◆ PutData()

void nxcpp::NexusFile::PutData ( void *  pData,
const char *  pcszName = NULL,
int  bFlush = false 
)

Puts data in the currently open data set

Parameters
pDataPointer to the data bloc
pcszNameData set name
bFlushIf 'true' then immediately flush the data to the file
Remarks
Use pcszName to specify another data set

◆ PutDataSubSet()

void nxcpp::NexusFile::PutDataSubSet ( void *  pData,
int *  piStart,
int *  piSize,
const char *  pcszName = NULL 
)

Puts data subset in the currently open data set

Parameters
pDataPointer to the data bloc
piStartIndices of starting values in each dimension
piSizeLength of subset in each dimension
pcszNameData set name
Remarks
Use pcszName to specify another data set

◆ SearchDataSetFromAttr()

int nxcpp::NexusFile::SearchDataSetFromAttr ( const char *  pszAttrName,
std::vector< std::string > *  pvecDataSets,
const std::string &  strAttrVal = "" 
)

Search for all occurences of a data set (name) with a given attribute

Parameters
pszAttrNamename of looked attribute
pvecDataSetsoutput std::vector of found data sets
strAttrValoptionnal attribute value to match
Returns
NX_OK if at least one data set was found NX_EOD if not

◆ SearchDataSetFromAttrAndRank()

int nxcpp::NexusFile::SearchDataSetFromAttrAndRank ( const char *  pszAttrName,
int  iRank,
std::vector< std::string > *  pvecDataSets,
const std::string &  strAttrVal = "" 
)

Search for all occurences of a data set (name) with a given attribute

Parameters
pszAttrNamename of looked attribute
iRankdataset rank
pvecDataSetsoutput std::vector of found data sets
strAttrValoptionnal attribute value to match
Returns
NX_OK if at least one data set was found NX_EOD if not

◆ SearchFirstDataSetFromAttr()

int nxcpp::NexusFile::SearchFirstDataSetFromAttr ( const char *  pszAttrName,
std::string *  pstrDataSet,
const std::string &  strAttrVal = "" 
)

Search for first occurence of a data set (name) with a given attribute

Parameters
pszAttrNamename of looked attribute
pstrDataSetname of founded data set
strAttrValoptionnal attribute value to match
Returns
NX_OK if at least one data set was found NX_EOD if not

◆ SearchFirstDataSetFromAttrAndRank()

int nxcpp::NexusFile::SearchFirstDataSetFromAttrAndRank ( const char *  pszAttrName,
int  iRank,
std::string *  pstrDataSet,
const std::string &  strAttrVal = "" 
)

Search for all occurences of a data set (name) with a given attribute

Parameters
pszAttrNamename of looked attribute
iRankdataset rank
[out]pstrDataSetdataset name found
strAttrValoptionnal attribute value to match
Returns
NX_OK if at least one data set was found NX_EOD if not

◆ SearchGroup()

int nxcpp::NexusFile::SearchGroup ( const char *  pszGroupName,
const char *  pszClassName,
std::vector< std::string > *  pvecPaths,
const char *  pszStartPath = NULL 
)

Search for all occurences of a group (name and class) starting at a given level on the hierarchy

Parameters
pszGroupNamename of searched group
pszClassNameclass of searched group
pvecPathsoutput std::vector of found groups
pszStartPathpath for starting research
Returns
NX_OK if at least one group was found NX_EOD if not

◆ SetUserPtr()

void nxcpp::NexusFile::SetUserPtr ( void *  p)
inline

Set user pointer.

Here is the call graph for this function:

◆ UserPtr()

void* nxcpp::NexusFile::UserPtr ( ) const
inline

Get user pointer.

◆ WriteData() [1/7]

void nxcpp::NexusFile::WriteData ( const char *  pcszName,
void *  pData,
NexusDataType  eDataType,
int  iRank,
int *  piDim,
bool  bCreate = true 
)

Writes data into a new or existing dataset

Parameters
pcszNameData set name
pDatapointer to value
eDataTypeNeXus Data type (see napi.h)
iRankDimensions count
piDimPointer to array of dimensions sizes
bCreatetrue for creating the dataset before write data otherwise we suppose the dataset already created and opened

◆ WriteData() [2/7]

void nxcpp::NexusFile::WriteData ( const char *  pcszName,
void *  pData,
NexusDataType  eDataType,
const std::vector< std::size_t > &  Shape,
bool  bCreate = true 
)

Writes data into a new or existing dataset

Parameters
pcszNameData set name
pDatapointer to value
eDataTypeNeXus Data type (see napi.h)
ShapeDimensions arrau
bCreatetrue for creating the dataset before write data otherwise we suppose the dataset already created and opened

◆ WriteData() [3/7]

void nxcpp::NexusFile::WriteData ( const char *  pcszName,
float  fValue,
bool  bCreate = true 
)

'float' version of WriteData

◆ WriteData() [4/7]

void nxcpp::NexusFile::WriteData ( const char *  pcszName,
double  dValue,
bool  bCreate = true 
)

'double' version of WriteData

◆ WriteData() [5/7]

void nxcpp::NexusFile::WriteData ( const char *  pcszName,
long  lValue,
bool  bCreate = true 
)

'long' version of WriteData

◆ WriteData() [6/7]

void nxcpp::NexusFile::WriteData ( const char *  pcszName,
const char *  pcszValue,
bool  bCreate = true 
)

'std::string' version of WriteData

◆ WriteData() [7/7]

void nxcpp::NexusFile::WriteData ( const char *  pcszName,
void *  pData,
int  _iLen,
bool  bCreate = true 
)

'binary' version of WriteData

◆ WriteDataSubSet()

void nxcpp::NexusFile::WriteDataSubSet ( const char *  pcszName,
void *  pData,
NexusDataType  eDataType,
int  iRank,
int *  piStart,
int *  piDim,
bool  bCreate = true,
bool  bNoDim = false 
)

Writes data subset into a new or existing dataset

Parameters
pcszNameData set name
pDatapointer to value
eDataTypeNeXus Data type
iRankDimensions count
piStartPointer to array of start positions of the subset
piDimPointer to array of dimensions sizes
bCreatetrue for creating the dataset before write data otherwise we suppose the dataset already created and opened
bNoDimdeprecated parameter, must be 'false'

Member Data Documentation

◆ USE_LOCK

const bool nxcpp::NexusFile::USE_LOCK = true
static

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