C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
CORE_Out Class Reference

this class describes the output stream by default write on standart output More...

#include <CORE_Out.h>

Inheritance diagram for CORE_Out:
Inheritance graph
[legend]
Collaboration diagram for CORE_Out:
Collaboration graph
[legend]

Public Member Functions

 CORE_Out ()
 build a CORE_Out
 
virtual ~CORE_Out (void)
 destroy a CORE_Out
 
virtual tMemSize getMemorySize () const override
 return the memory size in byte More...
 
virtual tMemSize getContentsMemorySize () const override
 return nthe memory size of the included associations More...
 
void update ()
 update the state of the output
 
void release ()
 release the pointers
 
void reset ()
 reset the state of the class
 
void setOutput (const tUSInt &mode)
 set outputType of the binary form v=2*f+s More...
 
void setOutput (const tString &mode)
 set outputType of the binary form v='FS' More...
 
tBoolean isOutput (const tUCInt &mode) const
 return true if the output is of the mode More...
 
tBoolean hasOutput () const
 return true if the output is of the mode More...
 
void setOutputFile (const tString &fileName, const tFlag &mode)
 set output file More...
 
void setOutputFile (const tString &fileName)
 set output file
 
void updateOutputFile (const tString &fileName)
 update output file
 
const tString & getOutputFileName () const
 get the output file name More...
 
void backup ()
 backup the state before change
 
void restore ()
 restore the state after change
 
void println (const tString &msg)
 print the message More...
 
void print (const tString &msg)
 print the message More...
 
void printError (const tString &msg)
 print the message on error output More...
 
virtual tString toString () const override
 return the string repreentation of the class More...
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 

Static Public Member Functions

static CORE_UniquePointer< CORE_OutNew ()
 build a new instance of default output More...
 
static void PrintProgressBar (const tString &message, const tInt &percent, tInt &oldPercent)
 print a progress bar if percent greater than oldpercent More...
 
- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Static Public Attributes

static const tUCInt NO_OUTPUT =0
 for printing in screen
 
static const tUCInt SCREEN_OUTPUT =1
 for printing in screen
 
static const tUCInt FILE_OUTPUT =2
 for printing in file
 
static const tUCInt ALL_OUTPUT =3
 for printing in all
 
static const tFlag APPEND =1
 output file mode : append to file
 
static const tFlag CREATE =0
 output file mode : create file
 

Friends

template<typename T >
CORE_Outoperator<< (CORE_Out &out, const T &obj)
 print Operators More...
 

Additional Inherited Members

- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Detailed Description

this class describes the output stream by default write on standart output

After any change of the output call update();

Member Function Documentation

◆ getContentsMemorySize()

virtual tMemSize CORE_Out::getContentsMemorySize ( ) const
inlineoverridevirtual

return nthe memory size of the included associations

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from CORE_Object.

◆ getMemorySize()

virtual tMemSize CORE_Out::getMemorySize ( ) const
inlineoverridevirtual

return the memory size in byte

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from CORE_Object.

◆ getOutputFileName()

const tString& CORE_Out::getOutputFileName ( ) const
inline

get the output file name

Returns
the output file name

◆ hasOutput()

tBoolean CORE_Out::hasOutput ( ) const
inline

return true if the output is of the mode

Returns
output mode

◆ isOutput()

tBoolean CORE_Out::isOutput ( const tUCInt &  mode) const
inline

return true if the output is of the mode

Parameters
[in]modeoutput mode

◆ New()

static CORE_UniquePointer<CORE_Out> CORE_Out::New ( )
inlinestatic

build a new instance of default output

Returns
an unique pointer of CORE_Out

◆ print()

void CORE_Out::print ( const tString &  msg)
inline

print the message

Parameters
[in]msgmessage to print on output

◆ printError()

void CORE_Out::printError ( const tString &  msg)
inline

print the message on error output

Parameters
[in]msgmessage to print on errot output

◆ println()

void CORE_Out::println ( const tString &  msg)
inline

print the message

Parameters
[in]msgmessage to print on output

◆ PrintProgressBar()

static void CORE_Out::PrintProgressBar ( const tString &  message,
const tInt &  percent,
tInt &  oldPercent 
)
inlinestatic

print a progress bar if percent greater than oldpercent

Parameters
[in]message: message to print
[in]percent: progress bar evolution rate in per cent
[out]oldPercent: the old percent is updated to percent

◆ setOutput() [1/2]

void CORE_Out::setOutput ( const tString &  mode)
inline

set outputType of the binary form v='FS'

Parameters
[in]modethe output mode
  • S: 1 for screen output , 0 otherwise
  • F: 1 for file output , 0 otherwise

examples:

  • no output 00
  • all output 11
  • only screen 01
  • only file 10

◆ setOutput() [2/2]

void CORE_Out::setOutput ( const tUSInt &  mode)
inline

set outputType of the binary form v=2*f+s

Parameters
[in]modethe output mode
  • s: 1 for screen output , 0 otherwise
  • f: 1 for file output , 0 otherwise

examples:

  • no output 0
  • all output 3
  • only screen 1
  • only file 2

◆ setOutputFile()

void CORE_Out::setOutputFile ( const tString &  fileName,
const tFlag &  mode 
)
inline

set output file

Parameters
[in]fileName: name of the output file
[in]modemode of writting the output file

◆ toString()

virtual tString CORE_Out::toString ( ) const
inlineoverridevirtual

return the string repreentation of the class

Returns
the string repreentation of the class

Reimplemented from CORE_Object.

Friends And Related Function Documentation

◆ operator<<

template<typename T >
CORE_Out& operator<< ( CORE_Out out,
const T &  obj 
)
friend

print Operators

Parameters
[in,out]outoutput stream
[in]objto print
Returns
the output stream

The documentation for this class was generated from the following files: