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

#include <nxwriter.h>

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

Classes

struct  Config
 DatasetWriter configuration. More...
 
class  IFlushNotification
 

Public Types

typedef struct nxcpp::DatasetWriter::Config Config
 DatasetWriter configuration. More...
 

Public Member Functions

template<class TYPE >
void SetDataType ()
 Sets the NeXus dataset type according to the class invoked through the template. More...
 
void Reset ()
 reset the writer in order to re-using it More...
 
void SetNeXusDataType (NexusDataType eDataType)
 Sets the NeXus dataset type. More...
 
void SetShapes (const DataShape &shapeDataItem, const DataShape &shapeMatrix)
 
void set_compression (CompressionFilter filter=CompressZLIB, FilterConfig filter_config=FilterConfig())
 Set compression parameters. More...
 
 DatasetWriter (const DataShape &shapeDataItem, const DataShape &shapeMatrix=g_empty_shape, yat::uint16 usMaxMB=64, yat::uint16 m_usWriteTimeout=0)
 
 DatasetWriter (const DataShape &shapeDataItem, std::size_t one_dim_size, yat::uint16 usMaxMB=64, yat::uint16 m_usWriteTimeout=0)
 
 DatasetWriter (yat::uint16 usMaxMB=64, yat::uint16 m_usWriteTimeout=0)
 
 DatasetWriter (const Config &cfg)
 
virtual ~DatasetWriter ()
 d-tor More...
 
void SetNexusFileWriter (NexusFileWriterPtr ptrWriter)
 
void SetFlushListener (IFlushNotification *pListener)
 
void SetMatrix (const DataShape &shapeMatrix=g_empty_shape)
 
void SetPath (const std::string &strPath, const std::string &strDataset)
 Change destination path. More...
 
void SetFullPath (const std::string &strFullPath)
 Change destination path. More...
 
void SetDatasetName (const std::string &strDatasetName)
 Set the dataset name. More...
 
void SetCacheSize (yat::uint16 usMaxMB)
 Sets the buffer size in Mega bytes. More...
 
void AddAttribute (const NexusAttrPtr &ptrAttr)
 Adding integer-type attribute to the NeXus dataset. More...
 
void AddFloatAttribute (const std::string &strName, double dValue)
 Adding double-type attribute to the NeXus dataset. More...
 
void AddIntegerAttribute (const std::string &strName, long lValue)
 Adding integer-type attribute to the NeXus dataset. More...
 
void AddStringAttribute (const std::string &strName, const std::string &strValue)
 Adding std::string-type attribute to the NeXus dataset. More...
 
void PushData (const void *pData, std::size_t nDataCount=1, bool bNoCopy=false)
 Push data. More...
 
void Stop ()
 No more data to push, data is flushed to the NeXus file writer. More...
 
void Abort ()
 Cancel => forget all. More...
 
template<>
void SetDataType ()
 
template<>
void SetDataType ()
 
template<>
void SetDataType ()
 
template<>
void SetDataType ()
 
template<>
void SetDataType ()
 
template<>
void SetDataType ()
 
template<>
void SetDataType ()
 
template<>
void SetDataType ()
 
template<>
void SetDataType ()
 
template<>
void SetDataType ()
 
template<class TYPE >
void SetDataType ()
 
template<class TYPE >
void AdjustSizes ()
 
 DatasetWriter (const std::vector< int > &, const std::vector< int > &, yat::uint16 usMaxMB=64)
 
 DatasetWriter (const std::vector< int > &, std::size_t, yat::uint16 usMaxMB=64)
 
const DataShapeMatrixShape () const
 
DataShape DataItemShape () const
 
NexusDataType DataType () const
 
std::string FullPath () const
 
const std::string & DatasetName () const
 
std::size_t TotalRank () const
 
std::size_t DataItemCount () const
 
yat::uint64 TotalSize () const
 
yat::uint32 DataItemSize () const
 
