dev #2

Merged
chizeta merged 32 commits from dev into main 2024-02-02 20:36:53 +01:00
4 changed files with 27 additions and 16 deletions
Showing only changes of commit 27466f6ef1 - Show all commits

View file

@ -28,7 +28,7 @@ namespace CNORXZ
DEFAULT_MEMBERS(Dataset); /**< Default constructors and assignments. */ DEFAULT_MEMBERS(Dataset); /**< Default constructors and assignments. */
/** Construct the class. /** Construct the class.
@param _name Dataset name. @param name Dataset name.
@param _parent Parent content object. @param _parent Parent content object.
*/ */
Dataset(const String& name, const ContentBase* _parent); Dataset(const String& name, const ContentBase* _parent);
@ -79,7 +79,7 @@ namespace CNORXZ
DEFAULT_MEMBERS(SDataset); /**< Default constructors and assignments. */ DEFAULT_MEMBERS(SDataset); /**< Default constructors and assignments. */
/** Construct the class. /** Construct the class.
@param _name Dataset name. @param name Dataset name.
@param _parent Parent content object. @param _parent Parent content object.
*/ */
SDataset(const String& name, const ContentBase* _parent); SDataset(const String& name, const ContentBase* _parent);

View file

@ -28,12 +28,10 @@ namespace CNORXZ
class File : public Group class File : public Group
{ {
public: public:
typedef URange<String> RangeT;
DEFAULT_MEMBERS(File); /**< Default constructors and assignments. */ DEFAULT_MEMBERS(File); /**< Default constructors and assignments. */
/** Construct the class. /** Construct the class.
@param _name Path to the hdf5 file to be handled. @param fname Path to the hdf5 file to be handled.
@param _ro Open in read-only mode if true, otherwise have write access. @param _ro Open in read-only mode if true, otherwise have write access.
*/ */
File(const String& fname, bool _ro = true); File(const String& fname, bool _ro = true);

View file

@ -28,7 +28,7 @@ namespace CNORXZ
DEFAULT_MEMBERS(Group); /**< Default constructors and assignments. */ DEFAULT_MEMBERS(Group); /**< Default constructors and assignments. */
/** Construct the class. /** Construct the class.
@param _name Group name. @param gname Group name.
@param _parent Parent content object. @param _parent Parent content object.
*/ */
Group(const String& gname, const ContentBase* _parent); Group(const String& gname, const ContentBase* _parent);
@ -120,25 +120,25 @@ namespace CNORXZ
Group& addDataset(const String& name, const ArrayBase<T>& data); Group& addDataset(const String& name, const ArrayBase<T>& data);
/** Iterate over all group elements (const). /** Iterate over all group elements (const).
@param F function object to be executed on each group element. @param f function object to be executed on each group element.
*/ */
template <class F> template <class F>
decltype(auto) iter(F&& f) const; decltype(auto) iter(F&& f) const;
/** Iterate recursively over all group elements (const). /** Iterate recursively over all group elements (const).
@param F function object to be executed on each group element. @param f function object to be executed on each group element.
*/ */
template <class F> template <class F>
decltype(auto) iterRecursive(F&& f) const; decltype(auto) iterRecursive(F&& f) const;
/** Iterate over all group elements. /** Iterate over all group elements.
@param F function object to be executed on each group element. @param f function object to be executed on each group element.
*/ */
template <class F> template <class F>
decltype(auto) iter(F&& f); decltype(auto) iter(F&& f);
/** Iterate recursively over all group elements. /** Iterate recursively over all group elements.
@param F function object to be executed on each group element. @param f function object to be executed on each group element.
*/ */
template <class F> template <class F>
decltype(auto) iterRecursive(F&& f); decltype(auto) iterRecursive(F&& f);
@ -147,6 +147,10 @@ namespace CNORXZ
MArray<ContentPtr> mCont; /**< Group elements. */ MArray<ContentPtr> mCont; /**< Group elements. */
/** Recursion helper functon.
@param c Group element.
@param f Function to be executed.
*/
template <typename C, class F> template <typename C, class F>
static void recursion(const C& c, F&& f) static void recursion(const C& c, F&& f)
{ {
@ -159,8 +163,17 @@ namespace CNORXZ
} }
} }
/** Setup group content. */
void mkCont(); void mkCont();
/** Get index to requested group element (const).
@param name Element name.
*/
AIndex<ContentPtr> getIndexTo(const String& name) const; AIndex<ContentPtr> getIndexTo(const String& name) const;
/** Get index to requested group element.
@param name Element name.
*/
BIndex<ContentPtr> getIndexTo(const String& name); BIndex<ContentPtr> getIndexTo(const String& name);
}; };
} }

View file

@ -25,12 +25,12 @@ namespace CNORXZ
class Table : public ContentBase class Table : public ContentBase
{ {
public: public:
typedef std::pair<SizeT,String> FieldID; typedef std::pair<SizeT,String> FieldID; /**< Meta data type of fields range. */
DEFAULT_MEMBERS(Table); /**< Default constructors and assignments. */ DEFAULT_MEMBERS(Table); /**< Default constructors and assignments. */
/** Construct the class. /** Construct the class.
@param _name Table name. @param name Table name.
@param _parent Parent content object. @param _parent Parent content object.
*/ */
Table(const String& name, const ContentBase* _parent); Table(const String& name, const ContentBase* _parent);
@ -84,7 +84,7 @@ namespace CNORXZ
MArray<DType> read() const; MArray<DType> read() const;
/** Iterate over table records. /** Iterate over table records.
@param F function object to be executed on each table record. @param f function object to be executed on each table record.
*/ */
template <class F> template <class F>
decltype(auto) iterRecords(F&& f) const; decltype(auto) iterRecords(F&& f) const;
@ -128,13 +128,13 @@ namespace CNORXZ
DEFAULT_MEMBERS(STable); /**< Default constructors and assignments. */ DEFAULT_MEMBERS(STable); /**< Default constructors and assignments. */
/** Construct the class. /** Construct the class.
@param _name Table name. @param name Table name.
@param _parent Parent content object. @param _parent Parent content object.
*/ */
STable(const String& name, const ContentBase* _parent); STable(const String& name, const ContentBase* _parent);
/** Construct the class. /** Construct the class.
@param _name Table name. @param name Table name.
@param _parent Parent content object. @param _parent Parent content object.
@param fnames Field names. @param fnames Field names.
*/ */