本文整理汇总了C++中BitSet::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ BitSet::clear方法的具体用法?C++ BitSet::clear怎么用?C++ BitSet::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitSet
的用法示例。
在下文中一共展示了BitSet::clear方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initCopy
void PVCopy::initCopy(
PVStructure ©PVStructure, BitSet &bitSet, bool lockRecord)
{
bitSet.clear();
bitSet.set(0);
updateCopyFromBitSet(copyPVStructure,bitSet,lockRecord);
}
示例2: pop
T pop() {
AvmAssert(!empty());
Seq<T>* n = work;
work = n->tail;
if (!work)
end = 0;
n->tail = free;
free = n;
T item = n->head;
members.clear(item->id);
return item;
}
示例3: move_acceptance_bits
/**
* Move the bits set in acc to the places specified by mapping.
*/
void move_acceptance_bits(BitSet& acc,
std::vector<unsigned int> mapping) {
int i=acc.nextSetBit(0);
while (i!=-1) {
unsigned int j=mapping[i];
// :: j is always <= i
if (j>(unsigned int)i) {
THROW_EXCEPTION(Exception, "Wrong mapping in move_acceptance_bits");
}
if (((unsigned int)i) == j) {
// do nothing
} else {
// move bit from i->j
acc.set(j);
acc.clear(i);
}
i=acc.nextSetBit(i+1);
}
}
示例4:
static SB_INLINE void bitset_erase(BitSet& bs) {
bs.clear();
}
示例5: reg
//.........这里部分代码省略.........
}
}
// Phis have simultaneous assignment semantics at block begin, so at
// the beginning of the block we can be sure that liveIn does not
// contain any phi outputs.
for (unsigned int i = 0; i < block->numPhis(); i++) {
LDefinition *def = block->getPhi(i)->getDef(0);
if (live->contains(def->virtualRegister())) {
live->remove(def->virtualRegister());
} else {
// This is a dead phi, so add a dummy range over all phis. This
// can go away if we have an earlier dead code elimination pass.
if (!vregs[def].getInterval(0)->addRangeAtHead(inputOf(block->firstId()),
outputOf(block->firstId())))
{
return false;
}
}
}
if (mblock->isLoopHeader()) {
// A divergence from the published algorithm is required here, as
// our block order does not guarantee that blocks of a loop are
// contiguous. As a result, a single live interval spanning the
// loop is not possible. Additionally, we require liveIn in a later
// pass for resolution, so that must also be fixed up here.
MBasicBlock *loopBlock = mblock->backedge();
while (true) {
// Blocks must already have been visited to have a liveIn set.
JS_ASSERT(loopBlock->id() >= mblock->id());
// Add an interval for this entire loop block
CodePosition from = inputOf(loopBlock->lir()->firstId());
CodePosition to = outputOf(loopBlock->lir()->lastId()).next();
for (BitSet::Iterator liveRegId(*live); liveRegId; liveRegId++) {
if (!vregs[*liveRegId].getInterval(0)->addRange(from, to))
return false;
}
// Fix up the liveIn set to account for the new interval
liveIn[loopBlock->id()]->insertAll(live);
// Make sure we don't visit this node again
loopDone->insert(loopBlock->id());
// If this is the loop header, any predecessors are either the
// backedge or out of the loop, so skip any predecessors of
// this block
if (loopBlock != mblock) {
for (size_t i = 0; i < loopBlock->numPredecessors(); i++) {
MBasicBlock *pred = loopBlock->getPredecessor(i);
if (loopDone->contains(pred->id()))
continue;
if (!loopWorkList.append(pred))
return false;
}
}
// Terminate loop if out of work.
if (loopWorkList.empty())
break;
// Grab the next block off the work list, skipping any OSR block.
while (!loopWorkList.empty()) {
loopBlock = loopWorkList.popCopy();
if (loopBlock->lir() != graph.osrBlock())
break;
}
// If end is reached without finding a non-OSR block, then no more work items were found.
if (loopBlock->lir() == graph.osrBlock()) {
JS_ASSERT(loopWorkList.empty());
break;
}
}
// Clear the done set for other loops
loopDone->clear();
}
JS_ASSERT_IF(!mblock->numPredecessors(), live->empty());
}
validateVirtualRegisters();
// If the script has an infinite loop, there may be no MReturn and therefore
// no fixed intervals. Add a small range to fixedIntervalsUnion so that the
// rest of the allocator can assume it has at least one range.
if (fixedIntervalsUnion->numRanges() == 0) {
if (!fixedIntervalsUnion->addRangeAtHead(CodePosition(0, CodePosition::INPUT),
CodePosition(0, CodePosition::OUTPUT)))
{
return false;
}
}
return true;
}
示例6: exampleDouble
static void exampleDouble(PvaClientPtr const &pvaClient)
{
testDiag("== exampleDouble ==");
PvaClientChannelPtr pvaChannel;
try {
pvaChannel = pvaClient->createChannel("PVRdouble");
pvaChannel->connect(2.0);
testDiag("channel connected");
} catch (std::runtime_error e) {
testAbort("channel connection exception '%s'", e.what());
}
PvaClientPutPtr put;
PvaClientPutDataPtr putData;
try {
put = pvaChannel->createPut();
putData = put->getData();
testDiag("put connected");
if (!putData)
testAbort("NULL data pointer from putGet");
} catch (std::runtime_error e) {
testAbort("put connection exception '%s'", e.what());
}
PvaClientGetPtr get;
PvaClientGetDataPtr getData;
try {
get = pvaChannel->createGet();
getData = get->getData();
testDiag("get connected");
if (!getData)
testAbort("NULL data pointer from putGet");
} catch (std::runtime_error e) {
testAbort("get connection exception '%s'", e.what());
}
PvaClientMonitorRequesterPtr requester(new MyMonitor());
PvaClientMonitorPtr monitor;
expected.set(0); // structure definition
try {
monitor = pvaChannel->monitor(requester);
testDiag("monitor connected");
} catch (std::runtime_error e) {
testAbort("monitor connection exception '%s'", e.what());
}
epicsThreadSleep(0.1); // Allow connection monitor event to fire
expected.clear(); // FIXME: Magic numbers here...
expected.set(1); // value
expected.set(6); // timestamp
try {
for (int i=0; i<5; ++i) {
testDiag("= put %d =", i);
double out = i;
putData->putDouble(out);
put->put();
get->get();
double in = getData->getDouble();
testOk(in == out, "get value matches put");
}
PvaClientProcessPtr process = pvaChannel->createProcess();
process->connect();
testDiag("= process =");
expected.clear(1); // no value change
process->process();
} catch (std::runtime_error e) {
testAbort("exception '%s'", e.what());
}
}