TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Fichier_Lata.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 Fichier_Lata_included
17#define Fichier_Lata_included
18
19#include <Format_Post_Lata.h>
20
21/*! @brief : This class holds a file of type EcrFicPartage or EcrFicPrive,
22 *
23 * in ASCII or BINARY format as specified in the constructor.
24 * See the constructor documentation.
25 *
26 */
27class SFichier;
28
30{
31public:
32 enum Mode {ERASE, APPEND};
33 Fichier_Lata(const char * basename, const char * extension,
34 Mode mode_append,
37 virtual ~Fichier_Lata();
38 virtual SFichier& get_SFichier();
39 virtual const Nom& get_filename() const;
40 virtual int is_master() const;
41 virtual void syncfile();
42protected:
46};
47
48/*! @brief : Specialization of Fichier_Lata for the master file: always in ASCII.
49 *
50 * A different precision can be used if desired.
51 *
52 */
54{
55public:
56 Fichier_Lata_maitre(const char * basename, const char * extension,
57 Mode mode_append,
59};
60
61#endif /* Fichier_Lata_included */
Fichier_Lata_maitre(const char *basename, const char *extension, Mode mode_append, Format_Post_Lata::Options_Para parallel)
virtual int is_master() const
If the file is of shared type, returns 1 if me() equals the group master, 0 otherwise.
virtual SFichier & get_SFichier()
SFichier * fichier_
Fichier_Lata(const char *basename, const char *extension, Mode mode_append, Format_Post_Lata::Format format, Format_Post_Lata::Options_Para parallel)
Builds a file of type EcrFicPartage(Bin) or EcrFicPrive(Bin), binary or not depending on the "format"...
virtual ~Fichier_Lata()
virtual const Nom & get_filename() const
Returns the file name with its path.
virtual void syncfile()
If the file is of shared type, calls the syncfile() method; otherwise does nothing.
Format
Options_Para
class Nom: a character string for naming TRUST objects.
Definition Nom.h:31
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
Definition SFichier.h:29