#include #include #include #include "JDetector/JModule.hh" #include "JDetector/JModuleStatus.hh" #include "Jeep/JStreamToolkit.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to test module status bits. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; int debug; try { JParser<> zap("Example program to test module status bits."); zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } if (debug >= debug_t) { cout << "Module status bits: "; writeObject(cout, getModuleStatusBits()) << endl; } JModule module; vector buffer = getModuleStatusBits(); for (vector::const_iterator i = buffer.begin(); i != buffer.end(); ++i) { ASSERT(module.has(*i) == false); DEBUG("Set module status " << putModuleStatusBit(*i) << endl); module.set(*i); ASSERT(module.has(*i) == true); } return 0; }