|
NexusCPP
3.5.0
|
#include <nxwriter.h>
Classes | |
| class | INotify |
| Write notification interface. More... | |
| struct | Statistics |
| Writing speed statistics. More... | |
Public Types | |
| enum | WriteMode { SYNCHRONOUS = 0, ASYNCHRONOUS, IMMEDIATE, DELAYED } |
| typedef struct nxcpp::NexusFileWriter::Statistics | Statistics |
| Writing speed statistics. More... | |
Public Member Functions | |
| NexusFileWriter (const std::string &strFilePath, WriteMode eMode=ASYNCHRONOUS, unsigned int uiWritePeriod=2) | |
| ~NexusFileWriter () | |
| Destructor. More... | |
| void | SetExceptionHandler (IExceptionHandler *pHandler) |
| Set exception handler. More... | |
| void | SetMessageHandler (IMessageHandler *pHandler) |
| Set message handler. More... | |
| void | SetNotificationHandler (INotify *pHandler) |
| Set the notification handler. More... | |
| void | AddNotificationHandler (INotify *pHandler) |
| Set the notification handler. More... | |
| void | SetCacheSize (yat::uint16 usCacheSize) |
| Set cache size (in MB) for DELAYED mode. More... | |
| void | CreateDataSet (const std::string &strPath, NexusDataType eDataType, int iRank, int *piDim, CompressionFilter filter=CompressNone, FilterConfig filter_config=FilterConfig(), int *piChunk=0) |
| void | PushDataSet (const std::string &strPath, NexusDataSetPtr ptrDataSet) |
| void | PushDatasetAttr (const std::string &strPath, NexusAttrPtr ptrAttr) |
| void | Abort () |
| bool | IsError () |
| True. More... | |
| bool | IsEmpty () |
| Returns true if there is no data to write. More... | |
| bool | Done () |
| Returns true when all job is done. More... | |
| void | Synchronize (bool bSendSyncMsg=true) |
| Wait until all job is done. More... | |
| void | Hold (bool b=true) |
| bool | IsHold () const |
| const std::string & | File () const |
| File name. More... | |
| void | SetFileAutoClose (bool b) |
| The file will not be closed after each write action. More... | |
| void | CloseFile () |
| Close the nexus file. More... | |
| void | SetUseLock () |
| Engage the file lock mecanism. More... | |
| void | ResetStatistics () |
| Reset all statistics. More... | |
| Statistics | GetStatistics () const |
| Gets a copy of the statistics. More... | |
Static Public Member Functions | |
| static std::size_t | AttemptMax () |
| Max attempts for write actions. More... | |
| static std::size_t | AttemptDelay () |
| delay (in ms) between to attempts More... | |
| static void | SetAttemptMax (std::size_t n) |
| set max attempts for write actions More... | |
| static void | SetAttemptDelay (std::size_t ms) |
| set (in ms) between to attempts More... | |
Synchronous/Asynchronous NeXus Writer File Class
This class allow asynchronous writing into a nexus file
Writing speed statistics.
| nxcpp::NexusFileWriter::NexusFileWriter | ( | const std::string & | strFilePath, |
| WriteMode | eMode = ASYNCHRONOUS, |
||
| unsigned int | uiWritePeriod = 2 |
||
| ) |
Constructor
| strFilePath | path + complete filename |
| eMode | Writing mode |
| uiWritePeriod | Write period (seconds) in asynchronous mode |
| nxcpp::NexusFileWriter::~NexusFileWriter | ( | ) |
Destructor.
| void nxcpp::NexusFileWriter::Abort | ( | ) |
Abort: delete all remaining data if any, no more access to file When this method returns
| void nxcpp::NexusFileWriter::AddNotificationHandler | ( | INotify * | pHandler | ) |
Set the notification handler.
|
inlinestatic |
delay (in ms) between to attempts
|
inlinestatic |
Max attempts for write actions.
| void nxcpp::NexusFileWriter::CloseFile | ( | ) |
Close the nexus file.
| void nxcpp::NexusFileWriter::CreateDataSet | ( | const std::string & | strPath, |
| NexusDataType | eDataType, | ||
| int | iRank, | ||
| int * | piDim, | ||
| CompressionFilter | filter = CompressNone, |
||
| FilterConfig | filter_config = FilterConfig(), |
||
| int * | piChunk = 0 |
||
| ) |
Create a dataset
| strPath | Dataset path and name (ex: "entry<NXentry>/sample<NXsample>/formula") |
| eDataType | The data type |
| iRank | number of dimensions |
| piDim | dimensions array |
| filter | Compression filter (no compression is the default) |
| filter_config | Compression filter parameters |
| piChunk | dimensions array of compress chunks (null if no compression) |
| bool nxcpp::NexusFileWriter::Done | ( | ) |
Returns true when all job is done.
| const std::string& nxcpp::NexusFileWriter::File | ( | ) | const |
File name.
| Statistics nxcpp::NexusFileWriter::GetStatistics | ( | ) | const |
Gets a copy of the statistics.
| void nxcpp::NexusFileWriter::Hold | ( | bool | b = true | ) |
| bool nxcpp::NexusFileWriter::IsEmpty | ( | ) |
Returns true if there is no data to write.
| bool nxcpp::NexusFileWriter::IsError | ( | ) |
True.
| bool nxcpp::NexusFileWriter::IsHold | ( | ) | const |
| void nxcpp::NexusFileWriter::PushDataSet | ( | const std::string & | strPath, |
| NexusDataSetPtr | ptrDataSet | ||
| ) |
Push a dataset
| strPath | Dataset path and name (ex: "entry<NXentry>/sample<NXsample>/formula") |
| ptrDataSet | Shared pointer to the dataset to push |
| void nxcpp::NexusFileWriter::PushDatasetAttr | ( | const std::string & | strPath, |
| NexusAttrPtr | ptrAttr | ||
| ) |
Push a attribute Dataset must already exists, otherwise a error is repported and action is canceled
| strPath | Dataset path and name (ex: "entry<NXentry>/sample<NXsample>/formula.attribute") |
| ptrAttr | Shared pointer to the attribute |
| void nxcpp::NexusFileWriter::ResetStatistics | ( | ) |
Reset all statistics.
|
static |
set (in ms) between to attempts
|
static |
set max attempts for write actions
| void nxcpp::NexusFileWriter::SetCacheSize | ( | yat::uint16 | usCacheSize | ) |
Set cache size (in MB) for DELAYED mode.
| void nxcpp::NexusFileWriter::SetExceptionHandler | ( | IExceptionHandler * | pHandler | ) |
Set exception handler.
| void nxcpp::NexusFileWriter::SetFileAutoClose | ( | bool | b | ) |
The file will not be closed after each write action.
| void nxcpp::NexusFileWriter::SetMessageHandler | ( | IMessageHandler * | pHandler | ) |
Set message handler.
| void nxcpp::NexusFileWriter::SetNotificationHandler | ( | INotify * | pHandler | ) |
Set the notification handler.
| void nxcpp::NexusFileWriter::SetUseLock | ( | ) |
Engage the file lock mecanism.
| void nxcpp::NexusFileWriter::Synchronize | ( | bool | bSendSyncMsg = true | ) |
Wait until all job is done.
1.8.13