TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Nom Class Reference

class Nom: a character string for naming TRUST objects. More...

#include <Nom.h>

Inheritance diagram for Nom:
[legend]
Collaboration diagram for Nom:
[legend]

Public Member Functions

 Nom ()
 Default constructor. Creates the string "??".
 Nom (int i)
 Constructs a name from an integer. The string created is the decimal representation of the integer.
 Nom (long i)
 Nom (long long i)
 Nom (const char *nom)
 Constructs a name from a character string. The string is copied.
 Nom (const std::string &nom)
 Nom (const Nom &)
 Copy constructor for a name.
 Nom (char c)
 Constructs a name from a single character.
 Nom (double)
 Constructs a name from a floating-point number. The string created is the decimal representation of the real number (snprintf).
 Nom (double le_reel, const char *format)
 Constructs a name from a floating-point number with a custom format. The string created is the decimal representation of the real number (snprintf).
 ~Nom () override
 Destructor.
 operator const char * () const
 Returns a pointer to the character string of the name.
Nommajuscule ()
 Converts the name to uppercase. Only letters 'a'-'z' are modified.
int est_egal_a (const Objet_U &) const override
 Comparison with an Objet_U. The Objet_U is cast to Nom for the comparison.
int longueur () const
 Returns the number of characters in the Nom string, including the null terminator.
const Nomle_nom () const override
 Returns *this.
Nomoperator= (const char *const)
 Copies the string nom.
Nomoperator= (const Nom &)
 Copies the Nom nom.
Nom operator+ (const Nom &) const
 Concatenation with a Nom.
Nomoperator+= (const Nom &x)
 Concatenation with a Nom.
Nomoperator+= (const char *)
Nomoperator+= (char x)
 String concatenation.
Nomoperator+= (unsigned char x)
Nomoperator+= (int x)
Nomsuffix (const char *const)
 Suffix extraction: Nom x("azerty");.
const Nom getSuffix (const char *const) const
Nomprefix (const char *const)
const Nom getPrefix (const char *const) const
Nom nom_me (int, const char *prefix=0, int without_padding=0) const
 Inserts _prefix000n (n=me() or nproc()) into a file name (e.g. toto.titi) to produce toto_prefix000n.titi.
Nom substr_old (const int, const int) const
 Returns a name using the usual substr command. NOTE: deb = 1 means the first character of the string.
Nom basename () const
 Returns the filename part if the name is in the form /toto/titi/filename.
virtual int find (const char *const n) const
virtual int debute_par (const char *const n) const
virtual int finit_par (const char *const n) const
int find (const std::string &n) const
int debute_par (const std::string &) const
int finit_par (const std::string &) const
bool contient (const Nom &nom) const
const char * getChar () const
const std::string & getString () const
std::string & getString ()
Public Member Functions inherited from Objet_U
 ~Objet_U () override
 Destructor. Removes the object from the list of objects registered in "memory".
int numero () const
 Returns the index of the object in Memoire::data.
virtual int duplique () const =0
virtual SortieprintOn (Sortie &) const
 Writes the object to an output stream. Virtual method to override.
virtual EntreereadOn (Entree &)
 Reads an Objet_U from an input stream. Virtual method to override.
virtual unsigned taille_memoire () const =0
virtual void nommer (const Nom &)
 Assigns a name to the Objet_U. Virtual method to override.
virtual int reprendre (Entree &)
 Restores an Objet_U from an input stream. Virtual method to override.
virtual int sauvegarder (Sortie &) const
 Saves an Objet_U to an output stream. Virtual method to override.
int get_object_id () const
 Returns the unique identifier of the object (object_id_).
virtual const Type_infoget_info () const
 Returns type information for the Objet_U.
const Nomque_suis_je () const
 Returns the string identifying the class.
const char * le_type () const
 Returns the type name of the Objet_U.
virtual int change_num (const int *const)
 Changes the internal number of the Objet_U.
virtual int lire_motcle_non_standard (const Motcle &motlu, Entree &is)
 Reads non-simple-type parameters of an Objet_U from an input stream.
