/usr/share/netgen/libsrc/general/netgenout.hpp is in netgen-headers 4.9.13.dfsg-8build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | #ifndef NETGEN_OUT_STREAM_HPP__
#define NETGEN_OUT_STREAM_HPP__
// #include <ostream>
// #include <mystdlib.h>
// #include <meshing.hpp>
namespace netgen
{
#ifdef PARALLEL
extern int id;
extern int ntasks;
#endif
DLL_HEADER extern int printmessage_importance;
class Imp
{
int importance;
public:
Imp () : importance(0) { ; }
Imp ( int aimportance ) : importance(aimportance) { ; }
int GetImp () const { return importance; }
};
class Proc
{
int proc;
public:
Proc () : proc(0) { ; }
Proc ( int aproc ) : proc(aproc) { ; }
int GetProc () const { return proc; }
};
class Procs
{
const netgen::FlatArray<int> procs;
public:
Procs ( const netgen::FlatArray<int> & aprocs ) : procs (aprocs) { ; }
const netgen::FlatArray<int> & GetProcs () const { return procs; }
};
class NetgenOutStream
{
ostream * out;
bool print;
bool printheader;
public:
NetgenOutStream() :
out(&std::cout),
print(1),
printheader(1)
{
;
}
NetgenOutStream(ostream * aout, Imp imp ) :
out(aout),
printheader(1)
{
if ( netgen::printmessage_importance >= imp.GetImp() )
print = true;
else
print = false;
}
NetgenOutStream(ostream * aout, Proc proc ) :
out(aout),
printheader(1)
{
#ifdef PARALLEL
if ( netgen::id == proc.GetProc() )
print = true;
else
print = false;
#else
if ( 0 == proc.GetProc() )
print = true;
else
print = false;
#endif
}
NetgenOutStream(ostream * aout, Procs & procs ) :
out(aout),
printheader(1)
{
#ifdef PARALLEL
if ( procs.GetProcs().Contains(netgen::id) )
print = true;
else
print = false;
#else
if ( procs.GetProcs().Contains(0) )
print = true;
else
print = false;
#endif
}
ostream & OStream ()
{
return *out;
}
template <typename T>
NetgenOutStream & operator<< (T & var)
{
if ( print )
{
#ifdef PARALLEL
if ( printheader )
{
*out << "proc " << netgen::id << ": ";
printheader = false;
}
#endif
*out << var;
}
return (*this);
}
NetgenOutStream& operator<< (ostream& ( *pf )(ostream&))
{
if ( print )
*out << (*pf) ;
return (*this);
}
NetgenOutStream& operator<< (ios& ( *pf )(ios&))
{
if ( print)
*out << (*pf) ;
printheader = 1;
return (*this);
}
NetgenOutStream& operator<< (ios_base& ( *pf )(ios_base&))
{
if (print )
*out << (*pf) ;
return (*this);
}
};
NetgenOutStream operator<< ( ostream & ost, Imp imp );
NetgenOutStream operator<< ( ostream & ost, Proc proc );
NetgenOutStream operator<< ( ostream & ost, Procs & procs );
// {
// return ( NetgenOutStream ( &ost, imp.GetImp() ) );
// }
// template <typename T>
// NetgenOutStream& operator<< (NetgenOutStream& out, T c )
// {
// out.OStream() << c << endl;
// return out;
// }
}
#endif
|