Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::CaseOptionMultiSimpleT< T > Class Template Reference

Data set option of simple type list (real, integer, boolean, ...). More...

#include <arcane/core/CaseOptionSimple.h>

Public Types

using Type = typename CaseOptionTraitsT<T>::ContainerType
 Type of the option value.
using ReferenceType = typename CaseOptionTraitsT<T>::ReferenceType
using ConstReferenceType = typename CaseOptionTraitsT<T>::ConstReferenceType
using ArrayViewType = typename CaseOptionTraitsT<T>::ArrayViewType
 Type of the view on the option values.
using ConstArrayViewType = typename CaseOptionTraitsT<T>::ConstArrayViewType
 Type of the constant view on the option values.
Public Types inherited from Arcane::ArrayView< T >
using ThatClass = ArrayView<T>
typedef T value_type
 Type of the array elements.
typedef value_typepointer
 Pointer type of an array element.
typedef const value_typeconst_pointer
 Constant pointer type of an array element.
typedef ArrayIterator< pointeriterator
 Type of the iterator over an array element.
typedef ArrayIterator< const_pointerconst_iterator
 Type of the constant iterator over an array element.
typedef value_typereference
 Reference type of an array element.
typedef const value_typeconst_reference
 Constant reference type of an array element.
typedef Integer size_type
 Type indexing the array.
typedef std::ptrdiff_t difference_type
 Type of a distance between array iterator elements.
typedef IterT< ArrayView< T > > iter
 Type of an iterator over the entire array.
typedef ConstIterT< ArrayView< T > > const_iter
 Type of a constant iterator over the entire array.
typedef std::reverse_iterator< iteratorreverse_iterator
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator

Public Member Functions

 CaseOptionMultiSimpleT (const CaseOptionBuildInfo &cob)
 CaseOptionMultiSimpleT (const CaseOptionBuildInfo &cob, const String &physical_unit)
ArrayView< T > operator() ()
const ArrayView< T > operator() () const
 operator ArrayView< T > ()
 Conversion to the constant view.
 operator ConstArrayView< T > () const
 Conversion to the constant view.
ConstArrayViewType view () const
 Constant view on the option elements.
ArrayViewType view ()
 View on the option elements.
ConstReferenceType operator[] (Integer i) const
ReferenceType operator[] (Integer i)
void print (const String &lang, std::ostream &o) const override
 Prints the option value in the language lang, to the stream o.
ICaseFunctionfunction () const override
 Returns the function linked to this option or nullptr if none exists.
void updateFromFunction (Real, Integer) override
 Updates the option value from a function.
ConstArrayView< T > values () const
const T & value (Integer index) const
Integer size () const
void visit (ICaseDocumentVisitor *visitor) const override
 Applies the visitor to this option.
bool isPresent () const
Public Member Functions inherited from Arcane::CaseOptionMultiSimple
 CaseOptionMultiSimple (const CaseOptionBuildInfo &cob)
Public Member Functions inherited from Arcane::CaseOptionBase
String trueName () const
 Returns the true name (untranslated) of the option.
String name () const
 Returns the option name corresponding to the data set language.
String translatedName (const String &lang) const
 Name of the option in the language lang. Returns name() if no translation exists.
void search (bool is_phase1)
 Retrieves the value from the configuration file for the variable.
ICaseMngcaseMng () const
 Case manager.
ICaseOptionListparentOptionList () const
 Parent OptionList.
ITraceMngtraceMng () const
 Trace manager.
ISubDomainsubDomain () const
 Sub-domain manager.
ICaseDocumentcaseDocument () const
 Returns the document manager.
ICaseDocumentFragmentcaseDocumentFragment () const
 Returns the document associated with this option.
void setRootElement (const XmlNode &root_element)
 Positions the root element at root_element.
XmlNode rootElement () const
 Returns the root element of the DOM.
Integer minOccurs () const
 Minimum number of occurrences (for a multiple option).
Integer maxOccurs () const
 Maximum number of occurrences (for a multiple option) (-1 == unbounded).
bool isOptional () const
 Allows knowing if an option is optional.
