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

Class representing a part of a data set option address. Note that in XML, the index starts at 1 and not at 0. More...

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

Collaboration diagram for Arcane::ParameterOptionAddrPart:

Public Member Functions

 ParameterOptionAddrPart ()
 Constructor. Sets the tag to ANY_TAG and the index to ANY_INDEX.
 ParameterOptionAddrPart (const StringView tag)
 Constructor. Sets the index to 1.
 ParameterOptionAddrPart (const StringView tag, const Integer index)
 Constructor.
StringView tag () const
Integer index () const
void setTag (const StringView tag)
void setIndex (const Integer index)
bool isAny () const
 isAny if ANY_TAG and ANY_INDEX.
bool operator== (const ParameterOptionAddrPart &other) const
 Equality operator. The ANY_TAG tag is equal to all tags. The ANY_INDEX index is equal to all indices. The GET_INDEX index is equal to all indices.
bool operator!= (const ParameterOptionAddrPart &other) const

Static Public Attributes

static constexpr const char * ANY_TAG = "/"
static constexpr Integer ANY_INDEX = -1
static constexpr Integer GET_INDEX = -2

Private Attributes

StringView m_tag
Integer m_index

Detailed Description

Class representing a part of a data set option address. Note that in XML, the index starts at 1 and not at 0.

A special tag named ANY_TAG represents any tag. Two special indices are also available:

  • ANY_INDEX: Represents any index,
  • GET_INDEX: Represents an index to be retrieved (see the ParameterOptionAddr class). These elements are useful for the == operator. Note that ANY_TAG cannot be defined without ANY_INDEX. Also, the tag cannot be empty.

Definition at line 45 of file ParameterOption.h.

Constructor & Destructor Documentation

◆ ParameterOptionAddrPart() [1/3]

Arcane::ParameterOptionAddrPart::ParameterOptionAddrPart ( )

Constructor. Sets the tag to ANY_TAG and the index to ANY_INDEX.

Definition at line 33 of file ParameterOption.cc.

Referenced by operator==().

Here is the caller graph for this function:

◆ ParameterOptionAddrPart() [2/3]

Arcane::ParameterOptionAddrPart::ParameterOptionAddrPart ( const StringView tag)
explicit

Constructor. Sets the index to 1.

Parameters
tagThe tag of this address part. This tag cannot be ANY_TAG.

Definition at line 42 of file ParameterOption.cc.

◆ ParameterOptionAddrPart() [3/3]

Arcane::ParameterOptionAddrPart::ParameterOptionAddrPart ( const StringView tag,
const Integer index )

Constructor.

Parameters
tagThe tag of this address part. This tag cannot be ANY_TAG if the index is not ANY_INDEX.
indexThe index of this address part.

Definition at line 54 of file ParameterOption.cc.

Member Function Documentation

◆ index()

Integer Arcane::ParameterOptionAddrPart::index ( ) const

Definition at line 75 of file ParameterOption.cc.

◆ isAny()

bool Arcane::ParameterOptionAddrPart::isAny ( ) const

isAny if ANY_TAG and ANY_INDEX.

Definition at line 105 of file ParameterOption.cc.

Referenced by Arcane::ParameterOptionAddr::operator==().

Here is the caller graph for this function:

◆ operator!=()

bool Arcane::ParameterOptionAddrPart::operator!= ( const ParameterOptionAddrPart & other) const

Definition at line 124 of file ParameterOption.cc.

◆ operator==()

bool Arcane::ParameterOptionAddrPart::operator== ( const ParameterOptionAddrPart & other) const

Equality operator. The ANY_TAG tag is equal to all tags. The ANY_INDEX index is equal to all indices. The GET_INDEX index is equal to all indices.

Definition at line 114 of file ParameterOption.cc.

References ParameterOptionAddrPart().

Here is the call graph for this function:

◆ setIndex()

void Arcane::ParameterOptionAddrPart::setIndex ( const Integer index)

Definition at line 96 of file ParameterOption.cc.

◆ setTag()

void Arcane::ParameterOptionAddrPart::setTag ( const StringView tag)

If the index is ANY_INDEX, the tag cannot be ANY_TAG. Be careful about the lifetime of tag.

Definition at line 84 of file ParameterOption.cc.

◆ tag()

StringView Arcane::ParameterOptionAddrPart::tag ( ) const

Definition at line 66 of file ParameterOption.cc.

Member Data Documentation

◆ ANY_INDEX

Integer Arcane::ParameterOptionAddrPart::ANY_INDEX = -1
staticconstexpr

Definition at line 51 of file ParameterOption.h.

◆ ANY_TAG

const char* Arcane::ParameterOptionAddrPart::ANY_TAG = "/"
staticconstexpr

Definition at line 50 of file ParameterOption.h.

◆ GET_INDEX

Integer Arcane::ParameterOptionAddrPart::GET_INDEX = -2
staticconstexpr

Definition at line 52 of file ParameterOption.h.

◆ m_index

Integer Arcane::ParameterOptionAddrPart::m_index
private

Definition at line 101 of file ParameterOption.h.

◆ m_tag

StringView Arcane::ParameterOptionAddrPart::m_tag
private

Definition at line 100 of file ParameterOption.h.


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