98 const std::string& perms) = 0;
109 const std::string& perms);
130 const std::string& dataName)
const = 0;
141 const std::string& dataName)
const = 0;
162 const std::string& name,
164 const std::type_info& typeinfo)
const = 0;
175 const std::string& dataName)
const = 0;
186 const std::string& dataName)
const = 0;
206 const std::string& dataName,
207 const std::vector<std::pair<int, int>>& fileSpaceCorners,
208 const std::vector<std::pair<int, int>>& memorySpaceCorners,
209 const std::vector<std::pair<int, int>>& writeSelectionCorners,
217 writeSelectionCorners,
243 node, memoryRange, memorySubRange, fileRange, fileSubRange, dptr);
262 const std::string& dataName,
263 const std::vector<std::pair<int, int>>& memorySpaceCorners,
264 const std::vector<std::pair<int, int>>& readSelectionCorners,
269 node, dataName, memorySpaceCorners, readSelectionCorners, dptr);
294 node, memoryRange, memorySubRange, fileRange, fileSubRange, dptr);
307 const std::string& dataSetName,
310 return getIoPtr()->
getDataShape(node, dataSetName, dataShape);
343 const std::string& attribName,
344 const std::vector<T>& attrib)
346 writeVecAttribute<T>(node, attribName, &(attrib[0]), attrib.size());
359 const std::string& attribName,
360 const T* attribStorage,
378 const std::string& attribName,
379 const std::string& attrib)
const = 0;
390 const std::string& attribName,
391 const std::vector<std::string>& stringsvector)
const = 0;
401 const std::string& attribName,
402 std::string& attrib)
const = 0;
409 const char*
what() const noexcept
411 return "Attribute Not Found.\n";
424 virtual std::vector<std::string>
453 const std::string& attribName,
483 WxIoBase(
const std::string& bn,
int d,
const std::string& sfx);
511 implementationPtr = b;
528 if (implementationPtr)
529 return implementationPtr;
531 wxe <<
"I/O implementation not set properly";
535 std::vector<WxIoNodeType> openFiles;
536 std::string baseName;
Opaque Pointer object that carries the referenced data type, but does not expose this payload type as...
Definition: wmopaqueptr.h:81
Opaque Pointer object that carries the referenced data type, but does not expose this payload type as...
Definition: wmopaqueptr.h:24
Provides an abstract interface for access to hierachical datasets.
Definition: wxiobase.h:25
void writeVecAttribute(WxIoNodeType node, const std::string &attribName, const std::vector< T > &attrib)
Write an attribute (vector).
Definition: wxiobase.h:342
virtual void closeNode(WxIoNodeType node) const =0
Close a data set.
virtual void addOpenFile(WxIoNodeType node)
Add a file to the list of open files.
virtual WxIoNodeType openFile(const std::string &fileName, const std::string &perms)=0
Open a file.
virtual ~WxIoBase()
Virtual destructor.
void setBaseName(const std::string &bn)
Set the base name.
Definition: wxiobase.h:38
virtual std::list< std::string > getGroupNames(WxIoNodeType node) const =0
Get list of group names under the supplied node.
virtual WxIoNodeType openDumpFile(const std::string &dataName, const std::string &perms)
Open a file with the base name prepended and the dump and suffix appended.
virtual std::string getDumpFileName(const std::string &dataName)
Get the dump name for a given data name.
WxIoNodeType getDataShape(WxIoNodeType node, const std::string &dataSetName, WxRange &dataShape) const
Obtain simple data shape for a data set under a node.
Definition: wxiobase.h:306
WxIoBase(const std::string &sfx)
Constructor is protected, as this class cannot be made standalone.
void writeToDataSet(WxIoNodeType node, const WxRange &memoryRange, const WxRange &memorySubRange, const WxRange &fileRange, const WxRange &fileSubRange, const T *data) const
Write to an open dataset (independent)
Definition: wxiobase.h:234
virtual void removeOpenFile(WxIoNodeType node)
Remove a file from the list of open files.
virtual WxIoNodeType createDataSet(WxIoNodeType node, const std::string &dataName) const =0
Create an empty node.
WxIoNodeType writeDataSet(WxIoNodeType node, const std::string &dataName, const std::vector< std::pair< int, int > > &fileSpaceCorners, const std::vector< std::pair< int, int > > &memorySpaceCorners, const std::vector< std::pair< int, int > > &writeSelectionCorners, const T *data) const
Write a new data set under a node.
Definition: wxiobase.h:205
WxIoBase(const std::string &bn, int d, const std::string &sfx)
Constructor is protected, as this class cannot be made standalone.
virtual WxIoNodeType createFile(const std::string &fileName)=0
Create a file.
virtual std::vector< std::string > readStrVecAttribute(WxIoNodeType node, const std::string &attribName) const =0
Read a vector of strings attribute.
virtual WxIoNodeType createDataSet(WxIoNodeType node, const std::string &name, const WxRange &range, const std::type_info &typeinfo) const =0
Collective dataset allocation.
virtual void closeFile(WxIoNodeType fileNode)=0
Close a file node.
virtual void writeStrVecAttribute(WxIoNodeType node, const std::string &attribName, const std::vector< std::string > &stringsvector) const =0
Write a vector of strings as attribute.
virtual WxIoNodeType openDataSet(WxIoNodeType node, const std::string &dataName) const =0
Open a node.
void readFromDataSet(WxIoNodeType node, const WxRange &memoryRange, const WxRange &memorySubRange, const WxRange &fileRange, const WxRange &fileSubRange, T *data) const
Read from an open dataset (independent)
Definition: wxiobase.h:285
virtual void readStrAttribute(WxIoNodeType node, const std::string &attribName, std::string &attrib) const =0
Read a string attribute.
std::string getBaseName()
Get the base name.
Definition: wxiobase.h:48
int getDumpNo()
Get the dump number.
Definition: wxiobase.h:68
void writeAttribute(WxIoNodeType node, const std::string &attribName, const T *attrib)
Write an attribute.
Definition: wxiobase.h:328
int readVecAttribute(WxIoNodeType node, const std::string &attribName, T *attribStorage, int count)
Read a vector attribute.
Definition: wxiobase.h:452
virtual void closeOpenFiles()
Close any files currently open.
virtual WxIoNodeType openGroup(WxIoNodeType node, const std::string &dataName) const =0
Open a group.
void readAttribute(WxIoNodeType node, const std::string &attribName, T *attrib)
Read an attribute.
Definition: wxiobase.h:435
void setDumpNo(int d)
Set the dump number.
Definition: wxiobase.h:58
WxIoNodeType readDataSet(WxIoNodeType node, const std::string &dataName, const std::vector< std::pair< int, int > > &memorySpaceCorners, const std::vector< std::pair< int, int > > &readSelectionCorners, T *data) const
Read a new data set under a node.
Definition: wxiobase.h:261
std::string suffix
Definition: wxiobase.h:514
WxIoBase()
Default constructor - no dump, basename or suffix.
void setIo(const WxIoTmpl *b)
Sets the new io object implementation.
Definition: wxiobase.h:509
virtual WxIoNodeType createGroup(WxIoNodeType node, const std::string &dataName) const =0
Create an empty group.
virtual void writeStrAttribute(WxIoNodeType node, const std::string &attribName, const std::string &attrib) const =0
Write a string attribute.
virtual WxIoNodeType createDumpFile(const std::string &dataName)
Create a file with base name prepended and dump and suffix appended.
void writeVecAttribute(WxIoNodeType node, const std::string &attribName, const T *attribStorage, int count)
Write a vector of attributes.
Definition: wxiobase.h:358
WxIoTmpl is the base class for access to a hierarchical file system with groups, data sets,...
Definition: wxiotmpl.h:57
virtual WxIoNodeType writeDataSet(WxIoNodeType node, const std::string &dataName, const std::vector< std::pair< int, int > > &fileSpaceCorners, const std::vector< std::pair< int, int > > &memorySpaceCorners, const std::vector< std::pair< int, int > > &writeSelectionCorners, const WmConstOpaquePtr &data) const =0
Write a new data set under a node.
virtual WxIoNodeType getDataShape(WxIoNodeType node, const std::string &dataSetName, WxRange &dataShape) const =0
Obtain simple data shape for a data set under a node.
virtual void writeToDataSet(WxIoNodeType node, const WxRange &memoryRange, const WxRange &memorySubRange, const WxRange &fileRange, const WxRange &fileSubRange, const WmConstOpaquePtr &data) const =0
Write to an open dataset (independent)
virtual void readFromDataSet(WxIoNodeType node, const WxRange &memoryRange, const WxRange &memorySubRange, const WxRange &fileRange, const WxRange &fileSubRange, WmOpaquePtr &data) const =0
Read from an open dataset (independent)
virtual WxIoNodeType readDataSet(WxIoNodeType node, const std::string &dataName, const std::vector< std::pair< int, int > > &memorySpaceCorners, const std::vector< std::pair< int, int > > &readSelectionCorners, WmOpaquePtr &data) const =0
Read a new data set under a node.
virtual void writeAttribute(WxIoNodeType node, const std::string &attribName, const WmConstOpaquePtr &attrib) const =0
Write an attribute.
virtual void readAttribute(WxIoNodeType node, const std::string &attribName, WmOpaquePtr &attrib) const =0
Read an attribute.
virtual int readVecAttribute(WxIoNodeType node, const std::string &attribName, WmOpaquePtr &attribStorage, int count) const =0
Read a vector attribute.
virtual void writeVecAttribute(WxIoNodeType node, const std::string &attribName, const WmConstOpaquePtr &attribStorage, int count) const =0
Write a vector attribute.
WxRange represents a hyper-rectangular domain of an n-dimensional space of integers.
Definition: wxrange.h:23
wxm::lib::Except is the class to use for creating and throwing exceptions.
Definition: wxexcept.h:31
Exception class for reporting when an attribute does not exist.
Definition: wxiobase.h:408
const char * what() const noexcept
Definition: wxiobase.h:409
Provides a means for derived messengers to return implimentation specific message status flags and da...
Definition: wxiotmpl.h:23