IOSS 2.0
Loading...
Searching...
No Matches
Ioss::FieldManager Class Reference

A collection of Ioss::Field objects. More...

#include <Ioss_FieldManager.h>

Collaboration diagram for Ioss::FieldManager:
[legend]

Public Member Functions

 FieldManager ()=default
 
 FieldManager (const FieldManager &other)
 
FieldManageroperator= (const FieldManager &)=delete
 
void add (const Field &new_field)
 Add a field to the field manager.
 
void erase (Field::RoleType role)
 Remove all fields of type role from the field manager.
 
void erase (const std::string &field_name)
 Remove a field from the field manager.
 
IOSS_NODISCARD bool exists (const std::string &field_name) const
 Checks if a field with a given name exists in the field manager.
 
IOSS_NODISCARD Field get (const std::string &field_name) const
 Get a field from the field manager.
 
IOSS_NODISCARD const Fieldgetref (const std::string &field_name) const
 Get a reference to a field from the field manager.
 
int describe (NameList *names) const
 Get the names of all fields in the field manager.
 
IOSS_NODISCARD NameList describe () const
 Get the names of all fields in the field manager.
 
int describe (Field::RoleType role, NameList *names) const
 Get the names of all fields of a specified RoleType in the field manager.
 
IOSS_NODISCARD NameList describe (Field::RoleType role) const
 Get the names of all fields of a specified RoleType in the field manager.
 
IOSS_NODISCARD size_t count () const
 Get the number of fields in the field manager.
 

Private Attributes

FieldMapType fields
 

Detailed Description

A collection of Ioss::Field objects.

Constructor & Destructor Documentation

◆ FieldManager() [1/2]

Ioss::FieldManager::FieldManager ( )
default

◆ FieldManager() [2/2]

Ioss::FieldManager::FieldManager ( const FieldManager & other)
inline

Member Function Documentation

◆ add()

void Ioss::FieldManager::add ( const Field & new_field)

Add a field to the field manager.

Assumes that a field with the same name does not already exist.

Parameters
[in]new_fieldThe field to add

◆ count()

size_t Ioss::FieldManager::count ( ) const

Get the number of fields in the field manager.

Returns
The number of fields in the field manager.

◆ describe() [1/4]

Ioss::NameList Ioss::FieldManager::describe ( ) const

Get the names of all fields in the field manager.

Returns
names All field names in the field manager.

◆ describe() [2/4]

Ioss::NameList Ioss::FieldManager::describe ( Field::RoleType role) const

Get the names of all fields of a specified RoleType in the field manager.

Parameters
[in]roleThe role type (MESH, ATTRIBUTE, TRANSIENT, REDUCTION, etc.)
Returns
names All field names of the specified RoleType in the field manager.

◆ describe() [3/4]

int Ioss::FieldManager::describe ( Field::RoleType role,
NameList * names ) const

Get the names of all fields of a specified RoleType in the field manager.

Parameters
[in]roleThe role type (MESH, ATTRIBUTE, TRANSIENT, REDUCTION, etc.)
[out]namesAll field names of the specified RoleType in the field manager.
Returns
The number of fields extracted from the field manager.

◆ describe() [4/4]

int Ioss::FieldManager::describe ( NameList * names) const

Get the names of all fields in the field manager.

Parameters
[out]namesAll field names in the field manager.
Returns
The number of fields extracted from the field manager.

◆ erase() [1/2]

void Ioss::FieldManager::erase ( const std::string & field_name)

Remove a field from the field manager.

Assumes that a field with the given name exists in the field manager.

Parameters
[in]field_nameThe name of the field to remove.

◆ erase() [2/2]

void Ioss::FieldManager::erase ( Field::RoleType role)

Remove all fields of type role from the field manager.

Parameters
[in]roleRemove all fields (if any) of type role

◆ exists()

bool Ioss::FieldManager::exists ( const std::string & field_name) const

Checks if a field with a given name exists in the field manager.

Parameters
[in]field_nameThe name of the field to check for.
Returns
True if the field exists in the field manager.

◆ get()

Ioss::Field Ioss::FieldManager::get ( const std::string & field_name) const

Get a field from the field manager.

Parameters
[in]field_nameThe name of the field to get.
Returns
The field object.

◆ getref()

const Ioss::Field & Ioss::FieldManager::getref ( const std::string & field_name) const

Get a reference to a field from the field manager.

Parameters
[in]field_nameThe name of the field to get.
Returns
A reference to the field object.

◆ operator=()

FieldManager & Ioss::FieldManager::operator= ( const FieldManager & )
delete

Member Data Documentation

◆ fields

FieldMapType Ioss::FieldManager::fields
private

The documentation for this class was generated from the following files: