TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
Objet_U_With_Params.cpp
1/****************************************************************************
2* Copyright (c) 2026, 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#include <Objet_U_With_Params.h>
17#include <Param.h>
18
19
20Implemente_base(Objet_U_With_Params,"Objet_U_With_Params",Objet_U);
21
22/*! @brief Called in the readOn of Objet_U_With_Params. Must be overriden by user.
23 *
24 * In most cases, it should call the method of the base class to inherit the params.
25 * This is not always the case. If not done, reasons must be explained clearly in a comment
26 *
27 * Should fill the param argument with parameters to be read, using method ajouter
28 *
29 * Is const, because the modifications are done later in the readOn, with param.lire_avec_accolades_depuis
30 *
31 */
33{
34}
35
36/*! @brief Reading of the input stream (dataset) with the helper class Param
37 *
38 * This method is 'final'. The goal is to enforce a specific flow (see details below)
39 * of the reading/initialization of TRUST Objects.
40 *
41 *
42 * Unfolding of the method:
43 * 1. param is filled by the const method set_param.
44 * 2. params are read with param.lire_avec_accolades_depuis
45 * 3. params are validated by the user in the const method validate_params
46 *
47 * The actual work is done by __readOn_Impl_DO_NOT_OVERRIDE_UNLESS_THE_WORLD_IS_ENDING.
48 *
49 * @param (Entree& is) an input stream from which param will be read
50 * @return (Entree&) the input stream, after reading a block { ... }
51 * @throws wrong input format, missing brackets
52 */
53Entree& Objet_U_With_Params::readOn(Entree& is) // final, see header
54{
55 return __readOn_Impl_DO_NOT_OVERRIDE_UNLESS_THE_WORLD_IS_ENDING(is);
56}
57
59{
60 return os;
61}
62
63/*! @brief FORBIDDEN KNOWLEDGE
64 *
65 * Provided if absolutely necessary to change the impl of a readOn.
66 *
67 */
68Entree& Objet_U_With_Params::__readOn_Impl_DO_NOT_OVERRIDE_UNLESS_THE_WORLD_IS_ENDING(Entree& is)
69{
70
71 Cerr<<"Reading of data for a "<<que_suis_je()<<" equation"<<finl;
72 Param param(que_suis_je());
73 set_param(param);
74 param.lire_avec_accolades_depuis(is);
76 return is;
77
78}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Inherits from Objet_U, adds the very common method set_param for the Objet_U hierarchy.
virtual void validate_params() const
Called in the readOn of Objet_U_With_Params, after reading the params.
Entree & readOn(Entree &) override final
Reading of the input stream (dataset) with the helper class Param.
classe Objet_U Cette classe est la classe de base des Objets de TRUST
Definition Objet_U.h:73
virtual void set_param(Param &) const
Definition Objet_U.h:135
friend class Entree
Definition Objet_U.h:76
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
Definition Objet_U.cpp:104
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
Helper class to factorize the readOn method of Objet_U classes.
Definition Param.h:112
Classe de base des flux de sortie.
Definition Sortie.h:52