6 #ifndef ECHELON_TYPE_HPP 7 #define ECHELON_TYPE_HPP 9 #include <echelon/hdf5/type.hpp> 98 std::size_t size()
const;
114 explicit operator bool()
const;
174 : name(std::move(name)), type_(type.
clone()), offset(offset)
208 elements_.emplace_back(name, element_type, offset);
213 typedef std::vector<element>::const_iterator
iterator;
222 return begin(elements_);
232 return end(elements_);
243 std::vector<element> elements_;
echelon's core namespace
Definition: attribute.cpp:10
type()=default
Initializes the handle with its null state.
static type short_()
Returns a handle to the primitive type 'short'.
Definition: type.cpp:16
void add_element(std::string name, const type &element_type, std::size_t offset)
Adds a new member to the compound type.
Definition: type.hpp:206
static type long_long()
Returns a handle to the primitive type 'long long'.
Definition: type.cpp:31
iterator begin() const
Definition: type.hpp:218
static type char_()
Returns a handle to the primitive type 'char'.
Definition: type.cpp:11
std::size_t size() const
Definition: type.hpp:237
type_layout(std::size_t size_)
Constructs an empty layout for a compound type with a given total size.
Definition: type.hpp:196
A handle to an HDF5 type.
Definition: type.hpp:21
static type double_()
Returns a handle to the primitive type 'double'.
Definition: type.cpp:66
bool operator==(const type &lhs, const type &rhs)
Tests two types for equality.
Definition: type.cpp:117
static type int_()
Returns a handle to the primitive type 'int'.
Definition: type.cpp:21
std::string name
name of the member
Definition: type.hpp:180
element(std::string name, const type &type, std::size_t offset)
Constructs a new element.
Definition: type.hpp:173
static type object_reference()
Returns a handle to the primitive type 'object reference'.
Definition: type.cpp:76
static type uchar()
Returns a handle to the primitive type 'unsigned char'.
Definition: type.cpp:36
static type ulong_long()
Returns a handle to the primitive type 'unsigned long long'.
Definition: type.cpp:56
static type float_()
Returns a handle to the primitive type 'float'.
Definition: type.cpp:61
static type string()
Returns a handle to the primitive type 'string'.
Definition: type.cpp:71
Tuple containing a name, a type and an offset, which are used to describe a single element of a compo...
Definition: type.hpp:165
A handle to an HDF5 type.
Definition: hdf5/type.hpp:23
static type uint()
Returns a handle to the primitive type 'unsigned int'.
Definition: type.cpp:46
iterator end() const
Definition: type.hpp:228
static type ushort()
Returns a handle to the primitive type 'unsigned short'.
Definition: type.cpp:41
static type compound_type(const type_layout &layout)
Creates a new compound type using a given layout.
Definition: type.cpp:81
bool operator!=(const type &lhs, const type &rhs)
Tests two types for inequality.
Definition: type.cpp:122
Description of a compound type's internal structure.
Definition: type.hpp:159
static type long_()
Returns a handle to the primitive type 'long'.
Definition: type.cpp:26
std::size_t offset
offset of the member within the compound type in bytes
Definition: type.hpp:188
static type ulong()
Returns a handle to the primitive type 'unsigned long'.
Definition: type.cpp:51
type type_
type of the member
Definition: type.hpp:184
type clone() const
Clones the type.
Definition: type.cpp:102
std::vector< element >::const_iterator iterator
Definition: type.hpp:213
const native_handle_type & native_handle() const
The underlying HDF5 low-level handle.
Definition: type.cpp:107