Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::CaseOptionEnumValues Class Reference

Set of values for an enumeration. More...

#include <arcane/core/CaseOptionEnum.h>

Collaboration diagram for Arcane::CaseOptionEnumValues:

Public Types

typedef UniqueArray< CaseOptionEnumValue * > EnumValueList
 Type of the value list.

Public Member Functions

 CaseOptionEnumValues ()
 Constructs the instance.
 ~CaseOptionEnumValues ()
 Releases resources.
void addEnumValue (CaseOptionEnumValue *value, bool do_clone)
 Adds the enumeration value value. The instance becomes the owner of value, which is destroyed when it is no longer used. This function should only be called during initialization. If do_clone is true, a copy of value is used.
Integer nbEnumValue () const
 Returns the number of enumeration values.
CaseOptionEnumValueenumValue (Integer index) const
 Returns the i-th value.
bool valueOfName (const String &name, const String &lang, int &value) const
 Returns the value of the enumeration having the name name.
String nameOfValue (int value, const String &lang) const
 Returns the name corresponding to the value value for the language lang.
void getValidNames (const String &lang, StringArray &names) const
 Fills names with valid names for the language lang.

Private Attributes

EnumValueListm_enum_values
 Enumeration values.

Detailed Description

Set of values for an enumeration.

Definition at line 102 of file CaseOptionEnum.h.

Member Typedef Documentation

◆ EnumValueList

Type of the value list.

Definition at line 107 of file CaseOptionEnum.h.

Constructor & Destructor Documentation

◆ CaseOptionEnumValues()

Arcane::CaseOptionEnumValues::CaseOptionEnumValues ( )

Constructs the instance.

Definition at line 119 of file CaseOptionEnum.cc.

References m_enum_values.

◆ ~CaseOptionEnumValues()

Arcane::CaseOptionEnumValues::~CaseOptionEnumValues ( )

Releases resources.

Definition at line 125 of file CaseOptionEnum.cc.

References m_enum_values.

Member Function Documentation

◆ addEnumValue()

void Arcane::CaseOptionEnumValues::addEnumValue ( CaseOptionEnumValue * value,
bool do_clone )

Adds the enumeration value value. The instance becomes the owner of value, which is destroyed when it is no longer used. This function should only be called during initialization. If do_clone is true, a copy of value is used.

Definition at line 146 of file CaseOptionEnum.cc.

References m_enum_values.

◆ enumValue()

CaseOptionEnumValue * Arcane::CaseOptionEnumValues::enumValue ( Integer index) const

Returns the i-th value.

Definition at line 137 of file CaseOptionEnum.cc.

References m_enum_values.

◆ getValidNames()

void Arcane::CaseOptionEnumValues::getValidNames ( const String & lang,
StringArray & names ) const

Fills names with valid names for the language lang.

Definition at line 196 of file CaseOptionEnum.cc.

References Arcane::Array< T >::add(), and m_enum_values.

Here is the call graph for this function:

◆ nameOfValue()

String Arcane::CaseOptionEnumValues::nameOfValue ( int value,
const String & lang ) const

Returns the name corresponding to the value value for the language lang.

Definition at line 180 of file CaseOptionEnum.cc.

References m_enum_values.

◆ nbEnumValue()

Integer Arcane::CaseOptionEnumValues::nbEnumValue ( ) const

Returns the number of enumeration values.

Definition at line 155 of file CaseOptionEnum.cc.

References m_enum_values.

◆ valueOfName()

bool Arcane::CaseOptionEnumValues::valueOfName ( const String & name,
const String & lang,
int & value ) const

Returns the value of the enumeration having the name name.

The value is returned in index.

Parameters
namename of the enumeration
langis the language of the data set
valueis the enumeration value (returned)
Return values
truein case of error,
falsein case of success.

Definition at line 164 of file CaseOptionEnum.cc.

References m_enum_values.

Member Data Documentation

◆ m_enum_values

EnumValueList* Arcane::CaseOptionEnumValues::m_enum_values
private

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