casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
casa::GLLogIO Class Reference

GLLogIO adds tracing support to the AIPS++ casacore::LogIO object. More...

#include <GLSupport.h>

Inheritance diagram for casa::GLLogIO:
casacore::LogIO

Public Member Functions

 GLLogIO ()
 
virtual ~GLLogIO ()
 
void trace (const char *name, int nspaces, casacore::Bool errorsonly=false)
 Print tracing information. More...
 
void append (const char *msg, casacore::uInt nspaces=0)
 Append a line to buffer then add a newline. More...
 
void indent (casacore::uInt nspaces=0)
 Adds nspaces to buffer. More...
 
void clear ()
 Deletes current buffer contents. More...
 
int glcheck (casacore::uInt nspaces)
 Copies any current OpenGL error messages to internal buffer. More...
 
void postString ()
 If an output string exists, copy it to an output stream if it exists. More...
 
void postString (const casacore::String &str)
 Copy string to either output stream or casacore::LogIO object. More...
 
void post ()
 Copy internal buffer to output. More...
 
- Public Member Functions inherited from casacore::LogIO
 LogIO ()
 Attach this LogIO object to the global sink with no origin information. More...
 
 LogIO (LogSink &sink)
 Attach this LogIO object to the supplied sink. More...
 
 LogIO (const LogOrigin &OR)
 Attach this LogIO object to the supplied origin and global sink. More...
 
 LogIO (const LogOrigin &OR, LogSink &sink)
 Attach this LogIO object to the supplied origin and sink. More...
 
 LogIO (const LogIO &other)
 Copying uses reference semantics, i.e. More...
 
LogIOoperator= (const LogIO &other)
 
 ~LogIO ()
 The destructor will post any accumulated message that has not already been posted. More...
 
void post ()
 Post the accumulated message. More...
 
void post (LogMessage &amess)
 
void postLocally ()
 Post the accumulated message locally. More...
 
template<typename EXC >
void postThenThrow (const EXC &exc)
 Post the accumulated message at SEVERE priority and then throw an exception. More...
 
void priority (LogMessage::Priority which)
 Change the priority of the message. More...
 
LogMessage::Priority priority ()
 
void sourceLocation (const SourceLocation *where)
 Change the location in the origin. More...
 
void origin (const LogOrigin &origin)
 Change the origin of the accumulated message. More...
 
ostream & output ()
 Acumulate output in this ostream. More...
 
LogSinkInterfacelocalSink ()
 Occasionally it is useful to interrogate the local log sink. More...
 
const LogSinkInterfacelocalSink () const
 

Static Public Member Functions

static void postToStream (casacore::Bool useStream=false)
 Logging to standard AIPS++ disrupts trace formatting. More...
 
static void postToString (casacore::String *str=NULL)
 Post messages to str for later use. More...
 

Private Attributes

casacore::String buffer_
 

Static Private Attributes

static casacore::Bool postToStream_
 
static casacore::Stringostring_
 

Additional Inherited Members

- Public Types inherited from casacore::LogIO
enum  Command {
  POST,
  EXCEPTION,
  SEVERE,
  WARN,
  NORMAL,
  NORMAL1,
  NORMAL2,
  NORMAL3,
  NORMAL4,
  NORMAL5,
  DEBUG1,
  DEBUG2,
  DEBUGGING
}
 Special commands to the LogIO object. More...
 

Detailed Description

GLLogIO adds tracing support to the AIPS++ casacore::LogIO object.

Definition at line 55 of file GLSupport.h.

Constructor & Destructor Documentation

casa::GLLogIO::GLLogIO ( )
virtual casa::GLLogIO::~GLLogIO ( )
virtual

Member Function Documentation

void casa::GLLogIO::append ( const char *  msg,
casacore::uInt  nspaces = 0 
)

Append a line to buffer then add a newline.

msg is indented by nspaces spaces. msg may contain newline characters.

void casa::GLLogIO::clear ( )

Deletes current buffer contents.

int casa::GLLogIO::glcheck ( casacore::uInt  nspaces)

Copies any current OpenGL error messages to internal buffer.

void casa::GLLogIO::indent ( casacore::uInt  nspaces = 0)

Adds nspaces to buffer.

void casa::GLLogIO::post ( )

Copy internal buffer to output.

Then clear internal buffer.

void casa::GLLogIO::postString ( )

If an output string exists, copy it to an output stream if it exists.

If the output stream doesn't exist, copy it to the casacore::LogIO object. The string is then cleared. Ignore if the string doesn't exist.

Referenced by casa::GLPixelCanvas::postString().

void casa::GLLogIO::postString ( const casacore::String str)

Copy string to either output stream or casacore::LogIO object.

The string is not cleared.

static void casa::GLLogIO::postToStream ( casacore::Bool  useStream = false)
static

Logging to standard AIPS++ disrupts trace formatting.

These routines allow redirecting or delaying output. NOTE: There is only 1 instance of the use iostream flag or String for all instances of GLLogIO.

Post messages to an iostream instead of casacore::LogIO object.

Referenced by casa::GLPixelCanvas::postToStream().

static void casa::GLLogIO::postToString ( casacore::String str = NULL)
static

Post messages to str for later use.

Disables if NULL. If str is non NULL, no output is done until postString is called. Replacing an existing string does not cause the existing string to be posted.

Referenced by casa::GLPixelCanvas::postToString().

void casa::GLLogIO::trace ( const char *  name,
int  nspaces,
casacore::Bool  errorsonly = false 
)

Print tracing information.

Also calls glcheck. This is the main use for GLLogIO. nspaces is the number of spaces to indent name and any errors. If errorsonly is true, don't print anything if there are no errors.

Member Data Documentation

casacore::String casa::GLLogIO::buffer_
private

Definition at line 103 of file GLSupport.h.

casacore::String* casa::GLLogIO::ostring_
staticprivate

Definition at line 105 of file GLSupport.h.

casacore::Bool casa::GLLogIO::postToStream_
staticprivate

Definition at line 104 of file GLSupport.h.


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