Loading...
Searching...
No Matches
LogStream.h
// Copyright (C) 2003-2009 Anders Logg
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
//
// Modified by Garth N. Wells 2005.
#ifndef __LOG_STREAM_H
#define __LOG_STREAM_H
#include <complex>
#include <string>
#include <sstream>
namespace dolfin
{
class Variable;
class MeshEntity;
class MeshEntityIterator;
class Point;
class LogStream
{
public:
enum class Type {COUT, ENDL};
LogStream(Type type);
~LogStream();
LogStream& operator<< (const LogStream& stream);
LogStream& operator<< (const std::string& s);
LogStream& operator<< (int a);
LogStream& operator<< (unsigned int a);
LogStream& operator<< (long int a);
LogStream& operator<< (long unsigned int a);
LogStream& operator<< (double a);
LogStream& operator<< (std::complex<double> z);
LogStream& operator<< (const Variable& variable);
LogStream& operator<< (const MeshEntity& entity);
LogStream& operator<< (const Point& point);
void setprecision(std::streamsize n);
private:
// Type of stream
Type _type;
// Buffer
std::stringstream buffer;
};
extern LogStream cout;
extern LogStream endl;
}
#endif
dolfin::LogStream
Definition LogStream.h:40
dolfin::LogStream::~LogStream
~LogStream()
Destructor.
Definition LogStream.cpp:41
dolfin::LogStream::Type
Type
Stream types.
Definition LogStream.h:44
dolfin::LogStream::operator<<
LogStream & operator<<(const LogStream &stream)
Output for log stream.
Definition LogStream.cpp:46
dolfin::LogStream::setprecision
void setprecision(std::streamsize n)
Set precision.
Definition LogStream.cpp:122
dolfin::LogStream::LogStream
LogStream(Type type)
Create log stream of given type.
Definition LogStream.cpp:36
dolfin::MeshEntityIterator
Definition MeshEntityIterator.h:65
dolfin::MeshEntity
Definition MeshEntity.h:43
dolfin::Point
Definition Point.h:41
dolfin::Variable
Common base class for DOLFIN variables.
Definition Variable.h:36
dolfin
Definition adapt.h:30
dolfin::cout
LogStream cout
dolfin::cout
dolfin::endl
LogStream endl
dolfin::endl;