Class representing a data set option address. This address must be in the form: "tag/tag[index]/tag" Address parts without an index will have the default index (=1). More...
#include <arcane/utils/internal/ParameterOption.h>
Public Member Functions | |
| ParameterOptionAddr (StringView addr_str_view) | |
| Constructor. | |
| void | addAddrPart (ParameterOptionAddrPart *part) |
| Method allowing a part to be added to the end of the current address. | |
| ParameterOptionAddrPart * | addrPart (const Integer index_of_part) const |
| Method allowing a part of the address to be retrieved. If the address ends with an ANY_TAG[ANY_INDEX], all indices given in the parameter greater than the number of parts of the address will return the last element of the address ("ANY_TAG[ANY_INDEX]"). | |
| ParameterOptionAddrPart * | lastAddrPart () const |
| Integer | nbAddrPart () const |
| Method allowing the number of parts of the address to be retrieved. Parts equal to "ANY_TAG[ANY_INDEX]" are counted. | |
| bool | getIndexInAddr (const ParameterOptionAddr &addr_with_get_index, ArrayView< Integer > indexes) const |
| Method allowing one or more indices to be retrieved in the address. | |
| Integer | nbIndexToGetInAddr () const |
| Method allowing the number of "GET_INDEX" in the address to be known. | |
| bool | operator== (const ParameterOptionAddr &other) const |
| Equality operator. This operator takes into account ANY_TAG / ANY_INDEX. The address "aaa[1]/bbb[2]/ANY_TAG[ANY_INDEX]" will be equal to the address "aaa[1]/bbb[2]/ccc[5]/ddd[7]" or to the address "aaa[1]/bbb[ANY_INDEX]/ccc[5]/ddd[7]" or to the address "aaa[1]/bbb[2]" but not to the address "aaa[1]". | |
| bool | operator!= (const ParameterOptionAddr &other) const |
Private Attributes | |
| UniqueArray< Ref< ParameterOptionAddrPart > > | m_parts |
Class representing a data set option address. This address must be in the form: "tag/tag[index]/tag" Address parts without an index will have the default index (=1).
This address must comply with certain rules:
In a character string:
Definition at line 128 of file ParameterOption.h.
|
explicit |
Constructor.
| addr_str_view | The address to convert. |
Definition at line 150 of file ParameterOption.cc.
References ARCANE_FATAL, Arcane::StringView::bytes(), Arcane::makeRef(), Arcane::SpanImpl< T, SizeType, Extent >::size(), and Arcane::StringView::subView().
Referenced by getIndexInAddr(), and operator==().
| void Arcane::ParameterOptionAddr::addAddrPart | ( | ParameterOptionAddrPart * | part | ) |
Method allowing a part to be added to the end of the current address.
| part | A pointer to the new part. Note that we take ownership of the object (we manage the delete). |
Definition at line 241 of file ParameterOption.cc.
References Arcane::makeRef().
Referenced by Arcane::ParameterCaseOption::count(), Arcane::ParameterCaseOption::existAnyIndex(), Arcane::ParameterCaseOption::getParameterOrNull(), Arcane::ParameterCaseOption::getParameterOrNull(), Arcane::ParameterCaseOption::indexesInParam(), and Arcane::ParameterCaseOption::indexesInParam().
| ParameterOptionAddrPart * Arcane::ParameterOptionAddr::addrPart | ( | const Integer | index_of_part | ) | const |
Method allowing a part of the address to be retrieved. If the address ends with an ANY_TAG[ANY_INDEX], all indices given in the parameter greater than the number of parts of the address will return the last element of the address ("ANY_TAG[ANY_INDEX]").
| index_of_part | The index of the part to retrieve. |
Definition at line 250 of file ParameterOption.cc.
References ARCANE_FATAL.
Referenced by getIndexInAddr(), and operator==().
| bool Arcane::ParameterOptionAddr::getIndexInAddr | ( | const ParameterOptionAddr & | addr_with_get_index, |
| ArrayView< Integer > | indexes ) const |
Method allowing one or more indices to be retrieved in the address.
The functioning of this method is simple. We have the following address: "aaa[1]/bbb[2]/ccc[4]/@name[1]". The address in the parameter is the following: "aaa[1]/bbb[GET_INDEX]/ccc[4]/@name[1]". The index added in the parameter view will be 2.
If the address in the parameter is: "aaa[1]/bbb[GET_INDEX]/ccc[GET_INDEX]/@name[1]". The indices added in the view will be 2 and 4.
Conversely, a "GET_INDEX" cannot be used on an "ANY_INDEX" (returns false). Example: if we have: "aaa[1]/bbb[ANY_INDEX]/ccc[4]/@name[1]". And if the address in the parameter is: "aaa[1]/bbb[GET_INDEX]/ccc[GET_INDEX]/@name[1]". The returned boolean will be false.
To get the correct size of the view, a call to the method "nbIndexToGetInAddr()" can be made.
| addr_with_get_index | The address containing "GET_INDEX" indices. |
| indexes | [OUT] The view where the index or indices will be added (the size must be correct). |
Definition at line 283 of file ParameterOption.cc.
References addrPart(), nbAddrPart(), nbIndexToGetInAddr(), ParameterOptionAddr(), and Arcane::ArrayView< T >::size().
| ParameterOptionAddrPart * Arcane::ParameterOptionAddr::lastAddrPart | ( | ) | const |
Definition at line 265 of file ParameterOption.cc.
| Integer Arcane::ParameterOptionAddr::nbAddrPart | ( | ) | const |
Method allowing the number of parts of the address to be retrieved. Parts equal to "ANY_TAG[ANY_INDEX]" are counted.
Definition at line 274 of file ParameterOption.cc.
Referenced by getIndexInAddr(), and operator==().
| Integer Arcane::ParameterOptionAddr::nbIndexToGetInAddr | ( | ) | const |
Method allowing the number of "GET_INDEX" in the address to be known.
Definition at line 306 of file ParameterOption.cc.
Referenced by getIndexInAddr(), and Arcane::ParameterOptionElementsCollection::getIndexInAddr().
| bool Arcane::ParameterOptionAddr::operator!= | ( | const ParameterOptionAddr & | other | ) | const |
Definition at line 349 of file ParameterOption.cc.
| bool Arcane::ParameterOptionAddr::operator== | ( | const ParameterOptionAddr & | other | ) | const |
Equality operator. This operator takes into account ANY_TAG / ANY_INDEX. The address "aaa[1]/bbb[2]/ANY_TAG[ANY_INDEX]" will be equal to the address "aaa[1]/bbb[2]/ccc[5]/ddd[7]" or to the address "aaa[1]/bbb[ANY_INDEX]/ccc[5]/ddd[7]" or to the address "aaa[1]/bbb[2]" but not to the address "aaa[1]".
Definition at line 321 of file ParameterOption.cc.
References addrPart(), Arcane::ParameterOptionAddrPart::isAny(), nbAddrPart(), and ParameterOptionAddr().
|
private |
Definition at line 220 of file ParameterOption.h.