NexusCPP  3.5.0
Classes | Public Member Functions | List of all members
nxcpp::NexusDataSet Class Reference

#include <nxfile.h>

Inheritance diagram for nxcpp::NexusDataSet:
Inheritance graph
[legend]
Collaboration diagram for nxcpp::NexusDataSet:
Collaboration graph
[legend]

Classes

class  Iterator
 Basic iterator to browse over NeXusDataSet values. More...
 

Public Member Functions

 NexusDataSet ()
 Default c-tor. More...
 
 NexusDataSet (const NexusDataSet &dataset)
 Copy c-tor. More...
 
 NexusDataSet (NexusDataType eDataType, void *pData, int iRank, int *piDim, int *piStart=NULL)
 
 ~NexusDataSet ()
 
void FreeData ()
 Free data block. More...
 
void Clear ()
 Clears data set. More...
 
void Alloc ()
 Allocate the data set, according to the NexusDataSetInfo part. More...
 
void SetOwner (bool this_has_ownership)
 
bool IsOwner ()
 
Accessors
void * Data () const
 Returns a pointer to the data set. More...
 
unsigned int MemSize () const
 Returns size of the data block (i.e. Size() * sizeof(<datatype>) ) More...
 
unsigned int Size () const
 Returns the number of items. More...
 
void SetData (void *pData)
 
void SetData (const void *pData, NexusDataType eDataType, int iRank, int *piDimArray)
 
void SetDimension (int iDim, int iSize)
 
- Public Member Functions inherited from nxcpp::NexusDataSetInfo
 NexusDataSetInfo ()
 Constructor. More...
 
 ~NexusDataSetInfo ()
 Destructor. More...
 
void SetInfo (NexusDataType eDataType, int iRank)
 
void Clear ()
 Clears instance. More...
 
NexusDataType DataType () const
 Returns the data type. More...
 
int Rank () const
 Returns the data set rank. More...
 
int TotalRank () const
 Returns the whole data set rank. More...
 
int * DimArray () const
 Returns size array of dimensions. More...
 
int * TotalDimArray () const
 
void SetTotalDim (int iTotalRank, int *piTotalDim)
 
int Size () const
 Returns total size. More...
 
bool IsEmpty () const
 Returns 'true' if no data set info is stored. More...
 
unsigned int DatumSize () const
 Returns datum size. More...
 
unsigned int BufferSize () const
 Returns buffer size. More...
 
int * StartArray () const
 Returns array of indices of starting values in Ith dimension. More...
 
int * StartArray ()
 
bool IsSubset () const
 Is the dataset info about a subset? More...
 

Additional Inherited Members

- Static Public Member Functions inherited from nxcpp::NexusDataSetInfo
static int DataTypeSize (NexusDataType eDataType)
 Returns size according to a data type. More...
 
- Protected Attributes inherited from nxcpp::NexusDataSetInfo
NexusDataType m_eDataType
 
int m_iRank
 
int m_iTotalRank
 
int * m_piDim
 
int * m_piTotalDim
 
int * m_piStart
 

Detailed Description

NeXus Data set

This class allow manipulation of NeXus Data sets and subsets

Constructor & Destructor Documentation

◆ NexusDataSet() [1/3]

nxcpp::NexusDataSet::NexusDataSet ( )

Default c-tor.

◆ NexusDataSet() [2/3]

nxcpp::NexusDataSet::NexusDataSet ( const NexusDataSet dataset)

Copy c-tor.

◆ NexusDataSet() [3/3]

nxcpp::NexusDataSet::NexusDataSet ( NexusDataType  eDataType,
void *  pData,
int  iRank,
int *  piDim,
int *  piStart = NULL 
)

c-tor

Parameters
eDataTypedatatype
pDataraw data
iRanknumber of dimensions
piDimpointer to the dimensions array
piStartif not null pointer to the start position of this subset

◆ ~NexusDataSet()

nxcpp::NexusDataSet::~NexusDataSet ( )

Destructor

Remarks
the data pointor is also deleted do not delete it another time

Member Function Documentation

◆ Alloc()

void nxcpp::NexusDataSet::Alloc ( )

Allocate the data set, according to the NexusDataSetInfo part.

◆ Clear()

void nxcpp::NexusDataSet::Clear ( )

Clears data set.

◆ Data()

void* nxcpp::NexusDataSet::Data ( ) const
inline

Returns a pointer to the data set.

Here is the caller graph for this function:

◆ FreeData()

void nxcpp::NexusDataSet::FreeData ( )

Free data block.

◆ IsOwner()

bool nxcpp::NexusDataSet::IsOwner ( )
inline

Have ownership on data buffer ?

◆ MemSize()

unsigned int nxcpp::NexusDataSet::MemSize ( ) const

Returns size of the data block (i.e. Size() * sizeof(<datatype>) )

Here is the caller graph for this function:

◆ SetData() [1/2]

void nxcpp::NexusDataSet::SetData ( void *  pData)
inline

Sets data

Parameters
pDatadata pointer we take ownership

◆ SetData() [2/2]

void nxcpp::NexusDataSet::SetData ( const void *  pData,
NexusDataType  eDataType,
int  iRank,
int *  piDimArray 
)

Sets data

Parameters
pDataPointer to data to copy
eDataTypeData type
iRankNumber of dimension
piDimArrayDimensions sizes

◆ SetDimension()

void nxcpp::NexusDataSet::SetDimension ( int  iDim,
int  iSize 
)

Sets one dimension size

Parameters
iDimDimension in range [0, 32[
iSizeDimension size

◆ SetOwner()

void nxcpp::NexusDataSet::SetOwner ( bool  this_has_ownership)

Gives ownership or not. By default the NexusDataset own the data pointer

Parameters
this_has_ownershipif false the NexusDataset is no longer the owner

◆ Size()

unsigned int nxcpp::NexusDataSet::Size ( ) const

Returns the number of items.


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