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

Class allowing easy manipulation of a seed. More...

#include <arcane/core/IRandomNumberGenerator.h>

Collaboration diagram for Arcane::RNGSeedHelper:

Public Member Functions

 RNGSeedHelper (ByteArrayView av)
 Class constructor.
template<class T>
 RNGSeedHelper (T *var)
 Class constructor.
template<class T>
bool setValue (T value_in)
 Method allowing setting a value in the seed.
template<class T>
bool value (T &value_out, bool without_size_check=true) const
 Method allowing retrieval of the seed value.
template<class T>
bool value (T *value_out, bool without_size_check=true) const
 Method allowing retrieval of the seed value.
Integer sizeOfSeed () const
 Method allowing retrieval of the seed size.
ByteConstArrayView constView () const
 Method allowing retrieval of a constant view.
ByteArrayView view ()
 Method allowing retrieval of a view.
template<class T>
RNGSeedHelperoperator= (T new_value)
 Copy operator from a seed value.
ByteUniqueArray copy ()
 Method allowing retrieval of a copy of the Byte array.

Protected Attributes

ByteArrayView m_seed

Detailed Description

Class allowing easy manipulation of a seed.

A seed is represented by an array of Bytes. This class uses an ArrayView of this array.

This class allows defining a value in the array and retrieving that value (other things).

This class does not store the array but only an ArrayView of this array.

Definition at line 45 of file IRandomNumberGenerator.h.

Constructor & Destructor Documentation

◆ RNGSeedHelper() [1/2]

Arcane::RNGSeedHelper::RNGSeedHelper ( ByteArrayView av)
inline

Class constructor.

Parameters
avAn ArrayView of an array representing a seed.

Definition at line 54 of file IRandomNumberGenerator.h.

Referenced by operator=().

Here is the caller graph for this function:

◆ RNGSeedHelper() [2/2]

template<class T>
Arcane::RNGSeedHelper::RNGSeedHelper ( T * var)
inline

Class constructor.

Template Parameters
TA base type.
Parameters
varA pointer to the seed (note, does not make a copy of the value!).

Definition at line 67 of file IRandomNumberGenerator.h.

Member Function Documentation

◆ constView()

ByteConstArrayView Arcane::RNGSeedHelper::constView ( ) const
inline

Method allowing retrieval of a constant view.

Returns
ByteConstArrayView The view.

Definition at line 154 of file IRandomNumberGenerator.h.

Referenced by Arcane::PDESRandomNumberGeneratorService::viewSeed().

Here is the caller graph for this function:

◆ copy()

ByteUniqueArray Arcane::RNGSeedHelper::copy ( )
inline

Method allowing retrieval of a copy of the Byte array.

Returns
ByteUniqueArray The copy of the Byte array.

Definition at line 188 of file IRandomNumberGenerator.h.

Referenced by Arcane::PDESRandomNumberGeneratorService::generateRandomSeed(), and Arcane::PDESRandomNumberGeneratorService::generateRandomSeed().

Here is the caller graph for this function:

◆ operator=()

template<class T>
RNGSeedHelper & Arcane::RNGSeedHelper::operator= ( T new_value)
inline

Copy operator from a seed value.

Template Parameters
TThe seed type.
Parameters
valueThe seed value.
Returns
RNGSeedHelper& The destination seed.

Definition at line 177 of file IRandomNumberGenerator.h.

References RNGSeedHelper(), and setValue().

Here is the call graph for this function:

◆ setValue()

template<class T>
bool Arcane::RNGSeedHelper::setValue ( T value_in)
inline

Method allowing setting a value in the seed.

Template Parameters
TThe value type.
Parameters
value_inThe future value of the seed.
Returns
true If the value could be assigned.
false If the value could not be assigned.

Definition at line 85 of file IRandomNumberGenerator.h.

Referenced by operator=().

Here is the caller graph for this function:

◆ sizeOfSeed()

Integer Arcane::RNGSeedHelper::sizeOfSeed ( ) const
inline

Method allowing retrieval of the seed size.

Returns
Integer The seed size (in bytes).

Definition at line 144 of file IRandomNumberGenerator.h.

Referenced by Arcane::PDESRandomNumberGeneratorService::initSeed().

Here is the caller graph for this function:

◆ value() [1/2]

template<class T>
bool Arcane::RNGSeedHelper::value ( T & value_out,
bool without_size_check = true ) const
inline

Method allowing retrieval of the seed value.

Template Parameters
TThe seed type.
Parameters
value_out[OUT] The seed value.
without_size_checkIf value truncation is allowed.
Returns
true If the value could be retrieved.
false If the value could not be retrieved or if the array has a null size.

Definition at line 108 of file IRandomNumberGenerator.h.

Referenced by Arcane::PDESRandomNumberGeneratorService::initSeed().

Here is the caller graph for this function:

◆ value() [2/2]

template<class T>
bool Arcane::RNGSeedHelper::value ( T * value_out,
bool without_size_check = true ) const
inline

Method allowing retrieval of the seed value.

Template Parameters
TThe seed type.
Parameters
value_out[OUT] The seed value.
without_size_checkIf value truncation is allowed.
Returns
true If the value could be retrieved.
false If the value could not be retrieved or if the array has a null size.

Definition at line 129 of file IRandomNumberGenerator.h.

◆ view()

ByteArrayView Arcane::RNGSeedHelper::view ( )
inline

Method allowing retrieval of a view.

Returns
ByteArrayView The view.

Definition at line 164 of file IRandomNumberGenerator.h.

Member Data Documentation

◆ m_seed

ByteArrayView Arcane::RNGSeedHelper::m_seed
protected

Definition at line 195 of file IRandomNumberGenerator.h.


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