Class row_handle

Class Documentation

class row_handle

row_handle is the way to access data stored in rows

Public Functions

inline 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 bool empty() const

Return true if the row is empty or uninitialised.

inline explicit operator bool() const

convenience method to test for empty()

inline item_handle operator[](uint16_t column_ix)

return a cif::item_handle to the item in column column_ix

inline const item_handle operator[](uint16_t column_ix) const

return a const cif::item_handle to the item in column column_ix

inline item_handle operator[](std::string_view column_name)

return a cif::item_handle to the item in the column named column_name

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

return a const cif::item_handle to the item in the column named column_name

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

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

template<typename ...Ts, typename ...C, std::enable_if_t<sizeof...(Ts) == sizeof...(C) and sizeof...(C) != 1, int> = 0>
inline std::tuple<Ts...> get(C... columns) const

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

template<typename T>
inline T get(const char *column) const

Get the value of column column cast to type T.

inline void assign(const std::vector<item> &values)

assign each of the columns named in values to their respective value

inline void assign(std::string_view name, std::string_view value, bool updateLinked, bool validate = true)

assign the value value to the column named name

If updateLinked it true, linked records are updated as well. That means that if column name is part of the link definition and the link results in a linked record in another category this record in the linked category is updated as well.

If validate is true, which is default, the assigned value is checked to see if it conforms to the rules defined in the dictionary

void assign(uint16_t column, std::string_view value, bool updateLinked, bool validate = true)

assign the value value to column at index column

If updateLinked it true, linked records are updated as well. That means that if column column is part of the link definition and the link results in a linked record in another category this record in the linked category is updated as well.

If validate is true, which is default, the assigned value is checked to see if it conforms to the rules defined in the dictionary

inline bool operator==(const row_handle &rhs) const

compare two rows

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

compare two rows