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

Class representing a collection of XML elements (a set of Arcane options). More...

#include <arcane/utils/internal/ParameterOption.h>

Collaboration diagram for Arcane::ParameterOptionElementsCollection:

Public Member Functions

void addParameter (const String &parameter, const String &value)
 Method allowing an option parameter to be added to the list of option parameters.
void addElement (StringView addr, StringView value)
std::optional< StringViewvalue (const ParameterOptionAddr &addr)
bool isExistAddr (const ParameterOptionAddr &addr)
 Method allowing to know if an address is present in the list of elements. ANY_TAG/ANY_INDEX are taken into account.
Integer countAddr (const ParameterOptionAddr &addr)
 Method allowing to know how many times an address is present in the list of elements. Method particularly useful with ANY_TAG/ANY_INDEX.
void getIndexInAddr (const ParameterOptionAddr &addr_with_get_index, UniqueArray< Integer > &indexes)
 Method allowing one or more indices to be retrieved in the list of addresses.

Private Attributes

UniqueArray< ParameterOptionElementm_elements

Detailed Description

Class representing a collection of XML elements (a set of Arcane options).

Definition at line 255 of file ParameterOption.h.

Member Function Documentation

◆ addElement()

void Arcane::ParameterOptionElementsCollection::addElement ( StringView addr,
StringView value )

Definition at line 425 of file ParameterOption.cc.

◆ addParameter()

void Arcane::ParameterOptionElementsCollection::addParameter ( const String & parameter,
const String & value )

Method allowing an option parameter to be added to the list of option parameters.

Warning
The two parameters are not copied! Only a view is retrieved. The user of this class must manage the lifetime of these objects.
Parameters
parameterThe raw option parameter (with "//" at the beginning).
valueThe value of the option.

Definition at line 414 of file ParameterOption.cc.

References Arcane::String::startsWith(), Arcane::StringView::subView(), and Arcane::String::view().

Here is the call graph for this function:

◆ countAddr()

Integer Arcane::ParameterOptionElementsCollection::countAddr ( const ParameterOptionAddr & addr)

Method allowing to know how many times an address is present in the list of elements. Method particularly useful with ANY_TAG/ANY_INDEX.

Parameters
addrThe address to search for.
Returns
The number of matches found.

Definition at line 463 of file ParameterOption.cc.

◆ getIndexInAddr()

void Arcane::ParameterOptionElementsCollection::getIndexInAddr ( const ParameterOptionAddr & addr_with_get_index,
UniqueArray< Integer > & indexes )

Method allowing one or more indices to be retrieved in the list of addresses.

The functioning of this method is simple. We have the following addresses: "aaa[1]/bbb[2]/ccc[1]/@name[1]". "aaa[1]/bbb[2]/ccc[2]/@name[1]". "ddd[1]/eee[2]". "fff[1]/ggg[2]/hhh[4]". The address in the parameter is the following: "aaa[1]/bbb[2]/ccc[GET_INDEX]/@name[1]". The indices added in the parameter array will be 1 and 2.

Warning: Having an input address with multiple "GET_INDEX" is allowed but it can be dangerous if the number of indices found per address is different for each address (if there are two "GET_INDEX" but in one of the addresses, there are not two matches, these potential matches will not be taken into account).

Parameters
addr_with_get_indexThe address containing "GET_INDEX" indices.
indexes[OUT] The array where the index or indices will be added (the array is not cleared before use).

Definition at line 477 of file ParameterOption.cc.

References Arcane::Array< T >::addRange(), and Arcane::ParameterOptionAddr::nbIndexToGetInAddr().

Here is the call graph for this function:

◆ isExistAddr()

bool Arcane::ParameterOptionElementsCollection::isExistAddr ( const ParameterOptionAddr & addr)

Method allowing to know if an address is present in the list of elements. ANY_TAG/ANY_INDEX are taken into account.

Parameters
addrThe address to search for.
Returns
true if the address is found.

Definition at line 450 of file ParameterOption.cc.

◆ value()

std::optional< StringView > Arcane::ParameterOptionElementsCollection::value ( const ParameterOptionAddr & addr)

Definition at line 437 of file ParameterOption.cc.

Member Data Documentation

◆ m_elements

UniqueArray<ParameterOptionElement> Arcane::ParameterOptionElementsCollection::m_elements
private

Definition at line 326 of file ParameterOption.h.


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