Gaudi Framework, version v25r2

Home   Generated: Wed Jun 4 2014
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
MsgStream.h File Reference
#include "GaudiKernel/IMessageSvc.h"
#include "GaudiKernel/SerializeSTL.h"
#include <cstdio>
#include <string>
#include <iomanip>
#include <vector>
#include <sstream>
Include dependency graph for MsgStream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MsgStream
 Definition of the MsgStream class used to transmit messages. More...
 

Functions

MsgStreamendmsg (MsgStream &s)
 MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
 
GAUDI_API std::string format (const char *,...)
 MsgStream format utility "a la sprintf(...)".
 
template<class _Tm >
MsgStreamoperator<< (MsgStream &s, const std::smanip< _Tm > &manip)
 I/O Manipulator for setfill.
 
MsgStreamoperator<< (MsgStream &s, const char *arg)
 Specialization to avoid the generation of implementations for char[].
 
template<typename T >
MsgStreamoperator<< (MsgStream &lhs, const T &arg)
 General templated stream operator.
 

Function Documentation

MsgStream& endmsg ( MsgStream s)
inline

MsgStream Modifier: endmsg. Calls the output method of the MsgStream.

Definition at line 243 of file MsgStream.h.

{
return s.doOutput();
}
GAUDI_API std::string format ( const char *  ,
  ... 
)

MsgStream format utility "a la sprintf(...)".

Definition at line 133 of file MsgStream.cpp.

{
const int buffsize = 2048;
static char buffer[buffsize];
va_list arguments;
va_start( arguments, fmt );
if( vsprintf(buffer, fmt, arguments) >= buffsize )
throw GaudiException("Insufficient buffer size (2048) when formatting message",
"MsgStream", 0);
return std::string(buffer);
}
template<class _Tm >
MsgStream& operator<< ( MsgStream s,
const std::smanip< _Tm > &  manip 
)
inline

I/O Manipulator for setfill.

Definition at line 331 of file MsgStream.h.

{
try {
// this may throw, and we cannot afford it if the stream is used in a catch block
if ( s.isActive() ) s.stream() << manip;
} catch (...) {}
return s;
}
MsgStream& operator<< ( MsgStream s,
const char *  arg 
)
inline

Specialization to avoid the generation of implementations for char[].

See Also
{bug #87340}

Definition at line 342 of file MsgStream.h.

{
try {
// this may throw, and we cannot afford it if the stream is used in a catch block
if ( s.isActive() ) s.stream() << arg;
} catch (...) {}
return s;
}
template<typename T >
MsgStream& operator<< ( MsgStream lhs,
const T &  arg 
)

General templated stream operator.

Definition at line 352 of file MsgStream.h.

{
using namespace GaudiUtils;
if(lhs.isActive())
try {
// this may throw, and we cannot afford it if the stream is used in a catch block
lhs.stream() << arg;
}
catch (...) {}
return lhs;
}

Generated at Wed Jun 4 2014 14:48:59 for Gaudi Framework, version v25r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004