Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Verbose ostream (CGAL_Verbose_ostream)

Definition

The class CGAL_Verbose_ostream can be used as an output stream. The stream output operator << is defined for the builtin types. The class CGAL_Verbose_ostream stores in an internal state a stream and whether the output is active or not. If the state is active, all stream output operator << forward their output to the stream. Otherwise, no output happens.

#include <CGAL/IO/Verbose_ostream.h>

Creation

CGAL_Verbose_ostream verr ( bool active = false, ostream& out = cerr);
creates an output stream with state set to active that writes to the stream out.

Operations

CGAL_Verbose_ostream&
verr << char c
CGAL_Verbose_ostream&
verr << const char* s
CGAL_Verbose_ostream&
verr << int a
CGAL_Verbose_ostream&
verr << long l
CGAL_Verbose_ostream&
verr << double d
CGAL_Verbose_ostream&
verr << float f
CGAL_Verbose_ostream&
verr << unsigned int a
CGAL_Verbose_ostream&
verr << unsigned long l
CGAL_Verbose_ostream&
verr << long long ll
CGAL_Verbose_ostream&
verr << unsigned long long ll
CGAL_Verbose_ostream&
verr << void* p
CGAL_Verbose_ostream&
verr << short i
CGAL_Verbose_ostream&
verr << unsigned short i
CGAL_Verbose_ostream&
verr << ostream& (*f)(ostream&)
CGAL_Verbose_ostream&
verr << ios& (*f)(ios&)
CGAL_Verbose_ostream&
verr.flush ()
CGAL_Verbose_ostream&
verr.put ( char c)
CGAL_Verbose_ostream&
verr.write ( const char* s, int n)

Example

The class CGAL_Verbose_ostream can be conveniently used to implement for example the is_valid() member function for triangulations or other complex data structures.

    bool is_valid( bool verbose = false, int level = 0) {
        CGAL_Verbose_ostream verr( verbose);
        verr << "Triangulation::is_valid( level = " << level << ')' << endl;
        verr << "    Number of vertices = " << size_of_vertices() << endl;
        ...
    }


Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January 1999.