void addAlternativeNodeName (const String &lang, const String &name)
 Adds a translation for the option name.
void addDefaultValue (const String &category, const String &value)
 Adds the default value value to the category category.
void checkIsInitialized () const
 Throws an exception if the option has not been initialized.
Public Member Functions inherited from Arcane::ArrayView< T >
constexpr ArrayView () noexcept
 Constructs an empty view.
 ArrayView (const ArrayView< T > &from)=default
 Copy constructor from another view.
constexpr ArrayView (Integer asize, pointer ptr) noexcept
 Constructs a view over a memory region starting at ptr and.
template<std::size_t N>
constexpr ArrayView (std::array< T, N > &v)
ArrayView< T > & operator= (const ArrayView< T > &from)=default
 Copy assignment operator.
template<std::size_t N>
constexpr ArrayView< T > & operator= (std::array< T, N > &from)
constexpr reference operator[] (Integer i)
 i-th element of the array.
constexpr const_reference operator[] (Integer i) const
 i-th element of the array.
constexpr reference operator() (Integer i)
 i-th element of the array.
constexpr const_reference operator() (Integer i) const
 i-th element of the array.
constexpr const_reference item (Integer i) const
 i-th element of the array.
constexpr void setItem (Integer i, const_reference v)
 Sets the i-th element of the array.
constexpr Integer size () const noexcept
 Returns the size of the array.
constexpr Integer length () const noexcept
 Number of elements in the array.
constexpr iterator begin () noexcept
 Iterator to the first element of the array.
constexpr iterator end () noexcept
 Iterator to the first element after the end of the array.
constexpr const_iterator begin () const noexcept
 Constant iterator to the first element of the array.
constexpr const_iterator end () const noexcept
 Constant iterator to the first element after the end of the array.
constexpr reverse_iterator rbegin () noexcept
 Reverse iterator to the first element of the array.
constexpr const_reverse_iterator rbegin () const noexcept
 Reverse iterator to the first element of the array.
constexpr reverse_iterator rend () noexcept
 Reverse iterator to the first element after the end of the array.
constexpr const_reverse_iterator rend () const noexcept
 Reverse iterator to the first element after the end of the array.
ArrayRange< pointerrange ()
 Iteration range from the first to the last element.
ArrayRange< const_pointerrange () const
 Iteration range from the first to the last element.
constexpr pointer ptrAt (Integer index)
 Address of the index-th element.
constexpr const_pointer ptrAt (Integer index) const
 Address of the index-th element.
constexpr const_reference at (Integer i) const
void setAt (Integer i, const_reference value)
void fill (const T &o) noexcept
 Fills the array with the value o.
constexpr ConstArrayView< T > constView () const noexcept
 Constant view of this view.
constexpr ArrayView< T > subView (Integer abegin, Integer asize) noexcept
 Sub-view starting from element abegin and containing asize elements.
constexpr ThatClass subPart (Integer abegin, Integer asize) noexcept
 Sub-view starting from element abegin and containing asize elements.
constexpr ConstArrayView< T > subConstView (Integer abegin, Integer asize) const noexcept
 Constant sub-view starting from element abegin and containing asize elements.
constexpr ArrayView< T > subViewInterval (Integer index, Integer nb_interval)
 Sub-view corresponding to the interval index over nb_interval.
constexpr ThatClass subPartInterval (Integer index, Integer nb_interval)
 Sub-view corresponding to the interval index over nb_interval.
template<class U>
void copy (const U &copy_array)
 Copies the array copy_array into the instance.
constexpr bool empty () const noexcept
 Returns true if the array is empty (zero dimension).
bool contains (const_reference v) const
 true if the array contains the element with value v
void setArray (const ArrayView< T > &v) noexcept
constexpr pointer unguardedBasePointer () noexcept
 Pointer to the beginning of the view.
constexpr const_pointer unguardedBasePointer () const noexcept
 Constant pointer to the start of the view.
constexpr const_pointer data () const noexcept
 Pointer to the start of the view.
constexpr pointer data () noexcept
 Constant pointer to the start of the view.

Protected Member Functions

