UniRec
3.0.0
|
Provides a view into a UniRec record. More...
#include <unirecRecordView.hpp>
Public Member Functions | |
UnirecRecordView (const void *unirecRecordData, ur_template_t *unirecTemplate) | |
Constructs a UnirecRecordView object. More... | |
const void * | data () const noexcept |
Returns a const pointer to the data of the UniRec record. More... | |
size_t | size () const noexcept |
Returns the size of the UniRec record. More... | |
template<typename T > | |
add_const_t< T > | getFieldAsType (ur_field_id_t fieldID) const |
Gets the value of a field as a type T. More... | |
template<typename T > | |
add_const_t< UnirecArray< T > > | getFieldAsUnirecArray (ur_field_id_t fieldID) const |
Gets the value of a field as a UnirecArray. More... | |
Private Member Functions | |
template<typename T > | |
add_const_t< T > | getFieldAsStringType (ur_field_id_t fieldID) const |
Private Attributes | |
const void * | m_recordData |
ur_template_t * | m_unirecTemplate |
Friends | |
class | UnirecRecord |
Provides a view into a UniRec record.
The UnirecRecordView
class offers a lightweight way to access and inspect the contents of a UniRec record. It provides methods for retrieving field values as various types, including arrays, strings, and other fundamental types. The class does not own the record data and is intended for read-only operations.
Definition at line 40 of file unirecRecordView.hpp.
|
inline |
Constructs a UnirecRecordView object.
unirecRecordData | Pointer to the UniRec record data. |
unirecTemplate | Pointer to the UniRec template for the record. |
Definition at line 47 of file unirecRecordView.hpp.
|
inlinenoexcept |
Returns a const pointer to the data of the UniRec record.
Definition at line 58 of file unirecRecordView.hpp.
|
inlineprivate |
Definition at line 147 of file unirecRecordView.hpp.
|
inline |
Gets the value of a field as a type T.
This function retrieves the value of a field and converts it to the specified type T
. It performs type checking to ensure that the field type matches the expected type.
T | The type of the field to get. |
fieldID | The ID of the field to get. |
T
object. std::runtime_error | If the field type does not match the expected type. |
Definition at line 96 of file unirecRecordView.hpp.
|
inline |
Gets the value of a field as a UnirecArray.
This function retrieves the value of a field as a UnirecArray
object, which provides a view into a contiguous array of values associated with the specified unirec field ID.
T | The element type of the array. |
fieldID | The ID of the field to get. |
UnirecArray<T>
object representing the array.Definition at line 137 of file unirecRecordView.hpp.
|
inlinenoexcept |
Returns the size of the UniRec record.
Definition at line 65 of file unirecRecordView.hpp.
|
friend |
Definition at line 157 of file unirecRecordView.hpp.
|
private |
Definition at line 154 of file unirecRecordView.hpp.
|
private |
Definition at line 155 of file unirecRecordView.hpp.