00001 00007 /* 00008 Defines a new stream: iout, for "i"nforming consoles. 00009 */ 00010 00011 #ifndef INFOSTREAM_H 00012 #define INFOSTREAM_H 00013 00014 #include <iostream> 00015 #include <sstream> 00016 #include "charm++.h" 00017 class Vector; 00018 class Tensor; 00019 00020 class infostream : public std::ostringstream 00021 { 00022 public: 00023 infostream(); 00024 ~infostream(); 00025 void endi(); 00026 00027 /* define how to use the remaining << args */ 00029 infostream& operator<<(std::ostream& (*f)(std::ostream&)); 00031 infostream& operator<<(infostream& (*f)(infostream&)); 00032 00033 #define LOCALMOD(type) infostream& operator<<(type x) 00034 00035 LOCALMOD(char); 00036 LOCALMOD(unsigned char); 00037 LOCALMOD(const char *); 00039 LOCALMOD(int); 00040 LOCALMOD(long); 00041 LOCALMOD(short); 00042 LOCALMOD(unsigned int); 00043 LOCALMOD(unsigned long); 00044 LOCALMOD(unsigned short); 00046 LOCALMOD(float); 00047 LOCALMOD(double); 00049 LOCALMOD(void *); 00050 LOCALMOD(std::streambuf *); 00051 #undef LOCALMOD 00052 }; 00053 00054 std::ostream& operator<<(std::ostream& strm, const Vector &v1); 00055 infostream& operator<<(infostream& strm, const Vector &v1); 00056 00057 std::ostream& operator<<(std::ostream& strm, const Tensor &t1); 00058 infostream& operator<<(infostream& strm, const Tensor &t1); 00059 00061 infostream& endi(infostream& s); 00062 00067 std::ostream& iINFO (std::ostream& s); 00068 std::ostream& iWARN (std::ostream& s); 00069 std::ostream& iERROR(std::ostream& s); 00070 std::ostream& iDEBUG(std::ostream& s); 00071 std::ostream& iPE(std::ostream& s); // outlined because of CkMyPe() 00072 00073 #define iFILE __FILE__<<'('<<__LINE__<<"): " 00074 #define iINFOF iINFO << iFILE 00075 #define iWARNF iWARN << iFILE 00076 #define iERRORF iERROR << iFILE 00077 #define iDEBUGF iDEBUG << iFILE 00078 00079 CkpvExtern(infostream, iout_obj); 00080 00081 #define iout CkpvAccess(iout_obj) 00082 00083 #endif /* INFOSTREAM_H */ 00084
1.3.9.1