Sierra Toolkit Version of the Day
WriterOStream.hpp
00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010 Sandia Corporation.                     */
00003 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00004 /*  license for use of this work by or on behalf of the U.S. Government.  */
00005 /*  Export of this program may require a license from the                 */
00006 /*  United States Government.                                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 #ifndef STK_UTIL_DIAG_WRITEROSTREAM_HPP
00010 #define STK_UTIL_DIAG_WRITEROSTREAM_HPP
00011 
00012 #include <stk_util/diag/Writer.hpp>
00013 
00014 namespace stk {
00015 namespace diag {
00016 
00021 
00033 template <class T>
00034 Writer &operator<<(Writer &dout, const T &t) {
00035   if (dout.shouldPrint())
00036     dout.getStream() << t;
00037   
00038   return dout;
00039 }
00040 
00044 
00045 } // namespace diag
00046 } // namespace stk
00047 
00048 #endif // STK_UTIL_DIAG_WRITEROSTREAM_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines