本文整理汇总了C++中std::ostream::good方法的典型用法代码示例。如果您正苦于以下问题:C++ ostream::good方法的具体用法?C++ ostream::good怎么用?C++ ostream::good使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::ostream
的用法示例。
在下文中一共展示了ostream::good方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveMinSGStream
void SceneManagement::saveMinSGStream(SceneManager & sm, std::ostream & out, const std::deque<Node *> & nodes) {
if(!out.good())
throw std::runtime_error("Cannot save MinSG nodes to the given stream.");
ExporterContext ctxt(sm);
std::unique_ptr<DescriptionMap> description(ExporterTools::createDescriptionForScene(ctxt, nodes));
if(!WriterMinSG::save(out, *(description.get())))
throw std::runtime_error("Could not serialize MinSG nodes.");
}
示例2: serialize
void PlanarPortal::serialize( std::ostream& output_stream ) const
{
assert( output_stream.good() );
m_plane_a.serialize( output_stream );
m_plane_b.serialize( output_stream );
Utilities::serialize( m_v, output_stream );
Utilities::serialize( m_bounds, output_stream );
Utilities::serialize( m_dx, output_stream );
}
示例3: information
bool EdgeSE3PointXYZ::write(std::ostream& os) const {
os << offsetParam->id() << " ";
for (int i=0; i<3; i++) os << measurement()[i] << " ";
for (int i=0; i<information().rows(); i++)
for (int j=i; j<information().cols(); j++) {
os << information()(i,j) << " ";
}
return os.good();
}
示例4: measurement
bool EdgeSE2::write(std::ostream& os) const
{
Vector3 p = measurement().toVector();
os << p.x() << " " << p.y() << " " << p.z();
for (int i = 0; i < 3; ++i)
for (int j = i; j < 3; ++j)
os << " " << information()(i, j);
return os.good();
}
示例5: write
bool EdgePointXY::write(std::ostream& os) const
{
Vector2d p = measurement();
os << p.x() << " " << p.y();
for (int i = 0; i < 2; ++i)
for (int j = i; j < 2; ++j)
os << " " << information()(i, j);
return os.good();
}
示例6: encode
bool encode(std::ostream& os,
const ::mfast::aggregate_cref& msg,
unsigned json_object_tag_mask,
unsigned ignore_tag_mask)
{
encode_detail::json_visitor_with_ignore_tag visitor(os, json_object_tag_mask, ignore_tag_mask);
visitor.visit(msg, 0);
return os.good();
}
示例7: information
bool EdgeSE3::write(std::ostream& os) const {
Vector7d meas=toVectorQT(_measurement);
for (int i=0; i<7; i++) os << meas[i] << " ";
for (int i=0; i<information().rows(); i++)
for (int j=i; j<information().cols(); j++) {
os << information()(i,j) << " ";
}
return os.good();
}
示例8: information
bool EdgeLine2D::write(std::ostream& os) const
{
for (int i = 0; i < 2; ++i)
os << _measurement[i] << " ";
for (int i = 0; i < 2; ++i)
for (int j = i; j < 2; ++j)
os << " " << information()(i, j);
return os.good();
}
示例9: information
// ================================================
bool EdgeSE3Switchable::write(std::ostream& os) const
{
g2o::Vector7d meas = g2o::internal::toVectorQT(measurement());
for (int i=0; i<7; i++) os << meas[i] << " ";
for (int i = 0; i < 6; ++i)
for (int j = i; j < 6; ++j)
os << " " << information()(i, j);
return os.good();
}
示例10:
bool EdgeSE2Segment2DLine::write(std::ostream& os) const
{
for (size_t i = 0; i < 2 ; i++)
os << _measurement[i] << " ";
for (size_t i = 0; i < 2 ; i++)
for (size_t j = i; j < 2 ; j++) {
os << _information (i,j) << " ";
}
return os.good();
}
示例11: serialize
void GeometricImpactFrictionMap::serialize( std::ostream& output_stream ) const
{
assert( output_stream.good() );
MathUtilities::serialize( m_f, output_stream );
Utilities::serialize( m_abs_tol, output_stream );
Utilities::serialize( m_max_iters, output_stream );
Utilities::serialize( m_impulses_to_cache, output_stream );
assert( m_write_constraint_forces == false );
assert( m_constraint_force_stream == nullptr );
}
示例12: write
bool EdgePlane::write(std::ostream& os) const
{
int size=4;
for (int i = 0; i < size; ++i)
os << _measurement[i] << " ";
for (int i = 0; i < size; ++i)
for (int j = i; j < size; ++j)
os << " " << information()(i, j);
return os.good();
}
示例13: assert
void Utilities::serialize<bool>( const std::vector<bool>& vector, std::ostream& output_stream )
{
assert( output_stream.good() );
serialize( vector.size(), output_stream );
for( std::vector<bool>::size_type idx = 0; idx < vector.size(); ++idx )
{
const bool local_val = vector[idx];
serialize( local_val, output_stream );
}
}
示例14: v
bool EdgeSE3PlaneSensorCalib::write(std::ostream& os) const
{
Vector4D v = _measurement.toVector();
os << v(0) << " " << v(1) << " " << v(2) << " " << v(3) << " ";
os << color(0) << " " << color(1) << " " << color(2) << " ";
for (int i = 0; i < information().rows(); ++i)
for (int j = i; j < information().cols(); ++j)
os << " " << information()(i, j);
return os.good();
}
示例15: save
void Memory::save( std::ostream& stream, const unsigned int& startPos, const unsigned int& length ) throw ( std::invalid_argument )
{
if ( startPos >= m_size ) throw std::invalid_argument("Memory::save(): startPos >= m_size");
unsigned int stopPos = std::min(m_size-1, startPos+length);
for ( unsigned int i = startPos; i <= stopPos; i++ ) {
if (!stream.good())
break;
stream.put(data[i]);
}
}