コード例 #1
0
void
madara::knowledge::containers::IntegerVector::copy_to (
  KnowledgeVector & target) const
{
  if (context_)
  {
    ContextGuard context_guard (*context_);
    MADARA_GUARD_TYPE guard (mutex_);

    target.resize (vector_.size ());

    for (size_t i = 0; i < vector_.size (); ++i)
    {
      target[i].deep_copy ((*this)[i]);
    }
  }
}
コード例 #2
0
void
madara::knowledge::containers::NativeDoubleVector::copy_to (
  KnowledgeVector & target) const
{
  if (context_)
  {
    ContextGuard context_guard (*context_);
    MADARA_GUARD_TYPE guard (mutex_);

    madara_logger_ptr_log (logger::global_logger.get (),
      logger::LOG_MAJOR,
      "NativeDoubleVector::copy_to: %s: copying elements to vector\n",
      this->name_.c_str ());

    target.resize (size ());

    for (size_t i = 0; i < target.size (); ++i)
    {
      target[i].deep_copy ((*this)[i]);
    }
  }
}