| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

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:

Go to the source code of this file.

## Classes
class | MsgStream
| Definition of the MsgStream class used to transmit messages. More...
## Functions
MsgStream & | endmsg (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 >
MsgStream & | operator<< (MsgStream &s, const std::smanip< _Tm > &manip)
| I/O Manipulator for setfill.
template<typename T >
MsgStream & | operator<< (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;
    }

template<typename T >

MsgStream& operator<< | ( | MsgStream & | lhs,
|  | const T & | arg
| ) |  |

General templated stream operator.

Definition at line 342 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;
    }

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines