string.hh stringutil.hh vray.hh textdb.hh textstr.hh assoc.hh\
findcurs.hh unionfind.hh compare.hh handle.hh matrix.hh\
smat.hh vsmat.hh vector.hh real.hh choleski.hh\
- tsmat.hh tvsmat.hh plist.hh\
+ tsmat.hh tvsmat.hh plist.hh associter.hh\
+
#include <fstream.h>
-
+#include "assoc.hh"
#include "dstream.hh"
#include "string.hh"
#include "textdb.hh"
String cl(strip_member(mem));
String idx = cl;
- if (silent.elt_query(mem))
+ if (silent->elt_query(mem))
idx = mem;
- else if (silent.elt_query(cl))
+ else if (silent->elt_query(cl))
idx = cl;
else {
- silent[idx] = false;
+ (*silent)[idx] = false;
}
- local_silence = silent[idx];
+ local_silence = (*silent)[idx];
if (classname != idx && !local_silence) {
classname=idx;
*os << "[" << classname << ":]";
bool
Dstream::silence(String s)
{
- if (!silent.elt_query(s))
+ if (!silent->elt_query(s))
return false;
- return silent[s];
+ return (*silent)[s];
}
///
Dstream &
Dstream::Dstream(ostream *r, const char * cfg_nm )
{
os = r;
+ silent = new Assoc<String,bool>;
if (!os)
return;
indentlvl = 0;
if (!ifs)
return;
}
- // cerr << "(" << fn;
+
Text_db cfg(fn);
while (! cfg.eof()){
Text_record r( cfg++);
assert(r.sz() == 2);
- silent[r[0]] = r[1].to_bool();
+ (*silent)[r[0]] = r[1].to_bool();
}
- // cerr <<")";
-}
+}
+Dstream::~Dstream()
+{
+ delete silent;
+}
#define DSTREAM_HH
#include "string.hh"
-#include "assoc.hh"
const char eol= '\n';
+template<class K,class V>
+struct Assoc;
+
/// debug stream
class Dstream
{
bool local_silence;
String classname;
- Assoc<String, bool> silent;
+ Assoc<String, bool> *silent;
public:
bool silence(String);