Class const_row_handle

Class Documentation

class const_row_handle

A const version of row_handle.

Public Functions

inline const_row_handle(const category &cat, const row &r)

constructor taking a category cat and a row r

inline const category &get_category() const

return the category this row belongs to

inline int64_t row_id() const

return the row ID

inline bool empty() const

Return true if the row is empty or uninitialised.

inline explicit operator bool() const

convenience method to test for empty()

inline size_t size() const

return the count of the items

inline const item_handle operator[](uint16_t item_ix) const

return a cif::item_handle to the item in item item_ix

inline const item_handle operator[](std::string_view item_name) const

return a cif::item_handle to the item in the item named item_name

template<typename ...C>
inline auto get(C... items) const

Return an object that can be used in combination with cif::tie to assign the values for the items items.

template<typename ...Ts, typename ...C>
inline std::tuple<Ts...> get(C... items) const

Return a tuple of values of types Ts for the items items.

template<typename T>
inline T get(std::string_view item) const

Get the value of item item cast to type T.

inline bool operator!=(const const_row_handle &rhs) const

compare two rows

Protected Functions

uint16_t get_item_ix(std::string_view name) const

Return the index number for the item named name.

std::string_view get_item_name(uint16_t ix) const

Return the name for the item with index number ix.

inline auto get_row() const

Return the actual row.

Protected Attributes

const category *m_category = nullptr

The category.

const row *m_row = nullptr

The row.

Friends

inline friend bool operator==(const_row_handle a, const_row_handle b)

compare two rows