void _search (bool is_phase1) override
 Searches for the option value in the dataset.
virtual bool _allowPhysicalUnit ()
Protected Member Functions inherited from Arcane::CaseOptionBase
 CaseOptionBase (const CaseOptionBuildInfo &cob)
String _defaultValue () const
 Returns the default value of the option or 0 if none exists.
void _setDefaultValue (const String &def_value)
void _setIsInitialized ()
bool _isInitialized () const
void _checkIsInitialized () const
void _checkMinMaxOccurs (Integer nb_occur)
String _xpathFullName () const
Protected Member Functions inherited from Arcane::ArrayView< T >
constexpr pointer _ptr () noexcept
 Returns a pointer to the array.
constexpr const_pointer _ptr () const noexcept
 Returns a pointer to the array.
void _setArray (pointer v, Integer s) noexcept
 Modifies the pointer and size of the array.
void _setPtr (pointer v) noexcept
 Modifies the pointer to the start of the array.
void _setSize (Integer s) noexcept
 Modifies the size of the array.

Additional Inherited Members

Static Public Member Functions inherited from Arcane::ArrayView< T >
static constexpr ThatClass create (pointer ptr, Integer asize) noexcept
 Constructs a view over a memory region starting at ptr and.

Detailed Description

template<class T>
class Arcane::CaseOptionMultiSimpleT< T >

Data set option of simple type list (real, integer, boolean, ...).

Warning
Using the base class ArrayView<T> is obsolete and should no longer be used. The view() method allows retrieving a view on the option values.

Definition at line 330 of file CaseOptionSimple.h.

Member Typedef Documentation

◆ ArrayViewType

template<class T>
using Arcane::CaseOptionMultiSimpleT< T >::ArrayViewType = typename CaseOptionTraitsT<T>::ArrayViewType

Type of the view on the option values.

Definition at line 345 of file CaseOptionSimple.h.

◆ ConstArrayViewType

template<class T>
using Arcane::CaseOptionMultiSimpleT< T >::ConstArrayViewType = typename CaseOptionTraitsT<T>::ConstArrayViewType

Type of the constant view on the option values.

Definition at line 347 of file CaseOptionSimple.h.

◆ ConstReferenceType

template<class T>
using Arcane::CaseOptionMultiSimpleT< T >::ConstReferenceType = typename CaseOptionTraitsT<T>::ConstReferenceType

Definition at line 343 of file CaseOptionSimple.h.

◆ ReferenceType

template<class T>
using Arcane::CaseOptionMultiSimpleT< T >::ReferenceType = typename CaseOptionTraitsT<T>::ReferenceType

Definition at line 342 of file CaseOptionSimple.h.

◆ Type

template<class T>
using Arcane::CaseOptionMultiSimpleT< T >::Type = typename CaseOptionTraitsT<T>::ContainerType

Type of the option value.

Definition at line 341 of file CaseOptionSimple.h.

Constructor & Destructor Documentation

◆ CaseOptionMultiSimpleT() [1/2]

template<typename T>
Arcane::CaseOptionMultiSimpleT< T >::CaseOptionMultiSimpleT ( const CaseOptionBuildInfo & cob)

Definition at line 660 of file CaseOptionSimple.cc.

◆ CaseOptionMultiSimpleT() [2/2]

template<typename T>
Arcane::CaseOptionMultiSimpleT< T >::CaseOptionMultiSimpleT ( const CaseOptionBuildInfo & cob,
const String & physical_unit )

Definition at line 669 of file CaseOptionSimple.cc.

◆ ~CaseOptionMultiSimpleT()

template<typename T>
Arcane::CaseOptionMultiSimpleT< T >::~CaseOptionMultiSimpleT ( )

Definition at line 679 of file CaseOptionSimple.cc.

Member Function Documentation

◆ _allowPhysicalUnit()

template<typename T>
bool Arcane::CaseOptionMultiSimpleT< T >::_allowPhysicalUnit ( )
protectedvirtual

Definition at line 689 of file CaseOptionSimple.cc.

◆ _search()

◆ function()

template<class T>
ICaseFunction * Arcane::CaseOptionMultiSimpleT< T >::function ( ) const
inlineoverridevirtual