virtual int associer_ (Objet_U &)
 Associates the Objet_U with another Objet_U. Virtual method to override.
const Interpreteinterprete () const
Interpreteinterprete ()
Public Member Functions inherited from Process
virtual ~Process ()

Protected Attributes

std::string nom_

Friends

int operator== (const Nom &un_nom, const char *const un_autre)
 Compares a name with a character string using strcmp.
int operator!= (const Nom &un_nom, const char *un_autre)
 Compares a name with a character string.
int operator== (const Nom &un_nom, const Nom &un_autre)
int operator!= (const Nom &un_nom, const Nom &un_autre)
int operator== (const char *const un_autre, const Nom &un_nom)
int operator!= (const char *const un_autre, const Nom &un_nom)
bool operator< (const Nom &n1, const Nom &n2)

Additional Inherited Members

Static Public Member Functions inherited from Objet_U
static const Nomnom_du_cas ()
 Returns a constant reference to the case name. This method is static.
static Nomget_set_nom_du_cas ()
 Returns a non-constant reference to the case name (to allow modification). This method is static.
static const Type_infoinfo ()
 Returns type information for the Objet_U (static version).
static const Objet_Uself_cast (const Objet_U &)
 Method added for casting in Python.
static Objet_Uself_cast (Objet_U &)
Static Public Member Functions inherited from Process
static int me ()
 Returns the rank of the local processor in the current communication group. See Comm_Group::rank() and PE_Groups::current_group().
static int nproc ()
 Returns the number of processors in the current group. See Comm_Group::nproc() and PE_Groups::current_group().
static bool is_parallel ()
static void exit (int exit_code=-1)
 Exit routine for TRUST within a Kokkos region.
static double mp_sum (double)
 Computes the sum of x over all processors in the current group.
static float mp_sum (float)
static trustIdType mp_sum (trustIdType)
 Computes the sum of x over all processors in the current group.
static double mp_max (double)
static double mp_min (double)
static int mp_max (int)
 Returns the maximum value of x across all processors in the current group.
static int mp_min (int)
 Returns the minimum value of x across all processors in the current group.
static double mp_sum_as_double (int v)
static trustIdType mppartial_sum (trustIdType i)
 Computes the partial sum of x over processors 0 to me()-1 (returns 0 on processor 0).
template<typename T>
static void mp_sum_for_each (T &arg1, T &arg2)
 C++14 compatible mp_sum_for_each: combine multiple mp_sum calls into one collective operation Usage: mp_sum_for_each(a, b); mp_sum_for_each(a, b, c); mp_sum_for_each(a, b, c, d); mp_sum_for_each(a, b, c, d, e); All arguments must be of the same type (double or int) and are modified in place. Supports 2-5 parameters.
template<typename T>
static void mp_sum_for_each (T &arg1, T &arg2, T &arg3)
template<typename T>
static void mp_sum_for_each (T &arg1, T &arg2, T &arg3, T &arg4)
template<typename T>
static void mp_sum_for_each (T &arg1, T &arg2, T &arg3, T &arg4, T &arg5)
template<typename T>
static void mp_max_for_each (T &arg1, T &arg2)
 C++14 compatible mp_max_for_each: combine multiple mp_max calls into one collective operation.
template<typename T>
static void mp_max_for_each (T &arg1, T &arg2, T &arg3)
template<typename T>
static void mp_max_for_each (T &arg1, T &arg2, T &arg3, T &arg4)
template<typename T>
static void mp_max_for_each (T &arg1, T &arg2, T &arg3, T &arg4, T &arg5)
template<typename T>
static void mp_min_for_each (T &arg1, T &arg2)
 C++14 compatible mp_min_for_each: combine multiple mp_min calls into one collective operation.
