# File row.hpp

↰ Parent directory (`cif++`)

## Definition (`cif++/row.hpp`)

- Program Listing for File row.hpp

## Detailed Description

The class Class row should be an opaque type. It is used to store the internal data per row in a category. You should use Class row_handle to get access to the contents in a row.

One could think of rows as vectors of Class item. But internally that’s not the case.

You can access the values of stored items by name or index. The return value of operator[] is a reference to a Class item_value object.

:ref:`exhale_class_classcif_1_1category`&atom_site=my_db[“atom_site”]; :ref:`exhale_class_classcif_1_1row__handle`rh=atom_site.front();

//byname: std::stringname=rh[“label_atom_id”].get<std::string>();

//byindex: uint16_tix=atom_site.get_item_ix(“label_atom_id”); assert(rh[ix].get<std::string()==name);

There some template magic here to allow easy extracting of data from rows. This can be done using Template Function cif::tie e.g.:

std::stringname; floatx,y,z;

:ref:`exhale_function_namespacecif_1ac3d9a984c107208b0abbabe5f9e05289`(name,x,y,z)=rh.get(“label_atom_id”,”cartn_x”,”cartn_y”,”cartn_z”);

However, a more modern way uses structured binding:

constauto&[name,x,y,z]=rh.get<std::string,float,float,float>(“label_atom_id”,”cartn_x”,”cartn_y”,”cartn_z”);

## Includes

- `array`

- `cif++/item.hpp` (File item.hpp)

- `cstddef`

- `cstdint`

- `initializer_list`

- `string`

- `string_view`

- `tuple`

- `type_traits`

- `utility`

- `vector`

## Included By

- File category.hpp

- File cif++.hpp

- File condition.hpp

- File cql.hpp

- File iterator.hpp

- File model.hpp

- File parser.hpp

## Namespaces

- Namespace cif

- Namespace cif::cql

- Namespace cif::detail

## Classes

- Template Struct get_row_result

- Class const_row_handle

- Class row

- Class row_handle

- Class row_initializer

## Functions

- Template Function cif::tie