Returns the function linked to this option or nullptr if none exists.

Implements Arcane::CaseOptionBase.

Definition at line 401 of file CaseOptionSimple.h.

◆ isPresent()

template<class T>
bool Arcane::CaseOptionMultiSimpleT< T >::isPresent ( ) const
inline

Definition at line 412 of file CaseOptionSimple.h.

◆ operator ArrayView< T >()

template<class T>
Arcane::CaseOptionMultiSimpleT< T >::operator ArrayView< T > ( )
inline

Conversion to the constant view.

Definition at line 370 of file CaseOptionSimple.h.

References Arcane::ArrayView< T >::ArrayView().

◆ operator ConstArrayView< T >()

template<class T>
Arcane::CaseOptionMultiSimpleT< T >::operator ConstArrayView< T > ( ) const
inline

Conversion to the constant view.

Definition at line 378 of file CaseOptionSimple.h.

References Arcane::ArrayView< T >::ArrayView().

◆ operator()() [1/2]

template<class T>
ArrayView< T > Arcane::CaseOptionMultiSimpleT< T >::operator() ( )
inline

Definition at line 358 of file CaseOptionSimple.h.

◆ operator()() [2/2]

template<class T>
const ArrayView< T > Arcane::CaseOptionMultiSimpleT< T >::operator() ( ) const
inline

Definition at line 363 of file CaseOptionSimple.h.

◆ operator[]() [1/2]

template<class T>
ReferenceType Arcane::CaseOptionMultiSimpleT< T >::operator[] ( Integer i)
inline

Definition at line 396 of file CaseOptionSimple.h.

◆ operator[]() [2/2]

template<class T>
ConstReferenceType Arcane::CaseOptionMultiSimpleT< T >::operator[] ( Integer i) const
inline

Definition at line 395 of file CaseOptionSimple.h.

◆ print()

template<typename T>
void Arcane::CaseOptionMultiSimpleT< T >::print ( const String & lang,
std::ostream & o ) const
overridevirtual

Prints the option value in the language lang, to the stream o.

Implements Arcane::CaseOptionBase.

Definition at line 831 of file CaseOptionSimple.cc.

References Arcane::ArrayView< T >::_ptr().

◆ size()

template<class T>
Integer Arcane::CaseOptionMultiSimpleT< T >::size ( ) const
inline

Definition at line 410 of file CaseOptionSimple.h.

◆ updateFromFunction()

template<class T>
void Arcane::CaseOptionMultiSimpleT< T >::updateFromFunction ( Real current_time,
Integer current_iteration )
inlineoverridevirtual

Updates the option value from a function.

If the option is not linked to a workflow table, it does nothing. Otherwise, it uses current_time or current_iteration depending on the function parameter type to calculate the new option value. This value will then be normally accessible via the operator() method.

Implements Arcane::CaseOptionBase.

Definition at line 402 of file CaseOptionSimple.h.

◆ value()

template<class T>
const T & Arcane::CaseOptionMultiSimpleT< T >::value ( Integer index) const
inline

Definition at line 409 of file CaseOptionSimple.h.

◆ values()

template<class T>
ConstArrayView< T > Arcane::CaseOptionMultiSimpleT< T >::values ( ) const
inline

Definition at line 404 of file CaseOptionSimple.h.

◆ view() [1/2]

template<class T>
ArrayViewType Arcane::CaseOptionMultiSimpleT< T >::view ( )
inline

View on the option elements.

Definition at line 390 of file CaseOptionSimple.h.

◆ view() [2/2]

template<class T>
ConstArrayViewType Arcane::CaseOptionMultiSimpleT< T >::view ( ) const
inline

Constant view on the option elements.

Definition at line 385 of file CaseOptionSimple.h.

◆ visit()

template<typename T>
void Arcane::CaseOptionMultiSimpleT< T >::visit ( ICaseDocumentVisitor * visitor) const
overridevirtual

Applies the visitor to this option.

Implements Arcane::CaseOptionBase.

Definition at line 842 of file CaseOptionSimple.cc.


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