template<typename T>
static void mp_min_for_each (T &arg1, T &arg2, T &arg3)
template<typename T>
static void mp_min_for_each (T &arg1, T &arg2, T &arg3, T &arg4)
template<typename T>
static void mp_min_for_each (T &arg1, T &arg2, T &arg3, T &arg4, T &arg5)
template<typename _TYPE_>
static void mp_sum_for_each_item (TRUSTArray< _TYPE_ > &x, int n=-1)
template<typename _TYPE_>
static void mp_max_for_each_item (TRUSTArray< _TYPE_ > &x, int n=-1)
template<typename _TYPE_>
static void mp_min_for_each_item (TRUSTArray< _TYPE_ > &x, int n=-1)
static bool mp_and (bool)
 Computes the logical AND of b across all processors in the current group.
static bool mp_or (bool)
static int check_int_overflow (trustIdType)
static int je_suis_maitre ()
 Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
static KOKKOS_INLINE_FUNCTION void Kokkos_exit (const char *)
 Exit routine for TRUST within a Kokkos region.
static int node_master ()
 Returns 1 if on the NUMA node master processor, 0 otherwise.
static void exit (const Nom &message, int exit_code=-1)
static bool is_sequential ()
static void barrier ()
 Synchronizes all processors in the current group (waits until all processors have reached the barrier).
static void abort ()
 Abort routine for TRUST on a fatal error.
static SortieJournal (int message_level=0)
 Returns a static Sortie object used as an event journal.
static double ram_processeur ()
static void imprimer_ram_totale (int all_process=0)
static bool force_single_file (const int ranks, const Nom &filename)
Static Public Attributes inherited from Objet_U
static double precision_geom = 1e-10
static constexpr bool HAS_POINTER = false
static int dimension =0
static int format_precision_geom =11
static int axi =0
static int bidim_axi =0
static int DEACTIVATE_SIGINT_CATCH =0
static Type_info info_obj
static bool disable_TU =false
 Flag to disable or not the writing of the .TU files.
static bool stat_per_proc_perf_log =false
 Flag to enable the writing of the statistics detailed per processor in _csv.TU file.
Static Public Attributes inherited from Process
static int exception_sur_exit =0
static int multiple_files =5120
Protected Member Functions inherited from Objet_U
 Objet_U ()
 Default constructor: assigns a unique identifier to the object (object_id_) and registers the object in "memory" by giving it a num_obj number.
 Objet_U (const Objet_U &)
 Copy constructor.
const Objet_Uoperator= (const Objet_U &)
 Assignment operator: does nothing (the number and identifier are preserved).
virtual void set_param (Param &) const

Detailed Description

class Nom: a character string for naming TRUST objects.

See also
Motcle

Definition at line 30 of file Nom.h.

Constructor & Destructor Documentation

◆ Nom() [1/10]

Nom::Nom ( )

Default constructor. Creates the string "??".

Definition at line 59 of file Nom.cpp.

◆ Nom() [2/10]

Nom::Nom ( int i)

Constructs a name from an integer. The string created is the decimal representation of the integer.

Example: Nom(128) creates the string "128".

Parameters
(inti) the integer to use

Definition at line 80 of file Nom.cpp.

◆ Nom() [3/10]

Nom::Nom ( long i)

Definition at line 89 of file Nom.cpp.

◆ Nom() [4/10]

Nom::Nom ( long long i)

Definition at line 98 of file Nom.cpp.

◆ Nom() [5/10]

Nom::Nom ( const char * nom)

Constructs a name from a character string. The string is copied.

Parameters
(constchar* nom) the character string to use

Definition at line 111 of file Nom.cpp.

◆ Nom() [6/10]

Nom::Nom ( const std::string & nom)

Definition at line 115 of file Nom.cpp.

◆ Nom() [7/10]

Nom::Nom ( const Nom & nom)

Copy constructor for a name.

Parameters
(constNom& nom) the name to use

Definition at line 124 of file Nom.cpp.

◆ Nom() [8/10]

Nom::Nom ( char c)

Constructs a name from a single character.

Parameters
(charc) the character of the name

Definition at line 68 of file Nom.cpp.

◆ Nom() [9/10]

Nom::Nom ( double le_reel)

