本文整理汇总了C++中not_null::add_body方法的典型用法代码示例。如果您正苦于以下问题:C++ not_null::add_body方法的具体用法?C++ not_null::add_body怎么用?C++ not_null::add_body使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类not_null
的用法示例。
在下文中一共展示了not_null::add_body方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOG
void Ephemeris<Frame>::WriteToMessage(
not_null<serialization::Ephemeris*> const message) const {
LOG(INFO) << __FUNCTION__;
// The bodies are serialized in the order in which they were given at
// construction.
for (auto const& unowned_body : unowned_bodies_) {
unowned_body->WriteToMessage(message->add_body());
}
// The trajectories are serialized in the order resulting from the separation
// between oblate and spherical bodies.
if (checkpoints_.empty()) {
for (auto const& trajectory : trajectories_) {
trajectory->WriteToMessage(message->add_trajectory());
}
last_state_.WriteToMessage(message->mutable_last_state());
} else {
auto const& checkpoints = checkpoints_.front().checkpoints;
CHECK_EQ(trajectories_.size(), checkpoints.size());
for (int i = 0; i < trajectories_.size(); ++i) {
trajectories_[i]->WriteToMessage(message->add_trajectory(),
checkpoints[i]);
}
checkpoints_.front().system_state.WriteToMessage(
message->mutable_last_state());
t_max().WriteToMessage(message->mutable_t_max());
}
parameters_.WriteToMessage(message->mutable_fixed_step_parameters());
fitting_tolerance_.WriteToMessage(message->mutable_fitting_tolerance());
LOG(INFO) << NAMED(message->SpaceUsed());
LOG(INFO) << NAMED(message->ByteSize());
}