本文整理汇总了C++中util::cStr方法的典型用法代码示例。如果您正苦于以下问题:C++ util::cStr方法的具体用法?C++ util::cStr怎么用?C++ util::cStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util
的用法示例。
在下文中一共展示了util::cStr方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sync
void
sigTerm (Subsys* susy, string* problem) ///< called from subsystem on termination
{
REQUIRE (susy);
Lock sync (this);
triggerEmergency(!isnil (problem));
INFO (subsystem, "Subsystem '%s' terminated.", cStr(*susy));
WARN_IF (!isnil(problem), subsystem, "Irregular shutdown caused by: %s", cStr(*problem));
ERROR_IF (susy->isRunning(), subsystem, "Subsystem '%s' signals termination, "
"without resetting running state", cStr(*susy));
removeall (running_, susy);
shutdownAll();
sync.notify();
}
示例2: testSession
virtual void
run (Arg)
{
// Prepare an (test)Index (dummy "session")
PPIdx testSession (build_testScopes());
ElementQuery queryAPI;
MORef<DummyMO> dummy1 = queryAPI.pick (elementID_contains("MO2"));
CHECK (dummy1);
CHECK (dummy1->isValid());
INFO (test, "Location in Tree: %s", cStr(ScopePath(dummy1.getPlacement())));
string elementID = dummy1->operator string();
CHECK (contains (elementID, "MO2"));
string specificID = elementID.substr(10); // should contain the random int-ID
MORef<DummyMO> dummy2;
CHECK (!dummy2);
dummy2 = queryAPI.pick (elementID_contains(specificID));
CHECK (dummy2); // found the same object again
CHECK (dummy2->isValid());
CHECK (dummy2 == dummy1);
// put aside a new handle holding onto the MObject
PDum newPlacement(dummy1.getPlacement());
CHECK (testSession->contains(dummy1));
CHECK (!testSession->contains(newPlacement));
// and now remove the placement and all contained elements
testSession->clear (dummy1);
CHECK (!testSession->contains(dummy1));
MORef<DummyMO> findAgain = queryAPI.pick (elementID_contains(specificID));
CHECK (!findAgain); // empty result because searched element was removed from session...
MORef<DummyMO> otherElm = queryAPI.pick (elementID_contains("MO21"));
CHECK (otherElm); // now pick just some other arbitrary element
testSession->insert(newPlacement, otherElm);
dummy2 = queryAPI.pick (elementID_contains(specificID));
CHECK (dummy2);
CHECK (dummy2 != dummy1);
CHECK (dummy2 != newPlacement);
CHECK (isSharedPointee(newPlacement, dummy2.getPlacement()));
CHECK (Scope::containing (dummy2.getRef()) == Scope (otherElm));
INFO (test, "New treelocation: %s", cStr(ScopePath(dummy2.getPlacement())));
}
示例3: TRACE
/** finish and leave child object scope, return to parent */
void
TreeDiffMutatorBinding::emu (GenNode const& n)
{
TRACE (diff, "tree-diff: LEAVE scope %s", cStr(n.idi));
__expect_end_of_scope (n.idi);
treeMutator_ = &scopeManger_->closeScope();
__expect_valid_parent_scope (n.idi);
}
示例4: treeMutatorSize
/** open nested scope to apply diff to child object */
void
TreeDiffMutatorBinding::mut (GenNode const& n)
{
TreeMutator::Handle buffHandle = scopeManger_->openScope(); // hint: treeMutatorSize(...)
if (not treeMutator_->mutateChild(n, buffHandle))
__failMismatch("enter nested scope", n);
TRACE (diff, "tree-diff: ENTER scope %s", cStr(n.idi));
treeMutator_ = buffHandle.get();
}
示例5: Logic
void
triggerStartup (Subsys* susy)
{
REQUIRE (susy);
if (susy->isRunning()) return;
INFO (subsystem, "Triggering startup of subsystem \"%s\"", cStr(*susy));
for_each (susy->getPrerequisites(), start_);
bool started = susy->start (opts_, bind (&SubsystemRunner::sigTerm, this, susy, _1));
if (started)
{
if (susy->isRunning())
running_.push_back (susy); // now responsible for managing the started subsystem
else
throw error::Logic("Subsystem "+string(*susy)+" failed to start");
}
if (!and_all (susy->getPrerequisites(), isRunning() ))
{
susy->triggerShutdown();
throw error::State("Unable to start all prerequisites of Subsystem "+string(*susy));
} }