# Class row_handle

- Defined in File row.hpp

## 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 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 const 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 const 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, std::enable_if_t<sizeof...(Ts) == sizeof...(C) and sizeof...(C) != 1, int> = 0>
  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(const char *item) const

    Get the value of item item cast to type T.

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

    Get the value of item item cast to type T.

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

    assign each of the items 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 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, std::string_view 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

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

    compare two rows

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

    compare two rows