TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
Sortie Class Reference

Base class for output streams. 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
 Changes the write mode of the file.
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)
 Writes an object or 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)
 Writes a character string.
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

Base class for output streams.

Knows how to write simple types (integers, floats) and Objet_U objects (via printOn of the Objet_U). Note: some derived classes are parallel; in that case, syncfile() must be called periodically on all processors. See class EcrFicPartage. Note: to write correctly to a stream in both ASCII and BINARY mode, a Separateur (finl or space) must be used to separate written objects.

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

Writes a character string.

Note: to correctly re-read the string in ASCII mode, it must not contain any separator (neither space nor newline, ...).

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 213 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

Writes an object or variable.

In this implementation (and in most derived classes), ob.printOn is simply called (except in Sortie_Nulle). Note: if the stream must be usable in either ASCII or BINARY mode, "<< space <<" or "<< finl <<" must be inserted between objects.

Reimplemented in EcrFicPartage, and Sortie_Nulle.

Definition at line 201 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 241 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

Changes the write mode of the file.

This method can be called at any time. However, for Ecrire_Fichier_Partage files, the change must be made only at the beginning of a block write, immediately after syncfile() (otherwise, newlines are incorrectly translated during the next syncfile() call).

Reimplemented from AbstractIO.

Reimplemented in Sortie_Brute.

Definition at line 252 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/trust-code/src/Kernel/Utilitaires/Sortie.h
  • /home/docs/trust-code/src/Kernel/Utilitaires/Sortie.cpp