TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Motcle.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 Motcle_included
17#define Motcle_included
18
19#include <TRUST_Vector.h>
20#include <Nom.h>
21
22/*! @brief Une chaine de caractere (Nom) en majuscules
23 *
24 */
25class Motcle : public Nom
26{
27 Declare_instanciable_sans_constructeur(Motcle);
28
29public:
30
31 Motcle();
32 Motcle(const Motcle& nom);
33 Motcle& operator=(const Motcle& );
34
35 Motcle(const char * const nom);
36 Motcle(const std::string& nom);
37 Motcle(const Nom&);
38 Motcle& operator=(const char * const);
39 Motcle& operator=(const Nom&);
40 Motcle& operator+=(const char * const);
41 int selftest();
42
43 int debute_par(const char* const n) const override;
44 int finit_par(const char* const n) const override;
45 int find(const char* const n) const override;
46
47 friend int operator ==(const Motcle& , const Motcle& ) ;
48 friend int operator !=(const Motcle& , const Motcle& ) ;
49 friend int operator ==(const Motcle& , const char* const ) ;
50 friend int operator !=(const Motcle& , const char* const ) ;
51 friend int operator ==(const char* const , const Motcle& ) ;
52 friend int operator !=(const char* const , const Motcle& ) ;
53 friend int operator ==(const Motcle& , const Nom& ) ;
54 friend int operator !=(const Motcle& , const Nom& ) ;
55 friend int operator ==(const Nom& , const Motcle& ) ;
56 friend int operator !=(const Nom& , const Motcle& ) ;
57};
58
59/*! @brief Un tableau d'objets de la classe Motcle
60 *
61 */
62class Motcles : public VECT(Motcle)
63{
64 Declare_instanciable(Motcles);
65public:
66 Motcles(int);
67 int rang(const char* const ch) const;
68 int contient_(const char* const ch) const;
69 int search(const Motcle& t ) const ;
70};
71
72#endif
73// MOTCLE_H
Une chaine de caractere (Nom) en majuscules.
Definition Motcle.h:26
int selftest()
Autotest de la classe Motcle Effectue des affectations de controle.
Definition Motcle.cpp:143
int finit_par(const char *const n) const override
Definition Motcle.cpp:302
Motcle()
Constructeur par defaut Construit un Nom puis le passe en majuscule.
Definition Motcle.cpp:63
Motcle & operator+=(const char *const)
Definition Motcle.cpp:285
friend int operator==(const Motcle &, const Motcle &)
Comparaison d'un mot cle avec une chaine de caracteres.
Definition Motcle.cpp:226
Motcle & operator=(const Motcle &)
Construction par copie Utilise l'implementation de la classe Nom.
Definition Motcle.cpp:120
int debute_par(const char *const n) const override
Definition Motcle.cpp:309
int find(const char *const n) const override
Definition Motcle.cpp:315
friend int operator!=(const Motcle &, const Motcle &)
Comparaison d'un mot cle avec une chaine de caracteres.
Definition Motcle.cpp:260
int rang(const char *const ch) const
Definition Motcle.cpp:338
int contient_(const char *const ch) const
Definition Motcle.cpp:333
Motcles(int)
Constructeur Cree un tableau de i elements.
Definition Motcle.cpp:161
int search(const Motcle &t) const
Definition Motcle.cpp:321
Nom()
Constructeur par defaut.
Definition Nom.cpp:63