TRUST 1.9.8
HPC thermohydraulic platform
Loading...
Searching...
No Matches
Sortie Class Reference

Classe de base des flux de sortie. More...

#include <Sortie.h>

Inheritance diagram for Sortie:
[legend]
Collaboration diagram for Sortie:
[legend]

Public Member Functions

 Sortie ()
 Sortie (ostream &os)
 Sortie (const Sortie &os)
virtual ~Sortie ()
Sortieoperator= (ostream &os)
Sortieoperator= (Sortie &os)
void set_bin (bool bin) override
 Change le mode d'ecriture du fichier.
ostream & get_ostream ()
const ostream & get_ostream () const
void set_col_width (int w)
Sortieoperator<< (ostream &(*f)(ostream &))
Sortieoperator<< (Sortie &(*f)(Sortie &))
Sortieoperator<< (ios &(*f)(ios &))
virtual Sortieflush ()
virtual Sortielockfile ()
virtual Sortieunlockfile ()
virtual Sortiesyncfile ()
virtual void setf (IOS_FORMAT)
virtual void precision (int)
template<typename T>
Sortieoperator<< (const TRUST_Ref< T > &)
Sortieoperator<< (const TRUST_Ref_Objet_U &)
virtual Sortieoperator<< (const Separateur &)
virtual Sortieoperator<< (const Objet_U &ob)
 Ecriture d'un objet ou d'une variable.
virtual Sortieoperator<< (const int ob)
virtual Sortieoperator<< (const unsigned ob)
virtual Sortieoperator<< (const long ob)
virtual Sortieoperator<< (const long long ob)
virtual Sortieoperator<< (const unsigned long ob)
virtual Sortieoperator<< (const float ob)
virtual Sortieoperator<< (const double ob)
virtual Sortieoperator<< (const char *ob)
 Ecriture d'une chaine de caracteres.
virtual Sortieoperator<< (const std::string &str)
virtual int add_col (const double ob)
virtual int add_col (const char *ob)
virtual int put (const unsigned *ob, std::streamsize n, std::streamsize nb_colonnes=1)
virtual int put (const int *ob, std::streamsize n, std::streamsize nb_colonnes=1)
virtual int put (const float *ob, std::streamsize n, std::streamsize nb_colonnes=1)
virtual int put (const double *ob, std::streamsize n, std::streamsize nb_colonnes=1)
virtual int put (const long *ob, std::streamsize n, std::streamsize nb_colonnes=1)
virtual int put (const long long *ob, std::streamsize n, std::streamsize nb_colonnes=1)
bool has_ostream () const
Public Member Functions inherited from AbstractIO
bool is_64b () const
virtual void set_64b (bool is_64b)
bool is_bin ()
void set_avoid_conversion (bool avoid)
bool avoid_conversion ()

Protected Attributes

int col_width_
std::unique_ptr< ostream > ostream_
Protected Attributes inherited from AbstractIO
bool bin_ = false
 Is this a binary flux?
bool is_64b_
 Will we be reading/writing in 64b? (Init in ctor to avoid including arch.h probably).
bool avoid_conversion_ = false

Additional Inherited Members

Protected Member Functions inherited from AbstractIO
 AbstractIO ()
virtual ~AbstractIO ()
template<typename _TYPE_>
bool must_convert () const
 Whether to convert an int into a long when reading/writing out data.

Detailed Description

Classe de base des flux de sortie.