Constructs a name from a floating-point number. The string created is the decimal representation of the real number (snprintf).

Parameters
(doublele_reel) the real number to use

Definition at line 132 of file Nom.cpp.

◆ Nom() [10/10]

Nom::Nom ( double le_reel,
const char * format )

Constructs a name from a floating-point number with a custom format. The string created is the decimal representation of the real number (snprintf).

The format of the number in the string is given by format.

Parameters
(doublele_reel) the real number to use

Definition at line 146 of file Nom.cpp.

◆ ~Nom()

Nom::~Nom ( )
override

Destructor.

Definition at line 169 of file Nom.cpp.

Member Function Documentation

◆ basename()

Nom Nom::basename ( ) const

Returns the filename part if the name is in the form /toto/titi/filename.

Definition at line 478 of file Nom.cpp.

◆ contient()

bool Nom::contient ( const Nom & nom) const
inline

Definition at line 86 of file Nom.h.

◆ debute_par() [1/2]

int Nom::debute_par ( const char *const n) const
virtual

Reimplemented in Motcle.

Definition at line 314 of file Nom.cpp.

◆ debute_par() [2/2]

int Nom::debute_par ( const std::string & ch) const

Definition at line 289 of file Nom.cpp.

◆ est_egal_a()

int Nom::est_egal_a ( const Objet_U & x) const
overridevirtual

Comparison with an Objet_U. The Objet_U is cast to Nom for the comparison.

Parameters
(constObjet_U& x) the Objet_U to use for comparison
Returns
(int) 1 if equal

Reimplemented from Objet_U.

Definition at line 365 of file Nom.cpp.

◆ find() [1/2]

int Nom::find ( const char *const n) const
virtual

Reimplemented in Motcle.

Definition at line 309 of file Nom.cpp.

◆ find() [2/2]

int Nom::find ( const std::string & n) const

Definition at line 303 of file Nom.cpp.

◆ finit_par() [1/2]

int Nom::finit_par ( const char *const n) const
virtual

Reimplemented in Motcle.

Definition at line 319 of file Nom.cpp.

◆ finit_par() [2/2]

int Nom::finit_par ( const std::string & s) const

Definition at line 294 of file Nom.cpp.

◆ getChar()

const char * Nom::getChar ( ) const
inline

Definition at line 91 of file Nom.h.

◆ getPrefix()

const Nom Nom::getPrefix ( const char * const s) const

Definition at line 335 of file Nom.cpp.

◆ getString() [1/2]

std::string & Nom::getString ( )
inline

Definition at line 93 of file Nom.h.

◆ getString() [2/2]

const std::string & Nom::getString ( ) const
inline

Definition at line 92 of file Nom.h.

◆ getSuffix()

const Nom Nom::getSuffix ( const char * const s) const

Definition at line 276 of file Nom.cpp.

◆ le_nom()

const Nom & Nom::le_nom ( ) const
overridevirtual

Returns *this.

Returns
(const Nom&) reference to the Nom

Reimplemented from Objet_U.

Definition at line 555 of file Nom.cpp.

◆ longueur()

int Nom::longueur ( ) const

Returns the number of characters in the Nom string, including the null terminator.

Example: Nom("hello").longueur() == 6.

Definition at line 187 of file Nom.cpp.

◆ majuscule()

Nom & Nom::majuscule ( )

Converts the name to uppercase. Only letters 'a'-'z' are modified.

Definition at line 176 of file Nom.cpp.

◆ nom_me()

Nom Nom::nom_me ( int n,
const char * prefixe = 0,
int without_padding = 0 ) const

Inserts _prefix000n (n=me() or nproc()) into a file name (e.g. toto.titi) to produce toto_prefix000n.titi.

Parameters
(without_padding)flag indicating that leading zeros should not be added before n

Definition at line 380 of file Nom.cpp.

◆ operator const char *()

Nom::operator const char * ( ) const

Returns a pointer to the character string of the name.

Returns
(char*) pointer to the character string of the name

