本文整理汇总了C++中not_null::get方法的典型用法代码示例。如果您正苦于以下问题:C++ not_null::get方法的具体用法?C++ not_null::get怎么用?C++ not_null::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类not_null
的用法示例。
在下文中一共展示了not_null::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showInternal
bool Widget::showInternal(not_null<ContentMemento*> memento) {
if (!controller()->validateMementoPeer(memento)) {
return false;
}
if (auto membersMemento = dynamic_cast<Memento*>(memento.get())) {
restoreState(membersMemento);
return true;
}
return false;
}
示例2: operat
Assembler::Assembler(not_null<Operator*> op,
not_null<const FiniteElemSpace*> row,
const FiniteElemSpace* col)
: operat(op),
rowFeSpace(row),
colFeSpace(col ? col : row.get()),
nRow(rowFeSpace->getBasisFcts()->getNumber()),
nCol(colFeSpace->getBasisFcts()->getNumber()),
remember(true),
rememberElMat(false),
rememberElVec(false),
elementMatrix(nRow, nCol),
elementVector(nRow),
tmpMat(nRow, nCol),
lastMatEl(NULL),
lastVecEl(NULL),
lastTraverseId(-1)
{}
示例3: InsertCelestialJacobiKeplerian
void Plugin::InsertCelestialJacobiKeplerian(
Index const celestial_index,
std::experimental::optional<Index> const& parent_index,
std::experimental::optional<KeplerianElements<Barycentric>> const&
keplerian_elements,
not_null<std::unique_ptr<MassiveBody>> body) {
LOG(INFO) << __FUNCTION__ << "\n"
<< NAMED(celestial_index) << "\n"
<< NAMED(parent_index) << "\n"
<< NAMED(keplerian_elements) << "\n"
<< NAMED(body);
CHECK(initializing_) << "Celestial bodies should be inserted before the end "
<< "of initialization";
CHECK(!absolute_initialization_);
CHECK_EQ((bool)parent_index, (bool)keplerian_elements);
CHECK_EQ((bool)parent_index, (bool)hierarchical_initialization_);
MassiveBody* const unowned_body = body.get();
if (hierarchical_initialization_) {
hierarchical_initialization_->system.Add(
std::move(body),
hierarchical_initialization_->indices_to_bodies[*parent_index],
*keplerian_elements);
} else {
hierarchical_initialization_.emplace(std::move(body));
}
bool inserted =
hierarchical_initialization_->parents.emplace(celestial_index,
parent_index).second;
inserted &=
hierarchical_initialization_->
indices_to_bodies.emplace(celestial_index, unowned_body).second;
CHECK(inserted);
// Record the fingerprints of the parameters to detect if we are in KSP stock.
CHECK(celestial_jacobi_keplerian_fingerprints_.insert(
FingerprintCelestialJacobiKeplerian(celestial_index,
parent_index,
keplerian_elements,
*unowned_body)).second);
}