Elle sait ecrire des types simples (entiers, flottants) et des Objet_U (via printOn de l'objet_U) Attention, certains classes derivees sont paralleles: dans ce cas, il faut appeler syncfile() periodiquement sur tous les processeurs. Voir class EcrFicPartage Attention: pour ecrire correctement un flux a la fois en ASCII et BINAIRE, il faut utiliser un Separateur (finl ou space) pour separer les objets ecrits.

See also
Entree

Definition at line 51 of file Sortie.h.

Constructor & Destructor Documentation

◆ Sortie() [1/3]

Sortie::Sortie ( )

Definition at line 26 of file Sortie.cpp.

◆ Sortie() [2/3]

Sortie::Sortie ( ostream & os)

Definition at line 46 of file Sortie.cpp.

◆ Sortie() [3/3]

Sortie::Sortie ( const Sortie & os)

Definition at line 54 of file Sortie.cpp.

◆ ~Sortie()

virtual Sortie::~Sortie ( )
inlinevirtual

Definition at line 57 of file Sortie.h.

Member Function Documentation

◆ add_col() [1/2]

int Sortie::add_col ( const char * ob)
virtual

Definition at line 92 of file Sortie.cpp.

◆ add_col() [2/2]

int Sortie::add_col ( const double ob)
virtual

Definition at line 83 of file Sortie.cpp.

◆ flush()

Sortie & Sortie::flush ( )
virtual

Reimplemented in EcrFicPartage, OBuffer, Sortie_Fichier_base, and Sortie_Nulle.

Definition at line 138 of file Sortie.cpp.

◆ get_ostream() [1/2]

ostream & Sortie::get_ostream ( )
inline

Definition at line 64 of file Sortie.h.

◆ get_ostream() [2/2]

const ostream & Sortie::get_ostream ( ) const
inline

Definition at line 65 of file Sortie.h.

◆ has_ostream()

bool Sortie::has_ostream ( ) const
inline

Definition at line 108 of file Sortie.h.

◆ lockfile()

Sortie & Sortie::lockfile ( )
virtual

Reimplemented in EcrFicPartage.

Definition at line 173 of file Sortie.cpp.

◆ operator<<() [1/16]

Sortie & Sortie::operator<< ( const char * ob)
virtual

Ecriture d'une chaine de caracteres.

Attention, pour pouvoir relire correctement la chaine en mode ascii, celle-ci ne doit pas contenir de separateur (ni espace, ni retour a la ligne, ...)

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 214 of file Sortie.cpp.

◆ operator<<() [2/16]

Sortie & Sortie::operator<< ( const double ob)
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 111 of file Sortie.cpp.

◆ operator<<() [3/16]

Sortie & Sortie::operator<< ( const float ob)
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 110 of file Sortie.cpp.

◆ operator<<() [4/16]

Sortie & Sortie::operator<< ( const int ob)
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 109 of file Sortie.cpp.

◆ operator<<() [5/16]

Sortie & Sortie::operator<< ( const long long ob)
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 113 of file Sortie.cpp.

◆ operator<<() [6/16]

Sortie & Sortie::operator<< ( const long ob)
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 112 of file Sortie.cpp.

◆ operator<<() [7/16]

Sortie & Sortie::operator<< ( const Objet_U & ob)
virtual

Ecriture d'un objet ou d'une variable.

Dans cette implementation (et dans la plupart des classes derivees) on appelle simplement ob.printOn (a l'exception de Sortie_Nulle) Attention, si on veut que le flux puisse etre indifferemment ASCII ou BINAIRE, il faut inserer "<< space <<" ou "<< finl <<" pour separer les objets.

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 202 of file Sortie.cpp.

◆ operator<<() [8/16]

Sortie & Sortie::operator<< ( const Separateur & ob)
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 144 of file Sortie.cpp.

◆ operator<<() [9/16]

Sortie & Sortie::operator<< ( const std::string & str)
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 243 of file Sortie.cpp.

◆ operator<<() [10/16]

template<typename T>
Sortie & Sortie::operator<< ( const TRUST_Ref< T > & )
inline

Definition at line 80 of file Sortie.h.

◆ operator<<() [11/16]

Sortie & Sortie::operator<< ( const TRUST_Ref_Objet_U & )
inline

Definition at line 82 of file Sortie.h.

◆ operator<<() [12/16]

Sortie & Sortie::operator<< ( const unsigned long ob)
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 114 of file Sortie.cpp.

◆ operator<<() [13/16]

Sortie & Sortie::operator<< ( const unsigned ob)
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 108 of file Sortie.cpp.

◆ operator<<() [14/16]

Sortie & Sortie::operator<< ( ios &(* )(ios &))

Definition at line 131 of file Sortie.cpp.

◆ operator<<() [15/16]

Sortie & Sortie::operator<< ( ostream &(* )(ostream &))

Definition at line 116 of file Sortie.cpp.

◆ operator<<() [16/16]

Sortie & Sortie::operator<< ( Sortie &(* )(Sortie &))

Definition at line 125 of file Sortie.cpp.

◆ operator=() [1/2]

Sortie & Sortie::operator= ( ostream & os)

Definition at line 64 of file Sortie.cpp.

◆ operator=() [2/2]

Sortie & Sortie::operator= ( Sortie & os)

Definition at line 71 of file Sortie.cpp.

◆ precision()

void Sortie::precision ( int pre)
virtual

Reimplemented in EcrFicPartage, OBuffer, Sortie_Fichier_base, and Sortie_Nulle.

Definition at line 40 of file Sortie.cpp.

◆ put() [1/6]

int Sortie::put ( const double * ob,
std::streamsize n,
std::streamsize nb_colonnes = 1 )
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 106 of file Sortie.cpp.

◆ put() [2/6]

int Sortie::put ( const float * ob,
std::streamsize n,
std::streamsize nb_colonnes = 1 )
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 105 of file Sortie.cpp.

◆ put() [3/6]

int Sortie::put ( const int * ob,
std::streamsize n,
std::streamsize nb_colonnes = 1 )
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 102 of file Sortie.cpp.

◆ put() [4/6]

int Sortie::put ( const long * ob,
std::streamsize n,
std::streamsize nb_colonnes = 1 )
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 103 of file Sortie.cpp.

◆ put() [5/6]

int Sortie::put ( const long long * ob,
std::streamsize n,
std::streamsize nb_colonnes = 1 )
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 104 of file Sortie.cpp.

◆ put() [6/6]

int Sortie::put ( const unsigned * ob,
std::streamsize n,
std::streamsize nb_colonnes = 1 )
virtual

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 101 of file Sortie.cpp.

◆ set_bin()

void Sortie::set_bin ( bool bin)
overridevirtual

Change le mode d'ecriture du fichier.

Cette methode peut etre appelee n'importe quand. Attention cependant pour les fichiers Ecrire_Fichier_Partage : il faut faire le changement uniquement au debut de l'ecriture d'un bloc, juste apres syncfile() (sinon, mauvaise traduction des retours a la ligne lors du syncfile suivant).

Reimplemented from AbstractIO.

Reimplemented in Sortie_Brute.

Definition at line 255 of file Sortie.cpp.

◆ set_col_width()

void Sortie::set_col_width ( int w)
inline

Definition at line 66 of file Sortie.h.

◆ setf()

void Sortie::setf ( IOS_FORMAT code)
virtual

Reimplemented in SChaine, Sortie_Fichier_base, and Sortie_Nulle.

Definition at line 34 of file Sortie.cpp.

◆ syncfile()

Sortie & Sortie::syncfile ( )
virtual

Reimplemented in EcrFicPartage.

Definition at line 187 of file Sortie.cpp.

◆ unlockfile()

Sortie & Sortie::unlockfile ( )
virtual

Reimplemented in EcrFicPartage.

Definition at line 180 of file Sortie.cpp.

Member Data Documentation

◆ col_width_

int Sortie::col_width_
protected

Definition at line 111 of file Sortie.h.

◆ ostream_

std::unique_ptr<ostream> Sortie::ostream_
protected

A smart pointer to a std::ostream object, or any of its derived class. Explicit construction might be done in derived classes of Sortie.

Definition at line 116 of file Sortie.h.


The documentation for this class was generated from the following files:
  • /home/docs/checkouts/readthedocs.org/user_builds/cea-trust-platform/checkouts/v1.9.8/src/Kernel/Utilitaires/Sortie.h
  • /home/docs/checkouts/readthedocs.org/user_builds/cea-trust-platform/checkouts/v1.9.8/src/Kernel/Utilitaires/Sortie.cpp