yat::uint32 MaxDataItemsCount () const
 

Detailed Description

DatasetWriter

class containing a NexusDataset with its attributes and its location

Member Typedef Documentation

◆ Config

DatasetWriter configuration.

Constructor & Destructor Documentation

◆ DatasetWriter() [1/6]

nxcpp::DatasetWriter::DatasetWriter ( const DataShape shapeDataItem,
const DataShape shapeMatrix = g_empty_shape,
yat::uint16  usMaxMB = 64,
yat::uint16  m_usWriteTimeout = 0 
)

Main constructor

Parameters
shapeDataItemShape of the canonical data
shapeMatrixShape of the acquisition
usMaxMBCache size
m_usWriteTimeoutMax time before flushing cached data

◆ DatasetWriter() [2/6]

nxcpp::DatasetWriter::DatasetWriter ( const DataShape shapeDataItem,
std::size_t  one_dim_size,
yat::uint16  usMaxMB = 64,
yat::uint16  m_usWriteTimeout = 0 
)

Convenience constructor for 1-D scan

Parameters
shapeDataItemShape of the canonical data
one_dim_sizeScan length
usMaxMBCache size
m_usWriteTimeoutMax time before flushing cached data

◆ DatasetWriter() [3/6]

nxcpp::DatasetWriter::DatasetWriter ( yat::uint16  usMaxMB = 64,
yat::uint16  m_usWriteTimeout = 0 
)

Use this constructor when shapes are now known yet

Parameters
usMaxMBCache size
m_usWriteTimeoutMax time before flushing cached data

◆ DatasetWriter() [4/6]

nxcpp::DatasetWriter::DatasetWriter ( const Config cfg)

◆ DatasetWriter() [5/6]

nxcpp::DatasetWriter::DatasetWriter ( const std::vector< int > &  ,
const std::vector< int > &  ,
yat::uint16  usMaxMB = 64 
)

◆ DatasetWriter() [6/6]

nxcpp::DatasetWriter::DatasetWriter ( const std::vector< int > &  ,
std::size_t  ,
yat::uint16  usMaxMB = 64 
)

◆ ~DatasetWriter()

virtual nxcpp::DatasetWriter::~DatasetWriter ( )
virtual

d-tor

Member Function Documentation

◆ Abort()

void nxcpp::DatasetWriter::Abort ( )

Cancel => forget all.

◆ AddAttribute()

void nxcpp::DatasetWriter::AddAttribute ( const NexusAttrPtr ptrAttr)

Adding integer-type attribute to the NeXus dataset.

◆ AddFloatAttribute()

void nxcpp::DatasetWriter::AddFloatAttribute ( const std::string &  strName,
double  dValue 
)

Adding double-type attribute to the NeXus dataset.

◆ AddIntegerAttribute()

void nxcpp::DatasetWriter::AddIntegerAttribute ( const std::string &  strName,
long  lValue 
)

Adding integer-type attribute to the NeXus dataset.

Here is the caller graph for this function:

◆ AddStringAttribute()

void nxcpp::DatasetWriter::AddStringAttribute ( const std::string &  strName,
const std::string &  strValue 
)

Adding std::string-type attribute to the NeXus dataset.

◆ AdjustSizes()

template<class TYPE >
void nxcpp::DatasetWriter::AdjustSizes ( )

◆ DataItemCount()

std::size_t nxcpp::DatasetWriter::DataItemCount ( ) const
inline

◆ DataItemShape()

DataShape nxcpp::DatasetWriter::DataItemShape ( ) const

◆ DataItemSize()

yat::uint32 nxcpp::DatasetWriter::DataItemSize ( ) const
inline

◆ DatasetName()

const std::string& nxcpp::DatasetWriter::DatasetName ( ) const
inline

◆ DataType()

NexusDataType nxcpp::DatasetWriter::DataType ( ) const
inline

◆ FullPath()

std::string nxcpp::DatasetWriter::FullPath ( ) const

