Set of values for an enumeration. More...
#include <arcane/core/CaseOptionEnum.h>
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. | |
| CaseOptionEnumValue * | enumValue (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 | |
| EnumValueList * | m_enum_values |
| Enumeration values. | |
Set of values for an enumeration.
Definition at line 102 of file CaseOptionEnum.h.
Type of the value list.
Definition at line 107 of file CaseOptionEnum.h.
| Arcane::CaseOptionEnumValues::CaseOptionEnumValues | ( | ) |
Constructs the instance.
Definition at line 119 of file CaseOptionEnum.cc.
References m_enum_values.
| Arcane::CaseOptionEnumValues::~CaseOptionEnumValues | ( | ) |
| 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.
| CaseOptionEnumValue * Arcane::CaseOptionEnumValues::enumValue | ( | Integer | index | ) | const |
| 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.
Returns the name corresponding to the value value for the language lang.
Definition at line 180 of file CaseOptionEnum.cc.
References m_enum_values.
| Integer Arcane::CaseOptionEnumValues::nbEnumValue | ( | ) | const |
Returns the number of enumeration values.
Definition at line 155 of file CaseOptionEnum.cc.
References m_enum_values.
| 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.
| name | name of the enumeration |
| lang | is the language of the data set |
| value | is the enumeration value (returned) |
| true | in case of error, |
| false | in case of success. |
Definition at line 164 of file CaseOptionEnum.cc.
References m_enum_values.
|
private |
Enumeration values.
Definition at line 152 of file CaseOptionEnum.h.
Referenced by addEnumValue(), CaseOptionEnumValues(), enumValue(), getValidNames(), nameOfValue(), nbEnumValue(), valueOfName(), and ~CaseOptionEnumValues().