> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class libuserd::Reader

![][C++]
![][public]

This class represents is an instance of a reader that is actively reading a dataset.

**Inherits from**:

* IReader

## Members

* [dynamic\_update\_check](#classlibuserd_1_1_reader_1acc74635760c8d32bcf419742b045a5ac)
* [get\_geometry\_info](#classlibuserd_1_1_reader_1a50470693f96fd3bd89b4b6794f9880b1)
* [get\_meta\_data\_string](#classlibuserd_1_1_reader_1aaed6a90e43d8f5a966347acee272d848)
* [get\_number\_of\_time\_sets](#classlibuserd_1_1_reader_1ac718bff5521bb117682365c0b4736c62)
* [get\_part\_hints](#classlibuserd_1_1_reader_1a47bfbf355ac7e03438fae069601270ef)
* [info](#classlibuserd_1_1_reader_1a43cd80ff9eaeb8facddfe4d210e4da7a)
* [is\_geometry\_changing](#classlibuserd_1_1_reader_1a4959411676a96742b9aab19159ee05a7)
* [m\_part\_metatags](#classlibuserd_1_1_reader_1a7ec945342ac1fcf6691b71b4e01715ce)
* [m\_query\_metatags](#classlibuserd_1_1_reader_1a2aa4ba40207402c934b1bce304fc3939)
* [m\_reader\_info](#classlibuserd_1_1_reader_1adaca0845cebce7561a480d94e6e75bb9)
* [m\_var\_metatags](#classlibuserd_1_1_reader_1a908d32adfeda5983fd3728bd346f821e)
* [number\_of\_geometries](#classlibuserd_1_1_reader_1a4300b48b74502c10a0b3ca458fc29890)
* [parse\_metatags](#classlibuserd_1_1_reader_1aadccfb4ac38dae26319df006b269e94e)
* [parts](#classlibuserd_1_1_reader_1a9af836eaf529c4b15dd72dcdacbe9ee5)
* [queries](#classlibuserd_1_1_reader_1a363a7851bf38059c82a467d332707a1b)
* [Reader](#classlibuserd_1_1_reader_1a8013bb983be4036d2167b18c6ae9ab8f)
* [ReaderInfo](#classlibuserd_1_1_reader_1a73671c5be9cbf13d42ff337755c2af76)
* [set\_timestep](#classlibuserd_1_1_reader_1a46d51aa0cada0a873605f070e974c6ae)
* [set\_timevalue](#classlibuserd_1_1_reader_1abe71a1756dd41d6234d4c0afcaf27dc9)
* [timevalues](#classlibuserd_1_1_reader_1a09cfa421c471be3c98c779633a0dd8e2)
* [variable\_value](#classlibuserd_1_1_reader_1a8bc9be5f6cb37f6893b9a5ce9ccd5352)
* [variables](#classlibuserd_1_1_reader_1a41de518241c05fa09f65e64feeed9b45)

## Friends

### Friend ReaderInfo

![][C++]
![][private]

## Private attributes

### Variable m\_reader\_info

![][private]

```cpp theme={null}
ReaderInfo libuserd::Reader::m_reader_info
```

the [ReaderInfo](https://developer.synopsys.com/docs/ensight/libuserd/reference/classes/classlibuserd_1_1_reader_info.md) used to construct this object

**Type**: ReaderInfo

### Variable m\_part\_metatags

![][private]

```cpp theme={null}
std::map<const std::string, std::string> libuserd::Reader::m_part_metatags
```

**Type**: std::map\< const std::string, std::string >

### Variable m\_var\_metatags

![][private]

```cpp theme={null}
std::map<const std::string, std::string> libuserd::Reader::m_var_metatags
```

**Type**: std::map\< const std::string, std::string >

### Variable m\_query\_metatags

![][private]

```cpp theme={null}
std::map<const std::string, std::string> libuserd::Reader::m_query_metatags
```

**Type**: std::map\< const std::string, std::string >

## Public functions

### Function parts

![][public]

```cpp theme={null}
ErrorCode libuserd::Reader::parts(std::vector< IPart * > &part_list) override
```

parts

The list of part objects (mesh blocks) defined by this dataset.

?> The returned [Part](https://developer.synopsys.com/docs/ensight/libuserd/reference/classes/classlibuserd_1_1_part.md) pointers must be deleted by the caller.

**Parameters**:

* **std::vector\<IPart**: \* > & part\_list

**Returns**:

ErrorCode

**Parameters**:

* std::vector\< IPart \* > & **part\_list**

**Return type**: ErrorCode

### Function variables

![][public]

```cpp theme={null}
ErrorCode libuserd::Reader::variables(std::vector< IVariable * > &variable_list) override
```

variables

The list of variables defined by this dataset.

?> The returned [Variable](https://developer.synopsys.com/docs/ensight/libuserd/reference/classes/classlibuserd_1_1_variable.md) pointers must be deleted by the caller.

**Parameters**:

* **std::vector\<IVariable**: \* > & variable\_list

**Returns**:

ErrorCode

**Parameters**:

* std::vector\< IVariable \* > & **variable\_list**

**Return type**: ErrorCode

### Function queries

![][public]

```cpp theme={null}
ErrorCode libuserd::Reader::queries(std::vector< IQuery * > &query_list) override
```

queries

The list of queries present in this dataset.

?> The returned [Query](https://developer.synopsys.com/docs/ensight/libuserd/reference/classes/classlibuserd_1_1_query.md) pointers must be deleted by the caller.

**Parameters**:

* **std::vector\<IQuery**: \* > & query\_list

**Returns**:

ErrorCode

**Parameters**:

* std::vector\< IQuery \* > & **query\_list**

**Return type**: ErrorCode

### Function get\_number\_of\_time\_sets

![][public]

```cpp theme={null}
ErrorCode libuserd::Reader::get_number_of_time_sets(uint32_t &number_of_time_sets) override
```

timevalues

The list of valid timeset values

**Parameters**:

* **uint32\_t**: number\_of\_time\_sets is the total number of timesets available in this dataset

**Returns**:

ErrorCode

**Parameters**:

* uint32\_t & **number\_of\_time\_sets**

**Return type**: ErrorCode

### Function timevalues

![][public]

```cpp theme={null}
ErrorCode libuserd::Reader::timevalues(std::vector< float > &timevalues, uint32_t timeset_number=0) override
```

timevalues

The list of valid timestep values.

**Parameters**:

* **std::vector\<float>**: & timevalues The "time" values available in this dataset
* **uint32\_t**: timeset\_number This optional argument can be ignored for v1.0 but needs to be supplied for version 2 & 3 (otherwise it would be defaulted to 0th timeset)

**Returns**:

ErrorCode

**Parameters**:

* std::vector\< float > & **timevalues**
* uint32\_t **timeset\_number** = 0

**Return type**: ErrorCode

### Function set\_timevalue

![][public]

```cpp theme={null}
ErrorCode libuserd::Reader::set_timevalue(float timevalue, uint32_t timeset_number=0) override
```

timevalue

The time value to change the reader to.

**Parameters**:

* **float**: timevalue The time value. Note: this value must be present in timesteps();
* **uint32\_t**: timeset\_number This optional argument can be ignored for v1.0 but needs to be supplied for version 2 & 3 (otherwise it would be defaulted to 0th timeset)

**Returns**:

ErrorCode

**Parameters**:

* float **timevalue**
* uint32\_t **timeset\_number** = 0

**Return type**: ErrorCode

### Function set\_timestep

![][public]

```cpp theme={null}
ErrorCode libuserd::Reader::set_timestep(uint32_t timestep, uint32_t timeset_number=0) override
```

set\_timestep

The timestep index to change the reader to.

**Parameters**:

* **uint32\_t**: timestep This is the time value index: \[0,timevalues.size()-1]
* **uint32\_t**: timeset\_number This optional argument can be ignored for v1.0 but needs to be supplied for version 2 & 3 (otherwise it would be defaulted to 0th timeset)

**Returns**:

ErrorCode

**Parameters**:

* uint32\_t **timestep**
* uint32\_t **timeset\_number** = 0

**Return type**: ErrorCode

### Function variable\_value

![][public]

```cpp theme={null}
ErrorCode libuserd::Reader::variable_value(const IVariable *var, float &value, int32_t rank=0) override
```

variable\_value

For DATASET variables, return the value for a DATASET constant at the current timestep.

**Parameters**:

* **const**: IVariable & var The [Variable](https://developer.synopsys.com/docs/ensight/libuserd/reference/classes/classlibuserd_1_1_variable.md) corresponding to a DATASET constant
* **float**: & value The value of the variable
* **int32\_t**: rank The rank number to return values for. Unimplemented, use 0.

**Returns**:

ErrorCode

**Parameters**:

* const IVariable \* **var**
* float & **value**
* int32\_t **rank** = 0

**Return type**: ErrorCode

### Function dynamic\_update\_check

![][public]

```cpp theme={null}
UpdateHints libuserd::Reader::dynamic_update_check(UpdateHints changes_allowed) override
```

dynamic\_update\_check

When this call is made, the active reader is allowed to change the current data values (e.g. variable values, connectivity, etc) as well as the structure of the data (e.g. part\_list, var\_list, query\_list). The returned value describes what things changed. For example, an in situ reader might change the mesh and variable values in response to this call. \


?> : a reader is not allowed to change the underlying data nor structure if this method is never called and only the bits set in the input flags are allowed to change.

**Parameters**:

* **UpdateHints**: changes\_allowed Bitfield of the types of changes that are allowed.

**Returns**:

libuserd::UpdateHints What aspects of the dataset has changed.

**Parameters**:

* UpdateHints **changes\_allowed**

**Return type**: UpdateHints

### Function is\_geometry\_changing

![][public]

```cpp theme={null}
bool libuserd::Reader::is_geometry_changing() override
```

is\_geometry\_changing

**Parameters**:

* **bool**: - returns true if the geometry is changing (timestep dependent) and false otherwise

**Returns**:

ErrorCode

**Return type**: bool

### Function info

![][public]

```cpp theme={null}
const IReaderInfo * libuserd::Reader::info() override
```

info

Get the [ReaderInfo](https://developer.synopsys.com/docs/ensight/libuserd/reference/classes/classlibuserd_1_1_reader_info.md) class used to create this [Reader](https://developer.synopsys.com/docs/ensight/libuserd/reference/classes/classlibuserd_1_1_reader.md) instance.

**Returns**:

const libuserd::IReaderInfo\*

**Return type**: const IReaderInfo \*

## Public static functions

### Function get\_geometry\_info

![][public]
![][static]

```cpp theme={null}
static ErrorCode libuserd::Reader::get_geometry_info(int reader_id, int part_index, std::vector< int > &geoms_vector)
```

**Parameters**:

* int **reader\_id**
* int **part\_index**
* std::vector\< int > & **geoms\_vector**

**Return type**: ErrorCode

### Function number\_of\_geometries

![][public]
![][static]

```cpp theme={null}
static ErrorCode libuserd::Reader::number_of_geometries(int reader_id, int part_index, int &number_of_geoms)
```

**Parameters**:

* int **reader\_id**
* int **part\_index**
* int & **number\_of\_geoms**

**Return type**: ErrorCode

## Private functions

### Function Reader

![][private]

```cpp theme={null}
libuserd::Reader::Reader(ReaderInfo info)
```

**Parameters**:

* ReaderInfo **info**

**Return type**:

### Function get\_meta\_data\_string

![][private]

```cpp theme={null}
ErrorCode libuserd::Reader::get_meta_data_string()
```

**Return type**: ErrorCode

### Function parse\_metatags

![][private]

```cpp theme={null}
void libuserd::Reader::parse_metatags(std::map< const std::string, std::string > &map, const char *section_name)
```

**Parameters**:

* std::map\< const std::string, std::string > & **map**
* const char \* **section\_name**

**Return type**: void

### Function get\_part\_hints

![][private]

```cpp theme={null}
ErrorCode libuserd::Reader::get_part_hints(int reader_id, int part_index, PartHints &part_hints)
```

**Parameters**:

* int **reader\_id**
* int **part\_index**
* PartHints & **part\_hints**

**Return type**: ErrorCode

[public]: https://img.shields.io/badge/-public-brightgreen "public"

[C++]: https://img.shields.io/badge/language-C%2B%2B-blue "C++"

[protected]: https://img.shields.io/badge/-protected-yellow "protected"

[static]: https://img.shields.io/badge/-static-lightgrey "static"

[Python]: https://img.shields.io/badge/language-Python-blue "Python"

[private]: https://img.shields.io/badge/-private-red "private"

[const]: https://img.shields.io/badge/-const-lightblue "const"
