m_value = bitmask->value;
for (Trace::Bitmask::Signature::const_iterator it = bitmask->sig->begin();
it != bitmask->sig->end(); ++it) {
- assert(it->second);
+ assert(it->value);
QPair<QString, unsigned long long> pair;
- pair.first = QString::fromStdString(it->first);
- pair.second = it->second;
+ pair.first = QString::fromStdString(it->name);
+ pair.second = it->value;
m_sig.append(pair);
}
const Bitmask::Signature *sig = bitmask->sig;
bool first = true;
for (Bitmask::Signature::const_iterator it = sig->begin(); value != 0 && it != sig->end(); ++it) {
- if ((it->second && (value & it->second) == it->second) ||
- (!it->second && value == 0)) {
+ if ((it->value && (value & it->value) == it->value) ||
+ (!it->value && value == 0)) {
if (!first) {
os << " | ";
}
- os << literal << it->first << normal;
- value &= ~it->second;
+ os << literal << it->name << normal;
+ value &= ~it->value;
first = false;
}
}
#include <vector>
#include <iostream>
+#include "trace_writer.hpp"
+
namespace Trace {
class Bitmask : public UInt
{
public:
- typedef std::pair<const char *, unsigned long long> Pair;
- typedef std::vector<Pair> Signature;
+ typedef std::vector<BitmaskVal> Signature;
Bitmask(const Signature *_sig, unsigned long long _value) : UInt(_value), sig(_sig) {}
size_t size = read_uint();
sig = new Bitmask::Signature(size);
for (Bitmask::Signature::iterator it = sig->begin(); it != sig->end(); ++it) {
- it->first = read_string();
- it->second = read_uint();
- if (it->second == 0 && it != sig->begin()) {
- std::cerr << "warning: bitmask " << it->first << " is zero but is not first flag\n";
+ it->name = read_string();
+ it->value = read_uint();
+ if (it->value == 0 && it != sig->begin()) {
+ std::cerr << "warning: bitmask " << it->name << " is zero but is not first flag\n";
}
}
bitmasks[id] = sig;