TrioCFD 1.9.8
TrioCFD documentation
Loading...
Searching...
No Matches
TRUST_Deriv.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 <TRUST_Deriv.h>
17
18Implemente_instanciable_sans_constructeur_ni_destructeur(TRUST_Deriv_Objet_U, "TRUST_Deriv_Objet_U", Objet_U_ptr);
19
21
23
24TRUST_Deriv_Objet_U::~TRUST_Deriv_Objet_U() { detach(); }
25
27
29{
30 if (t) recopie(t.valeur());
31}
32
34{
35 recopie(t);
36}
37
39{
40 detach();
41 recopie(t);
42 return *this;
43}
44
46{
47 detach();
48 if (t) recopie(t.valeur());
49 else set_Objet_U_ptr(nullptr);
50 return *this;
51}
52
54{
55 const Type_info *type_info = Objet_U::info();
56 return *type_info; /* type de base accepte par la ref */
57}
58
60{
62 if (objet) pointeur_ = (Objet_U*) objet;
63 else pointeur_ = nullptr;
64}
65
67{
68 detach();
69 Objet_U& objet = deriv_obj.valeur();
70 set_Objet_U_ptr(&objet);
71 deriv_obj.set_Objet_U_ptr(nullptr);
72}
73
75{
76 return valeur().reprendre(is);
77}
78
80{
81 return valeur().sauvegarder(os);
82}
Class defining operators and methods for all reading operation in an input flow (file,...
Definition Entree.h:42
Pointeur sur un Objet_U.
Definition Objet_U_ptr.h:31
virtual void set_Objet_U_ptr(Objet_U *)
Fait pointer *this sur l'objet *ptr L'adresse peut etre nulle (pointeur nul).
void recopie(const Objet_U &)
Duplique l'Objet_U obj puis change le pointeur vers cette copie.
Objet_U_ptr(const Objet_U_ptr &)=delete
friend class Entree
Definition Objet_U.h:76
static const Type_info * info()
Donne des informations sur le type de l'Objet_U.
Definition Objet_U.cpp:136
friend class Sortie
Definition Objet_U.h:75
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:293
Objet_U()
Constructeur par defaut : attribue un numero d'identifiant unique a l'objet (object_id_),...
Definition Objet_U.cpp:55
virtual int reprendre(Entree &)
Reprise d'un Objet_U sur un flot d'entree Methode a surcharger.
Definition Objet_U.cpp:338
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:282
virtual int sauvegarder(Sortie &) const
Sauvegarde d'un Objet_U sur un flot de sortie Methode a surcharger.
Definition Objet_U.cpp:352
Classe de base des flux de sortie.
Definition Sortie.h:52
classe TRUST_Deriv_Objet_U est quasiment identique a TRUST_Deriv<Objet_U> sauf qu'elle ne contient pa...
int sauvegarder(Sortie &os) const override
Sauvegarde d'un Objet_U sur un flot de sortie Methode a surcharger.
int reprendre(Entree &is) override
Reprise d'un Objet_U sur un flot d'entree Methode a surcharger.
const Type_info & get_info_ptr() const override
const Objet_U & valeur() const
const TRUST_Deriv_Objet_U & operator=(const Objet_U &t)
void deplace(TRUST_Deriv_Objet_U &deriv_obj)
void set_Objet_U_ptr(Objet_U *objet) override
Fait pointer *this sur l'objet *ptr L'adresse peut etre nulle (pointeur nul).
modelise une information de type pour les Objet_U
Definition Type_info.h:30