当前位置: 首页>>代码示例>>C++>>正文


C++ not_null::add_series方法代码示例

本文整理汇总了C++中not_null::add_series方法的典型用法代码示例。如果您正苦于以下问题:C++ not_null::add_series方法的具体用法?C++ not_null::add_series怎么用?C++ not_null::add_series使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在not_null的用法示例。


在下文中一共展示了not_null::add_series方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LOG

void ContinuousTrajectory<Frame>::WriteToMessage(
      not_null<serialization::ContinuousTrajectory*> const message,
      Checkpoint const& checkpoint) const {
  LOG(INFO) << __FUNCTION__;
  step_.WriteToMessage(message->mutable_step());
  tolerance_.WriteToMessage(message->mutable_tolerance());
  checkpoint.adjusted_tolerance_.WriteToMessage(
      message->mutable_adjusted_tolerance());
  message->set_is_unstable(checkpoint.is_unstable_);
  message->set_degree(checkpoint.degree_);
  message->set_degree_age(checkpoint.degree_age_);
  for (auto const& s : series_) {
    if (s.t_max() <= checkpoint.t_max_) {
      s.WriteToMessage(message->add_series());
    }
    if (s.t_max() == checkpoint.t_max_) {
      break;
    }
    CHECK_LT(s.t_max(), checkpoint.t_max_);
  }
  if (first_time_) {
    first_time_->WriteToMessage(message->mutable_first_time());
  }
  for (auto const& pair : checkpoint.last_points_) {
    Instant const& instant = pair.first;
    DegreesOfFreedom<Frame> const& degrees_of_freedom = pair.second;
    not_null<
        serialization::ContinuousTrajectory::InstantaneousDegreesOfFreedom*>
        const instantaneous_degrees_of_freedom = message->add_last_point();
    instant.WriteToMessage(instantaneous_degrees_of_freedom->mutable_instant());
    degrees_of_freedom.WriteToMessage(
        instantaneous_degrees_of_freedom->mutable_degrees_of_freedom());
  }
  LOG(INFO) << NAMED(this);
  LOG(INFO) << NAMED(message->SpaceUsed());
  LOG(INFO) << NAMED(message->ByteSize());
}
开发者ID:tsal,项目名称:Principia,代码行数:37,代码来源:continuous_trajectory_body.hpp


注:本文中的not_null::add_series方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。