# PhasicFlow: src/phasicFlow/streams/masterOstream/masterOstream.cpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

masterOstream.cpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#include "masterOstream.hpp"
#include "token.hpp"
pFlow::masterOstream::masterOstream
(
std::ostream& os,
const word& streamName
)
:
Ostream(os, streamName, writeFormat::ASCII)
{}
pFlow::iOstream& pFlow::masterOstream::write(const char c)
{
if(showOutput())
{
Ostream::write(c);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const char* str)
{
if(showOutput())
{
Ostream::write(str);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const word& str)
{
if(showOutput())
{
Ostream::write(str);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::writeQuoted
(
const word& str,
const bool quoted
)
{
if(showOutput())
{
Ostream::writeQuoted(str, quoted);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const int64 val)
{
if(showOutput())
{
Ostream::write(val);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const int32 val)
{
if(showOutput())
{
Ostream::write(val);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const int8 val)
{
if(showOutput())
{
Ostream::write(val);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const uint64 val)
{
if(showOutput())
{
Ostream::write(val);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const uint32 val)
{
if(showOutput())
{
Ostream::write(val);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const uint8 val)
{
if(showOutput())
{
Ostream::write(val);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const float val)
{
if(showOutput())
{
Ostream::write(val);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const double val)
{
if(showOutput())
{
Ostream::write(val);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write(const size_t val)
{
if(showOutput())
{
Ostream::write(val);
}
return *this;
}
pFlow::iOstream& pFlow::masterOstream::write
(
const char* binaryData,
std::streamsize count
)
{
if(showOutput())
{
Ostream::write(binaryData, count);
}
return *this;
}
void pFlow::masterOstream::indent()
{
if(showOutput())
{
Ostream::indent();
}
}
pFlow::Ostream::writeQuoted
iOstream & writeQuoted(const word &str, const bool quoted=true) override
Write std::string surrounded by quotes.
Definition: Ostream.cpp:108
pFlow::masterOstream::write
bool write(const token &tok)
Write token to stream or otherwise handle it.
Definition: masterOstream.hpp:75
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
token.hpp
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::Ostream::indent
void indent() override
Add indentation characters.
Definition: Ostream.cpp:266
pFlow::int64
long long int int64
Definition: builtinTypes.hpp:52
pFlow::masterOstream::writeQuoted
iOstream & writeQuoted(const word &str, const bool quoted=true) override
Write std::string surrounded by quotes.
Definition: masterOstream.cpp:67
pFlow::masterOstream::showOutput
bool showOutput() const
Definition: masterOstream.hpp:46
pFlow::int32
int int32
Definition: builtinTypes.hpp:50
pFlow::count
auto count(const Vector< T, Allocator > &vec, const T &val)
Definition: VectorAlgorithm.hpp:26
pFlow::masterOstream::indent
void indent() override
Add indentation characters.
Definition: masterOstream.cpp:180
pFlow::uint64
unsigned long long int uint64
Definition: builtinTypes.hpp:58
pFlow::int8
signed char int8
Definition: builtinTypes.hpp:48
pFlow::masterOstream::masterOstream
masterOstream(std::ostream &os, const word &streamName)
From components.
Definition: masterOstream.cpp:27
pFlow::Ostream::write
bool write(const token &tok) override
Write token to stream or otherwise handle it.
Definition: Ostream.cpp:51
pFlow::Ostream
Standard output stream for BINARY and ASCII formats.
Definition: Ostream.hpp:39
pFlow::uint8
unsigned char uint8
Definition: builtinTypes.hpp:54
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
masterOstream.hpp