CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
src
opt
hdf5
include
h5_table.h
Go to the documentation of this file.
1
// -*- C++ -*-
12
#ifndef __cxz_h5_table_h__
13
#define __cxz_h5_table_h__
14
15
#include "
h5_types.h
"
16
#include "
h5_content_base.h
"
17
18
namespace
CNORXZ
19
{
20
namespace
hdf5
21
{
25
class
Table
:
public
ContentBase
26
{
27
public
:
28
typedef
std::pair<SizeT,String>
FieldID
;
30
DEFAULT_MEMBERS
(
Table
);
36
Table
(
const
String
&
name
,
const
ContentBase
*
_parent
);
37
39
~Table
();
40
41
virtual
ContentType
type
()
const
override
final
;
42
virtual
bool
ro
()
const
override
final
;
43
virtual
Table
&
open
()
override
final
;
44
virtual
Table
&
close
()
override
final
;
45
virtual
String
path
()
const
override
final
;
46
virtual
String
filename
()
const
override
final
;
47
virtual
bool
exists
()
const
override
final
;
48
52
Table
&
initFieldNames
(
const
Vector
<
String
>&
fnames
);
53
60
Table
&
initTable
(
SizeT
n
,
const
void
* data,
SizeT
dsize
,
SizeT
chunk_size
);
61
66
Table
&
appendRecords
(
SizeT
n
,
const
void
* data);
67
73
Table
&
readRecords
(
SizeT
pos,
SizeT
n
,
char
* data);
74
79
MArray
<
DType
>
readRecord
(
SizeT
pos)
const
;
80
84
MArray
<
DType
>
read
()
const
;
85
89
template
<
class
F
>
90
decltype
(
auto
)
iterRecords
(
F
&&
f
)
const
;
91
95
const
RangePtr
&
fields
()
const
;
96
100
const
RangePtr
&
records
()
const
;
101
102
protected
:
103
RangePtr
mRecords
;
104
RangePtr
mFields
;
// -> FIndex (position -> offset)
105
MArray
<
SizeT
>
mSizes
;
106
MArray
<
SizeT
>
mOffsets
;
107
MArray
<
hid_t
>
mTypes
;
108
hid_t
mType
= 0;
109
SizeT
mTypesize
= 0;
110
MArray
<std::
function
<
DType
(
const
char
*)>>
mInterpret
;
112
void
mkTypes
();
113
};
114
124
template
<
typename
...
Ts
>
125
class
STable
:
public
Table
126
{
127
public
:
128
DEFAULT_MEMBERS
(
STable
);
134
STable
(
const
String
&
name
,
const
ContentBase
*
_parent
);
135
141
STable
(
const
String
&
name
,
const
ContentBase
*
_parent
,
142
const
Arr
<
String
,
sizeof
...(
Ts
)>&
fnames
);
143
147
STable
& initFields(
const
Arr
<
String
,
sizeof
...(
Ts
)>&
fnames
);
148
152
STable
& appendRecord(
const
Tuple<Ts...>
&
t
);
153
157
STable
&
appendRecord
(
const
MArray
<
Tuple<Ts...>
>&
t
);
158
162
MArray
<
Tuple
<
Ts
...>>
read
()
const
;
163
167
template
<
class
F>
168
decltype
(
auto
)
iterRecords
(
F
&&
f
)
const
;
169
};
170
171
}
172
}
173
174
#endif
CNORXZ::DType
Definition
dtype.h:32
CNORXZ::MArray
Definition
marray.h:26
CNORXZ::hdf5::ContentBase
Definition
h5_content_base.h:41
CNORXZ::hdf5::ContentBase::name
const String & name() const
Definition
h5_content_base.cc:24
CNORXZ::hdf5::STable
Definition
h5_table.h:126
CNORXZ::hdf5::STable::DEFAULT_MEMBERS
DEFAULT_MEMBERS(STable)
CNORXZ::hdf5::STable::appendRecord
STable & appendRecord(const MArray< Tuple< Ts... > > &t)
CNORXZ::hdf5::Table
Definition
h5_table.h:26
CNORXZ::hdf5::Table::readRecords
Table & readRecords(SizeT pos, SizeT n, char *data)
Definition
h5_table.cc:146
CNORXZ::hdf5::Table::mFields
RangePtr mFields
Definition
h5_table.h:104
CNORXZ::hdf5::Table::read
MArray< DType > read() const
Definition
h5_table.cc:168
CNORXZ::hdf5::Table::mTypesize
SizeT mTypesize
Definition
h5_table.h:109
CNORXZ::hdf5::Table::records
const RangePtr & records() const
Definition
h5_table.cc:189
CNORXZ::hdf5::Table::mkTypes
void mkTypes()
Definition
h5_table.cc:194
CNORXZ::hdf5::Table::close
virtual Table & close() override final
Definition
h5_table.cc:83
CNORXZ::hdf5::Table::type
virtual ContentType type() const override final
Definition
h5_table.cc:63
CNORXZ::hdf5::Table::mSizes
MArray< SizeT > mSizes
Definition
h5_table.h:105
CNORXZ::hdf5::Table::fields
const RangePtr & fields() const
Definition
h5_table.cc:184
CNORXZ::hdf5::Table::FieldID
std::pair< SizeT, String > FieldID
Definition
h5_table.h:28
CNORXZ::hdf5::Table::initTable
Table & initTable(SizeT n, const void *data, SizeT dsize, SizeT chunk_size)
Definition
h5_table.cc:120
CNORXZ::hdf5::Table::mType
hid_t mType
Definition
h5_table.h:108
CNORXZ::hdf5::Table::open
virtual Table & open() override final
Definition
h5_table.cc:73
CNORXZ::hdf5::Table::mRecords
RangePtr mRecords
Definition
h5_table.h:103
CNORXZ::hdf5::Table::appendRecords
Table & appendRecords(SizeT n, const void *data)
Definition
h5_table.cc:137
CNORXZ::hdf5::Table::iterRecords
decltype(auto) iterRecords(F &&f) const
Definition
h5_table.cc.h:23
CNORXZ::hdf5::Table::DEFAULT_MEMBERS
DEFAULT_MEMBERS(Table)
CNORXZ::hdf5::Table::~Table
~Table()
Definition
h5_table.cc:58
CNORXZ::hdf5::Table::exists
virtual bool exists() const override final
Definition
h5_table.cc:103
CNORXZ::hdf5::Table::Table
Table(const String &name, const ContentBase *_parent)
Definition
h5_table.cc:19
CNORXZ::hdf5::Table::filename
virtual String filename() const override final
Definition
h5_table.cc:98
CNORXZ::hdf5::Table::readRecord
MArray< DType > readRecord(SizeT pos) const
Definition
h5_table.cc:153
CNORXZ::hdf5::Table::path
virtual String path() const override final
Definition
h5_table.cc:93
CNORXZ::hdf5::Table::initFieldNames
Table & initFieldNames(const Vector< String > &fnames)
Definition
h5_table.cc:108
CNORXZ::hdf5::Table::mInterpret
MArray< std::function< DType(const char *)> mInterpret)
Definition
h5_table.h:110
CNORXZ::hdf5::Table::ro
virtual bool ro() const override final
Definition
h5_table.cc:68
CNORXZ::hdf5::Table::mTypes
MArray< hid_t > mTypes
Definition
h5_table.h:107
CNORXZ::hdf5::Table::mOffsets
MArray< SizeT > mOffsets
Definition
h5_table.h:106
h5_content_base.h
Abstract content base class declaration.
h5_types.h
Declaration of hdf5 related library types.
CNORXZ::hdf5::ContentType
ContentType
Definition
h5_content_base.h:29
CNORXZ
Definition
aindex.cc.h:18
CNORXZ::String
std::string String
Definition
types.h:42
CNORXZ::SizeT
uint64_t SizeT
Definition
types.h:38
CNORXZ::RangePtr
Sptr< RangeBase > RangePtr
Definition
types.h:157
CNORXZ::Vector
std::vector< T, Allocator< T > > Vector
Definition
types.h:310
CNORXZ::rangeCast
Sptr< Range > rangeCast(const RangePtr r)
Definition
range_base.cc.h:53
CNORXZ::Tuple
std::tuple< T... > Tuple
Definition
types.h:60
CNORXZ::Arr
std::array< T, N > Arr
Definition
types.h:45
Generated by
1.10.0