1#ifndef __JLANG__JSTATUS__
2#define __JLANG__JSTATUS__
19namespace JPP {
using namespace JLANG; }
96 return static_cast<const JStatus&
>(*this);
141 return static_cast<JStatus&
>(*this);
198 bool has(
const int bit)
const
200 return (this->
status & (1<<bit)) != 0;
222 this->
status &= ~(1<<bit);
235 return in >>
status.status;
248 return out <<
status.status;
270 return this->at(key);
290 for (JGetStatusBit::const_iterator i = input.begin(); i != input.end(); ++i) {
291 this->insert(make_pair(i->second, i->first));
304 return this->at(bit);
320 for (
const auto& i : helper) {
321 out << setw(24) << left << i.second << right << status.
has(i.first) << endl;
337 for (
const auto& i : helper) {
338 out << setw(24) << left << i.first << right << status.
has(i.second) << endl;
Auxiliary classes and methods for language specific functionality.
void print(std::ostream &out, const JStatus &status, const JPutStatusBit &helper)
Print status.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Template definition of auxiliary base class for comparison of data structures.
Auxiliary class to map key to status bit.
int operator()(const std::string &key) const
Get status bit.
Auxiliary class to map status bit to key.
JPutStatusBit(const JGetStatusBit &input)
Constructor.
const std::string & operator()(const int bit) const
Put status bit.
Auxiliary class for handling status.
JStatus getAND(const JStatus &status) const
Get combined status.
status_type getStatus(const JType< status_type > &type) const
Get status.
const JStatus & getStatus() const
Get status.
friend std::istream & operator>>(std::istream &in, JStatus &status)
Read status from input.
T & getStatus()
Get status.
JStatus & getStatus()
Get status.
bool has(const int bit) const
Test PMT status.
void reset(const int bit)
Reset PMT status.
status_type & getStatus(const JType< status_type > &type)
Get status.
JStatus & getStatus(const JType< JStatus > &type)
Get status.
JStatus getOR(const JStatus &status) const
Get combined status.
JStatus getStatus(const JType< JStatus > &type) const
Get status.
friend std::ostream & operator<<(std::ostream &out, const JStatus &status)
Write status to output.
bool equals(const JStatus &status) const
Equal method.
JStatus()
Default constructor.
const T getStatus() const
Get status.
static const int NUMBER_OF_STATUS_BITS
number of status bits
JStatus(const status_type status)
Constructor.
void set(const int bit)
Set PMT status.
void setStatus(const JStatus &status)
Set status.
Auxiliary class for a type holder.