TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Synonyme_info.h
1/****************************************************************************
2* Copyright (c) 2023, CEA
3* All rights reserved.
4*
5* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
9*
10* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
12* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13*
14*****************************************************************************/
15
16#ifndef Synonyme_info_included
17#define Synonyme_info_included
18
19#include <arch.h>
20
21class Objet_U;
22class Sortie;
23class Noms;
24class Nom;
25
26// Le pragma est pour desactiver le -Wunused-variable avec nvc++:
27// Macro to declare A and B synonyms:
28#ifdef __NVCOMPILER
29#define Add_synonym(A,B) _Pragma("diag_suppress 177") \
30const Synonyme_info name2(name2(synonym_,A),__LINE__)(B,A::info_obj.name())
31#else
32#define Add_synonym(A,B) const Synonyme_info name2(name2(synonym_,A),__LINE__)(B,A::info_obj.name())
33#endif
34
35/*! @brief modelise une information de synonyme pour les Objet_U
36 *
37 * @sa Objet_U Nom
38 */
40{
41public:
44 Synonyme_info(const char* name, const char* org);
45
46 inline const char* org_name_() const { return org; }
47 inline const char* nom() const { return n; }
48
49 // Methodes statiques :
50 static Sortie& hierarchie(Sortie&) ;
51 static int est_un_synonyme(const char*) ;
52
53 static const Synonyme_info * synonyme_info_from_name(const char * synonyme_name);
54 // static Objet_U* instance(const char* typ);
55 static void ajouter_synonyme(const Synonyme_info& synonyme_info);
56protected:
57
58private:
59 Synonyme_info(Synonyme_info&) {}; // Constructeur par copie invalide
60 Synonyme_info& operator=(Synonyme_info&); // Operateur= invalide
61
62
63 static void retirer_synonyme(const char *nom );
64 static int search_synonyme_info_name(const char *nom, int& index);
65
66 // Le nom de la classe.
67 const char* n = "rien";
68 const char* org = "rien";
69
70 // Liste des Synonyme_info des classes declarees par declare_base/declare_instanciable
71 // La liste est triee par ordre alphabetique (minuscules/majuscules indifferentes)
72 static const Synonyme_info** les_synonymes;
73
74 // Nombre de classes enregistrees dans "les_synonymes" et "synonymes_homonymes"
75 static int nb_classes;
76 // Taille memoire du tableau "les_synonymes" et "synonymes_homonymes"
77 // (tableau redimensionne par blocs)
78 static int les_synonymes_memsize;
79};
80
81#endif /* Synonyme_info_included */
class Nom Une chaine de caractere pour nommer les objets de TRUST
Definition Nom.h:31
Un tableau de chaine de caracteres (VECT(Nom)).
Definition Noms.h:26
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
Classe de base des flux de sortie.
Definition Sortie.h:52
modelise une information de synonyme pour les Objet_U
const char * nom() const
static const Synonyme_info * synonyme_info_from_name(const char *synonyme_name)
Methode statique qui renvoie un pointeur vers le Synonyme_info dont le nom est "synonyme_name".
static void ajouter_synonyme(const Synonyme_info &synonyme_info)
Methode statique appelee par les constructeurs de Synonyme_info pour ajouter un nouveau synonyme a la...
static int est_un_synonyme(const char *)
Test d'existence d'une classe du synonyme indique si il existe une classe T dont le Synonyme_info a.
const char * org_name_() const
static Sortie & hierarchie(Sortie &)
Ecriture de toute la hierarchie du synonyme considere sur un flux de sortie.