Exemplo n.º 1
0
void Node::print_leaves() {

    if( !has_left() && !has_right() ) {
        std::cout << get_data() << ' ';
        return;
    }
    if( has_left() )
        left->print_leaves();
    if( has_right() )
        right->print_leaves();
}
Exemplo n.º 2
0
int InputMessage::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // required bool ahead = 1;
    if (has_ahead()) {
      total_size += 1 + 1;
    }

    // required bool back = 2;
    if (has_back()) {
      total_size += 1 + 1;
    }

    // required bool left = 3;
    if (has_left()) {
      total_size += 1 + 1;
    }

    // required bool right = 4;
    if (has_right()) {
      total_size += 1 + 1;
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}
Exemplo n.º 3
0
::google::protobuf::uint8* InputMessage::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:InputMessage)
  // required bool ahead = 1;
  if (has_ahead()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->ahead(), target);
  }

  // required bool back = 2;
  if (has_back()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->back(), target);
  }

  // required bool left = 3;
  if (has_left()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->left(), target);
  }

  // required bool right = 4;
  if (has_right()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(4, this->right(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:InputMessage)
  return target;
}
Exemplo n.º 4
0
void InputMessage::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:InputMessage)
  // required bool ahead = 1;
  if (has_ahead()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->ahead(), output);
  }

  // required bool back = 2;
  if (has_back()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->back(), output);
  }

  // required bool left = 3;
  if (has_left()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->left(), output);
  }

  // required bool right = 4;
  if (has_right()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(4, this->right(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:InputMessage)
}
Exemplo n.º 5
0
void Node::print_right_nodes() {

    if( !has_right() )
        return;
    right->print_left_nodes();
    right->print_current();
    right->print_right_nodes();
}