Definition at line 499 of file Nom.cpp.

◆ operator+()

Nom Nom::operator+ ( const Nom & x) const

Concatenation with a Nom.

Parameters
(constNom& x) the name to concatenate
Returns
(Nom) the new Nom created by concatenating this and x

Definition at line 353 of file Nom.cpp.

◆ operator+=() [1/5]

Nom & Nom::operator+= ( char x)

String concatenation.

Definition at line 234 of file Nom.cpp.

◆ operator+=() [2/5]

Nom & Nom::operator+= ( const char * x)

Definition at line 225 of file Nom.cpp.

◆ operator+=() [3/5]

Nom & Nom::operator+= ( const Nom & x)

Concatenation with a Nom.

Parameters
(constNom& x) the name to concatenate
Returns
(Nom&) reference to this

Definition at line 219 of file Nom.cpp.

◆ operator+=() [4/5]

Nom & Nom::operator+= ( int x)

Definition at line 253 of file Nom.cpp.

◆ operator+=() [5/5]

Nom & Nom::operator+= ( unsigned char x)

Definition at line 243 of file Nom.cpp.

◆ operator=() [1/2]

Nom & Nom::operator= ( const char * const nom)

Copies the string nom.

BM modification so that nom can point to a sub-part of nom_.

Definition at line 197 of file Nom.cpp.

◆ operator=() [2/2]

Nom & Nom::operator= ( const Nom & nom)

Copies the Nom nom.

Parameters
(constNom& nom) the name to copy
Returns
(Nom&) reference to this, representing the string of Nom nom

Definition at line 208 of file Nom.cpp.

◆ prefix()

Nom & Nom::prefix ( const char * const s)

Definition at line 324 of file Nom.cpp.

◆ substr_old()

Nom Nom::substr_old ( const int deb,
const int la_longueur ) const

Returns a name using the usual substr command. NOTE: deb = 1 means the first character of the string.

Definition at line 466 of file Nom.cpp.

◆ suffix()

Nom & Nom::suffix ( const char * const s)

Suffix extraction: Nom x("azerty");.

x.suffix("aze") leaves x containing "rty".
Parameters
(constchar* const ch) character string to use as prefix to strip
Returns
(Nom&) reference to this

Definition at line 266 of file Nom.cpp.

◆ operator!= [1/3]

int operator!= ( const char * const un_autre,
const Nom & un_nom )
friend

Definition at line 540 of file Nom.cpp.

◆ operator!= [2/3]

int operator!= ( const Nom & un_nom,
const char * un_autre )
friend

Compares a name with a character string.

Parameters
(constNom& un_nom)
(constchar* const un_autre)
Returns
(int) 1 if the names are different, 0 otherwise

Definition at line 530 of file Nom.cpp.

◆ operator!= [3/3]

int operator!= ( const Nom & un_nom,
const Nom & un_autre )
friend

Definition at line 535 of file Nom.cpp.

◆ operator<

bool operator< ( const Nom & n1,
const Nom & n2 )
friend

Definition at line 545 of file Nom.cpp.

◆ operator== [1/3]

int operator== ( const char * const un_autre,
const Nom & un_nom )
friend

Definition at line 519 of file Nom.cpp.

◆ operator== [2/3]

int operator== ( const Nom & un_nom,
const char * const un_autre )
friend

Compares a name with a character string using strcmp.

Parameters
(constNom& un_nom)
(constchar* const un_autre)
Returns
(int) 1 if the names are equal, 0 otherwise

Definition at line 510 of file Nom.cpp.

◆ operator== [3/3]

int operator== ( const Nom & un_nom,
const Nom & un_autre )
friend

Definition at line 515 of file Nom.cpp.

Member Data Documentation

◆ nom_

std::string Nom::nom_
protected

Definition at line 97 of file Nom.h.


The documentation for this class was generated from the following files:
  • /home/docs/trust-code/src/Kernel/Utilitaires/Nom.h
  • /home/docs/trust-code/src/Kernel/Utilitaires/Nom.cpp