◆ MatrixShape()

const DataShape& nxcpp::DatasetWriter::MatrixShape ( ) const
inline

◆ MaxDataItemsCount()

yat::uint32 nxcpp::DatasetWriter::MaxDataItemsCount ( ) const
inline

◆ PushData()

void nxcpp::DatasetWriter::PushData ( const void *  pData,
std::size_t  nDataCount = 1,
bool  bNoCopy = false 
)

Push data.

Here is the caller graph for this function:

◆ Reset()

void nxcpp::DatasetWriter::Reset ( )

reset the writer in order to re-using it

◆ set_compression()

void nxcpp::DatasetWriter::set_compression ( CompressionFilter  filter = CompressZLIB,
FilterConfig  filter_config = FilterConfig() 
)

Set compression parameters.

◆ SetCacheSize()

void nxcpp::DatasetWriter::SetCacheSize ( yat::uint16  usMaxMB)
inline

Sets the buffer size in Mega bytes.

◆ SetDatasetName()

void nxcpp::DatasetWriter::SetDatasetName ( const std::string &  strDatasetName)

Set the dataset name.

◆ SetDataType() [1/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

Synchrotron SOLEIL

Nexus C++ API over NAPI

Creation : 2010/07/18 Author : Stephane Poirier

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

◆ SetDataType() [2/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

◆ SetDataType() [3/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

◆ SetDataType() [4/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

◆ SetDataType() [5/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

◆ SetDataType() [6/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

◆ SetDataType() [7/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

◆ SetDataType() [8/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

◆ SetDataType() [9/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

◆ SetDataType() [10/12]

template<>
void nxcpp::DatasetWriter::SetDataType ( )
inline

◆ SetDataType() [11/12]

template<class TYPE >
void nxcpp::DatasetWriter::SetDataType ( )

◆ SetDataType() [12/12]

template<class TYPE >
void nxcpp::DatasetWriter::SetDataType ( )

Sets the NeXus dataset type according to the class invoked through the template.

◆ SetFlushListener()

void nxcpp::DatasetWriter::SetFlushListener ( IFlushNotification pListener)
inline

Set the flushing notification listener Must be called before push any data, like after construction or a call to the Stop method

Parameters
pListenerpointer to the listener

◆ SetFullPath()

void nxcpp::DatasetWriter::SetFullPath ( const std::string &  strFullPath)

Change destination path.

◆ SetMatrix()

void nxcpp::DatasetWriter::SetMatrix ( const DataShape shapeMatrix = g_empty_shape)

Resizes matrix Must be called before push any data, like after construction or a call to the Stop method

Parameters
shapeMatrixnew shape

◆ SetNeXusDataType()

void nxcpp::DatasetWriter::SetNeXusDataType ( NexusDataType  eDataType)

Sets the NeXus dataset type.

◆ SetNexusFileWriter()

void nxcpp::DatasetWriter::SetNexusFileWriter ( NexusFileWriterPtr  ptrWriter)

Set Nexus file writer object Must be called before push any data, like after construction or a call to the Stop method

Parameters
ptrWriterreferenced pointer to the new writer object

◆ SetPath()

void nxcpp::DatasetWriter::SetPath ( const std::string &  strPath,
const std::string &  strDataset 
)

Change destination path.

◆ SetShapes()

void nxcpp::DatasetWriter::SetShapes ( const DataShape shapeDataItem,
const DataShape shapeMatrix 
)

Set dataset shape

Parameters
shapeDataItemshape of the canonical data
shapeMatrixshape of the acquisition
Here is the caller graph for this function:

◆ Stop()

void nxcpp::DatasetWriter::Stop ( )

No more data to push, data is flushed to the NeXus file writer.

◆ TotalRank()

std::size_t nxcpp::DatasetWriter::TotalRank ( ) const
inline

◆ TotalSize()

yat::uint64 nxcpp::DatasetWriter::TotalSize ( ) const
inline

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