Class row_handle

Class Documentation

class row_handle

row_handle is the way to access data stored in rows

Public Functions

inline row_handle(category &cat, row &r)

constructor taking a category cat and a row r

inline 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 item_handle operator[](uint16_t item_ix)

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

inline const item_handle operator[](uint16_t item_ix) const

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

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

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

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

inline void assign(const std::vector<item> &values, bool updateLinked = true)

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

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

assign the value value to the item named name

If updateLinked it true, linked records are updated as well. That means that if item 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 item, item_value value, bool updateLinked, bool validate = true)

assign the value value to item at index item

If updateLinked it true, linked records are updated as well. That means that if item item 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

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 row_handle &rhs) const

compare two rows

inline bool operator!=(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

category *m_category = nullptr

The category.

row *m_row = nullptr

The row.