#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "routing/topo_graph.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>

namespace apollo {
namespace routing {

namespace {

const ::google::protobuf::Descriptor* CurvePoint_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CurvePoint_reflection_ = NULL;
const ::google::protobuf::Descriptor* CurveRange_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CurveRange_reflection_ = NULL;
const ::google::protobuf::Descriptor* Node_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  Node_reflection_ = NULL;
const ::google::protobuf::Descriptor* Edge_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  Edge_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* Edge_DirectionType_descriptor_ = NULL;
const ::google::protobuf::Descriptor* Graph_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  Graph_reflection_ = NULL;

}  

void protobuf_AssignDesc_routing_2ftopo_5fgraph_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AssignDesc_routing_2ftopo_5fgraph_2eproto() {
  protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "routing/topo_graph.proto");
  GOOGLE_CHECK(file != NULL);
  CurvePoint_descriptor_ = file->message_type(0);
  static const int CurvePoint_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurvePoint, s_),
  };
  CurvePoint_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      CurvePoint_descriptor_,
      CurvePoint::default_instance_,
      CurvePoint_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurvePoint, _has_bits_[0]),
      -1,
      -1,
      sizeof(CurvePoint),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurvePoint, _internal_metadata_),
      -1);
  CurveRange_descriptor_ = file->message_type(1);
  static const int CurveRange_offsets_[2] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurveRange, start_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurveRange, end_),
  };
  CurveRange_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      CurveRange_descriptor_,
      CurveRange::default_instance_,
      CurveRange_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurveRange, _has_bits_[0]),
      -1,
      -1,
      sizeof(CurveRange),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurveRange, _internal_metadata_),
      -1);
  Node_descriptor_ = file->message_type(2);
  static const int Node_offsets_[8] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, lane_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, length_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, left_out_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, right_out_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, cost_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, central_curve_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, is_virtual_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, road_id_),
  };
  Node_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Node_descriptor_,
      Node::default_instance_,
      Node_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, _has_bits_[0]),
      -1,
      -1,
      sizeof(Node),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, _internal_metadata_),
      -1);
  Edge_descriptor_ = file->message_type(3);
  static const int Edge_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, from_lane_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, to_lane_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, cost_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, direction_type_),
  };
  Edge_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Edge_descriptor_,
      Edge::default_instance_,
      Edge_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, _has_bits_[0]),
      -1,
      -1,
      sizeof(Edge),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, _internal_metadata_),
      -1);
  Edge_DirectionType_descriptor_ = Edge_descriptor_->enum_type(0);
  Graph_descriptor_ = file->message_type(4);
  static const int Graph_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, hdmap_version_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, hdmap_district_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, node_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, edge_),
  };
  Graph_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Graph_descriptor_,
      Graph::default_instance_,
      Graph_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, _has_bits_[0]),
      -1,
      -1,
      sizeof(Graph),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, _internal_metadata_),
      -1);
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_routing_2ftopo_5fgraph_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      CurvePoint_descriptor_, &CurvePoint::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      CurveRange_descriptor_, &CurveRange::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      Node_descriptor_, &Node::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      Edge_descriptor_, &Edge::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      Graph_descriptor_, &Graph::default_instance());
}

}  

void protobuf_ShutdownFile_routing_2ftopo_5fgraph_2eproto() {
  delete CurvePoint::default_instance_;
  delete CurvePoint_reflection_;
  delete CurveRange::default_instance_;
  delete CurveRange_reflection_;
  delete Node::default_instance_;
  delete Node_reflection_;
  delete Edge::default_instance_;
  delete Edge_reflection_;
  delete Graph::default_instance_;
  delete Graph_reflection_;
}

void protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto() {
  static bool already_here = false;
  if (already_here) return;
  already_here = true;
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::apollo::hdmap::protobuf_AddDesc_map_2fmap_5fgeometry_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\030routing/topo_graph.proto\022\016apollo.routi"
    "ng\032\026map/map_geometry.proto\"\027\n\nCurvePoint"
    "\022\t\n\001s\030\001 \001(\001\"`\n\nCurveRange\022)\n\005start\030\001 \001(\013"
    "2\032.apollo.routing.CurvePoint\022\'\n\003end\030\002 \001("
    "\0132\032.apollo.routing.CurvePoint\"\351\001\n\004Node\022\017"
    "\n\007lane_id\030\001 \001(\t\022\016\n\006length\030\002 \001(\001\022,\n\010left_"
    "out\030\003 \003(\0132\032.apollo.routing.CurveRange\022-\n"
    "\tright_out\030\004 \003(\0132\032.apollo.routing.CurveR"
    "ange\022\014\n\004cost\030\005 \001(\001\022*\n\rcentral_curve\030\006 \001("
    "\0132\023.apollo.hdmap.Curve\022\030\n\nis_virtual\030\007 \001"
    "(\010:\004true\022\017\n\007road_id\030\010 \001(\t\"\255\001\n\004Edge\022\024\n\014fr"
    "om_lane_id\030\001 \001(\t\022\022\n\nto_lane_id\030\002 \001(\t\022\014\n\004"
    "cost\030\003 \001(\001\022:\n\016direction_type\030\004 \001(\0162\".apo"
    "llo.routing.Edge.DirectionType\"1\n\rDirect"
    "ionType\022\013\n\007FORWARD\020\000\022\010\n\004LEFT\020\001\022\t\n\005RIGHT\020"
    "\002\"~\n\005Graph\022\025\n\rhdmap_version\030\001 \001(\t\022\026\n\016hdm"
    "ap_district\030\002 \001(\t\022\"\n\004node\030\003 \003(\0132\024.apollo"
    ".routing.Node\022\"\n\004edge\030\004 \003(\0132\024.apollo.rou"
    "ting.Edge", 729);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "routing/topo_graph.proto", &protobuf_RegisterTypes);
  CurvePoint::default_instance_ = new CurvePoint();
  CurveRange::default_instance_ = new CurveRange();
  Node::default_instance_ = new Node();
  Edge::default_instance_ = new Edge();
  Graph::default_instance_ = new Graph();
  CurvePoint::default_instance_->InitAsDefaultInstance();
  CurveRange::default_instance_->InitAsDefaultInstance();
  Node::default_instance_->InitAsDefaultInstance();
  Edge::default_instance_->InitAsDefaultInstance();
  Graph::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_routing_2ftopo_5fgraph_2eproto);
}

struct StaticDescriptorInitializer_routing_2ftopo_5fgraph_2eproto {
  StaticDescriptorInitializer_routing_2ftopo_5fgraph_2eproto() {
    protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  }
} static_descriptor_initializer_routing_2ftopo_5fgraph_2eproto_;

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int CurvePoint::kSFieldNumber;
#endif  

CurvePoint::CurvePoint()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void CurvePoint::InitAsDefaultInstance() {
}

CurvePoint::CurvePoint(const CurvePoint& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void CurvePoint::SharedCtor() {
  _cached_size_ = 0;
  s_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CurvePoint::~CurvePoint() {

  SharedDtor();
}

void CurvePoint::SharedDtor() {
  if (this != default_instance_) {
  }
}

void CurvePoint::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CurvePoint::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CurvePoint_descriptor_;
}

const CurvePoint& CurvePoint::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

CurvePoint* CurvePoint::default_instance_ = NULL;

CurvePoint* CurvePoint::New(::google::protobuf::Arena* arena) const {
  CurvePoint* n = new CurvePoint;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void CurvePoint::Clear() {

  s_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool CurvePoint::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {

      case 1: {
        if (tag == 9) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &s_)));
          set_has_s();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:

  return true;
failure:

  return false;
#undef DO_
}

void CurvePoint::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_s()) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->s(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* CurvePoint::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_s()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->s(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int CurvePoint::ByteSize() const {

  int total_size = 0;

  if (has_s()) {
    total_size += 1 + 8;
  }

  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void CurvePoint::MergeFrom(const ::google::protobuf::Message& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const CurvePoint* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const CurvePoint>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void CurvePoint::MergeFrom(const CurvePoint& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_s()) {
      set_s(from.s());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void CurvePoint::CopyFrom(const ::google::protobuf::Message& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CurvePoint::CopyFrom(const CurvePoint& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CurvePoint::IsInitialized() const {

  return true;
}

void CurvePoint::Swap(CurvePoint* other) {
  if (other == this) return;
  InternalSwap(other);
}
void CurvePoint::InternalSwap(CurvePoint* other) {
  std::swap(s_, other->s_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata CurvePoint::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CurvePoint_descriptor_;
  metadata.reflection = CurvePoint_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool CurvePoint::has_s() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void CurvePoint::set_has_s() {
  _has_bits_[0] |= 0x00000001u;
}
void CurvePoint::clear_has_s() {
  _has_bits_[0] &= ~0x00000001u;
}
void CurvePoint::clear_s() {
  s_ = 0;
  clear_has_s();
}
 double CurvePoint::s() const {

  return s_;
}
 void CurvePoint::set_s(double value) {
  set_has_s();
  s_ = value;

}

#endif  

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int CurveRange::kStartFieldNumber;
const int CurveRange::kEndFieldNumber;
#endif  

CurveRange::CurveRange()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void CurveRange::InitAsDefaultInstance() {
  start_ = const_cast< ::apollo::routing::CurvePoint*>(&::apollo::routing::CurvePoint::default_instance());
  end_ = const_cast< ::apollo::routing::CurvePoint*>(&::apollo::routing::CurvePoint::default_instance());
}

CurveRange::CurveRange(const CurveRange& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void CurveRange::SharedCtor() {
  _cached_size_ = 0;
  start_ = NULL;
  end_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CurveRange::~CurveRange() {

  SharedDtor();
}

void CurveRange::SharedDtor() {
  if (this != default_instance_) {
    delete start_;
    delete end_;
  }
}

void CurveRange::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CurveRange::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CurveRange_descriptor_;
}

const CurveRange& CurveRange::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

CurveRange* CurveRange::default_instance_ = NULL;

CurveRange* CurveRange::New(::google::protobuf::Arena* arena) const {
  CurveRange* n = new CurveRange;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void CurveRange::Clear() {

  if (_has_bits_[0 / 32] & 3u) {
    if (has_start()) {
      if (start_ != NULL) start_->::apollo::routing::CurvePoint::Clear();
    }
    if (has_end()) {
      if (end_ != NULL) end_->::apollo::routing::CurvePoint::Clear();
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool CurveRange::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {

      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_start()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_end;
        break;
      }

      case 2: {
        if (tag == 18) {
         parse_end:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_end()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:

  return true;
failure:

  return false;
#undef DO_
}

void CurveRange::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_start()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, *this->start_, output);
  }

  if (has_end()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, *this->end_, output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* CurveRange::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_start()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        1, *this->start_, false, target);
  }

  if (has_end()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        2, *this->end_, false, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int CurveRange::ByteSize() const {

  int total_size = 0;

  if (_has_bits_[0 / 32] & 3u) {

    if (has_start()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->start_);
    }

    if (has_end()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->end_);
    }

  }
  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void CurveRange::MergeFrom(const ::google::protobuf::Message& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const CurveRange* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const CurveRange>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void CurveRange::MergeFrom(const CurveRange& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_start()) {
      mutable_start()->::apollo::routing::CurvePoint::MergeFrom(from.start());
    }
    if (from.has_end()) {
      mutable_end()->::apollo::routing::CurvePoint::MergeFrom(from.end());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void CurveRange::CopyFrom(const ::google::protobuf::Message& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CurveRange::CopyFrom(const CurveRange& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CurveRange::IsInitialized() const {

  return true;
}

void CurveRange::Swap(CurveRange* other) {
  if (other == this) return;
  InternalSwap(other);
}
void CurveRange::InternalSwap(CurveRange* other) {
  std::swap(start_, other->start_);
  std::swap(end_, other->end_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata CurveRange::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CurveRange_descriptor_;
  metadata.reflection = CurveRange_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool CurveRange::has_start() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void CurveRange::set_has_start() {
  _has_bits_[0] |= 0x00000001u;
}
void CurveRange::clear_has_start() {
  _has_bits_[0] &= ~0x00000001u;
}
void CurveRange::clear_start() {
  if (start_ != NULL) start_->::apollo::routing::CurvePoint::Clear();
  clear_has_start();
}
const ::apollo::routing::CurvePoint& CurveRange::start() const {

  return start_ != NULL ? *start_ : *default_instance_->start_;
}
::apollo::routing::CurvePoint* CurveRange::mutable_start() {
  set_has_start();
  if (start_ == NULL) {
    start_ = new ::apollo::routing::CurvePoint;
  }

  return start_;
}
::apollo::routing::CurvePoint* CurveRange::release_start() {

  clear_has_start();
  ::apollo::routing::CurvePoint* temp = start_;
  start_ = NULL;
  return temp;
}
void CurveRange::set_allocated_start(::apollo::routing::CurvePoint* start) {
  delete start_;
  start_ = start;
  if (start) {
    set_has_start();
  } else {
    clear_has_start();
  }

}

bool CurveRange::has_end() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void CurveRange::set_has_end() {
  _has_bits_[0] |= 0x00000002u;
}
void CurveRange::clear_has_end() {
  _has_bits_[0] &= ~0x00000002u;
}
void CurveRange::clear_end() {
  if (end_ != NULL) end_->::apollo::routing::CurvePoint::Clear();
  clear_has_end();
}
const ::apollo::routing::CurvePoint& CurveRange::end() const {

  return end_ != NULL ? *end_ : *default_instance_->end_;
}
::apollo::routing::CurvePoint* CurveRange::mutable_end() {
  set_has_end();
  if (end_ == NULL) {
    end_ = new ::apollo::routing::CurvePoint;
  }

  return end_;
}
::apollo::routing::CurvePoint* CurveRange::release_end() {

  clear_has_end();
  ::apollo::routing::CurvePoint* temp = end_;
  end_ = NULL;
  return temp;
}
void CurveRange::set_allocated_end(::apollo::routing::CurvePoint* end) {
  delete end_;
  end_ = end;
  if (end) {
    set_has_end();
  } else {
    clear_has_end();
  }

}

#endif  

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Node::kLaneIdFieldNumber;
const int Node::kLengthFieldNumber;
const int Node::kLeftOutFieldNumber;
const int Node::kRightOutFieldNumber;
const int Node::kCostFieldNumber;
const int Node::kCentralCurveFieldNumber;
const int Node::kIsVirtualFieldNumber;
const int Node::kRoadIdFieldNumber;
#endif  

Node::Node()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void Node::InitAsDefaultInstance() {
  central_curve_ = const_cast< ::apollo::hdmap::Curve*>(&::apollo::hdmap::Curve::default_instance());
}

Node::Node(const Node& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void Node::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  lane_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  length_ = 0;
  cost_ = 0;
  central_curve_ = NULL;
  is_virtual_ = true;
  road_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Node::~Node() {

  SharedDtor();
}

void Node::SharedDtor() {
  lane_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  road_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
    delete central_curve_;
  }
}

void Node::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Node::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Node_descriptor_;
}

const Node& Node::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

Node* Node::default_instance_ = NULL;

Node* Node::New(::google::protobuf::Arena* arena) const {
  Node* n = new Node;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Node::Clear() {

  if (_has_bits_[0 / 32] & 243u) {
    if (has_lane_id()) {
      lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    length_ = 0;
    cost_ = 0;
    if (has_central_curve()) {
      if (central_curve_ != NULL) central_curve_->::apollo::hdmap::Curve::Clear();
    }
    is_virtual_ = true;
    if (has_road_id()) {
      road_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  left_out_.Clear();
  right_out_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Node::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {

      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_lane_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->lane_id().data(), this->lane_id().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Node.lane_id");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(17)) goto parse_length;
        break;
      }

      case 2: {
        if (tag == 17) {
         parse_length:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &length_)));
          set_has_length();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_left_out;
        break;
      }

      case 3: {
        if (tag == 26) {
         parse_left_out:
          DO_(input->IncrementRecursionDepth());
         parse_loop_left_out:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_left_out()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_loop_left_out;
        if (input->ExpectTag(34)) goto parse_loop_right_out;
        input->UnsafeDecrementRecursionDepth();
        break;
      }

      case 4: {
        if (tag == 34) {
          DO_(input->IncrementRecursionDepth());
         parse_loop_right_out:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_right_out()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_loop_right_out;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectTag(41)) goto parse_cost;
        break;
      }

      case 5: {
        if (tag == 41) {
         parse_cost:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &cost_)));
          set_has_cost();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(50)) goto parse_central_curve;
        break;
      }

      case 6: {
        if (tag == 50) {
         parse_central_curve:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_central_curve()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(56)) goto parse_is_virtual;
        break;
      }

      case 7: {
        if (tag == 56) {
         parse_is_virtual:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &is_virtual_)));
          set_has_is_virtual();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(66)) goto parse_road_id;
        break;
      }

      case 8: {
        if (tag == 66) {
         parse_road_id:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_road_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->road_id().data(), this->road_id().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Node.road_id");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:

  return true;
failure:

  return false;
#undef DO_
}

void Node::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->lane_id().data(), this->lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Node.lane_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->lane_id(), output);
  }

  if (has_length()) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->length(), output);
  }

  for (unsigned int i = 0, n = this->left_out_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->left_out(i), output);
  }

  for (unsigned int i = 0, n = this->right_out_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, this->right_out(i), output);
  }

  if (has_cost()) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(5, this->cost(), output);
  }

  if (has_central_curve()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      6, *this->central_curve_, output);
  }

  if (has_is_virtual()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->is_virtual(), output);
  }

  if (has_road_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->road_id().data(), this->road_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Node.road_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      8, this->road_id(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* Node::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->lane_id().data(), this->lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Node.lane_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->lane_id(), target);
  }

  if (has_length()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->length(), target);
  }

  for (unsigned int i = 0, n = this->left_out_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        3, this->left_out(i), false, target);
  }

  for (unsigned int i = 0, n = this->right_out_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        4, this->right_out(i), false, target);
  }

  if (has_cost()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(5, this->cost(), target);
  }

  if (has_central_curve()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        6, *this->central_curve_, false, target);
  }

  if (has_is_virtual()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->is_virtual(), target);
  }

  if (has_road_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->road_id().data(), this->road_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Node.road_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        8, this->road_id(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int Node::ByteSize() const {

  int total_size = 0;

  if (_has_bits_[0 / 32] & 243u) {

    if (has_lane_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->lane_id());
    }

    if (has_length()) {
      total_size += 1 + 8;
    }

    if (has_cost()) {
      total_size += 1 + 8;
    }

    if (has_central_curve()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->central_curve_);
    }

    if (has_is_virtual()) {
      total_size += 1 + 1;
    }

    if (has_road_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->road_id());
    }

  }

  total_size += 1 * this->left_out_size();
  for (int i = 0; i < this->left_out_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->left_out(i));
  }

  total_size += 1 * this->right_out_size();
  for (int i = 0; i < this->right_out_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->right_out(i));
  }

  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void Node::MergeFrom(const ::google::protobuf::Message& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Node* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Node>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void Node::MergeFrom(const Node& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  left_out_.MergeFrom(from.left_out_);
  right_out_.MergeFrom(from.right_out_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_lane_id()) {
      set_has_lane_id();
      lane_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.lane_id_);
    }
    if (from.has_length()) {
      set_length(from.length());
    }
    if (from.has_cost()) {
      set_cost(from.cost());
    }
    if (from.has_central_curve()) {
      mutable_central_curve()->::apollo::hdmap::Curve::MergeFrom(from.central_curve());
    }
    if (from.has_is_virtual()) {
      set_is_virtual(from.is_virtual());
    }
    if (from.has_road_id()) {
      set_has_road_id();
      road_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.road_id_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void Node::CopyFrom(const ::google::protobuf::Message& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Node::CopyFrom(const Node& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Node::IsInitialized() const {

  return true;
}

void Node::Swap(Node* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Node::InternalSwap(Node* other) {
  lane_id_.Swap(&other->lane_id_);
  std::swap(length_, other->length_);
  left_out_.UnsafeArenaSwap(&other->left_out_);
  right_out_.UnsafeArenaSwap(&other->right_out_);
  std::swap(cost_, other->cost_);
  std::swap(central_curve_, other->central_curve_);
  std::swap(is_virtual_, other->is_virtual_);
  road_id_.Swap(&other->road_id_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata Node::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = Node_descriptor_;
  metadata.reflection = Node_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool Node::has_lane_id() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Node::set_has_lane_id() {
  _has_bits_[0] |= 0x00000001u;
}
void Node::clear_has_lane_id() {
  _has_bits_[0] &= ~0x00000001u;
}
void Node::clear_lane_id() {
  lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_lane_id();
}
 const ::std::string& Node::lane_id() const {

  return lane_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Node::set_lane_id(const ::std::string& value) {
  set_has_lane_id();
  lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void Node::set_lane_id(const char* value) {
  set_has_lane_id();
  lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void Node::set_lane_id(const char* value, size_t size) {
  set_has_lane_id();
  lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* Node::mutable_lane_id() {
  set_has_lane_id();

  return lane_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Node::release_lane_id() {

  clear_has_lane_id();
  return lane_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Node::set_allocated_lane_id(::std::string* lane_id) {
  if (lane_id != NULL) {
    set_has_lane_id();
  } else {
    clear_has_lane_id();
  }
  lane_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), lane_id);

}

bool Node::has_length() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void Node::set_has_length() {
  _has_bits_[0] |= 0x00000002u;
}
void Node::clear_has_length() {
  _has_bits_[0] &= ~0x00000002u;
}
void Node::clear_length() {
  length_ = 0;
  clear_has_length();
}
 double Node::length() const {

  return length_;
}
 void Node::set_length(double value) {
  set_has_length();
  length_ = value;

}

int Node::left_out_size() const {
  return left_out_.size();
}
void Node::clear_left_out() {
  left_out_.Clear();
}
const ::apollo::routing::CurveRange& Node::left_out(int index) const {

  return left_out_.Get(index);
}
::apollo::routing::CurveRange* Node::mutable_left_out(int index) {

  return left_out_.Mutable(index);
}
::apollo::routing::CurveRange* Node::add_left_out() {

  return left_out_.Add();
}
::google::protobuf::RepeatedPtrField< ::apollo::routing::CurveRange >*
Node::mutable_left_out() {

  return &left_out_;
}
const ::google::protobuf::RepeatedPtrField< ::apollo::routing::CurveRange >&
Node::left_out() const {

  return left_out_;
}

int Node::right_out_size() const {
  return right_out_.size();
}
void Node::clear_right_out() {
  right_out_.Clear();
}
const ::apollo::routing::CurveRange& Node::right_out(int index) const {

  return right_out_.Get(index);
}
::apollo::routing::CurveRange* Node::mutable_right_out(int index) {

  return right_out_.Mutable(index);
}
::apollo::routing::CurveRange* Node::add_right_out() {

  return right_out_.Add();
}
::google::protobuf::RepeatedPtrField< ::apollo::routing::CurveRange >*
Node::mutable_right_out() {

  return &right_out_;
}
const ::google::protobuf::RepeatedPtrField< ::apollo::routing::CurveRange >&
Node::right_out() const {

  return right_out_;
}

bool Node::has_cost() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void Node::set_has_cost() {
  _has_bits_[0] |= 0x00000010u;
}
void Node::clear_has_cost() {
  _has_bits_[0] &= ~0x00000010u;
}
void Node::clear_cost() {
  cost_ = 0;
  clear_has_cost();
}
 double Node::cost() const {

  return cost_;
}
 void Node::set_cost(double value) {
  set_has_cost();
  cost_ = value;

}

bool Node::has_central_curve() const {
  return (_has_bits_[0] & 0x00000020u) != 0;
}
void Node::set_has_central_curve() {
  _has_bits_[0] |= 0x00000020u;
}
void Node::clear_has_central_curve() {
  _has_bits_[0] &= ~0x00000020u;
}
void Node::clear_central_curve() {
  if (central_curve_ != NULL) central_curve_->::apollo::hdmap::Curve::Clear();
  clear_has_central_curve();
}
const ::apollo::hdmap::Curve& Node::central_curve() const {

  return central_curve_ != NULL ? *central_curve_ : *default_instance_->central_curve_;
}
::apollo::hdmap::Curve* Node::mutable_central_curve() {
  set_has_central_curve();
  if (central_curve_ == NULL) {
    central_curve_ = new ::apollo::hdmap::Curve;
  }

  return central_curve_;
}
::apollo::hdmap::Curve* Node::release_central_curve() {

  clear_has_central_curve();
  ::apollo::hdmap::Curve* temp = central_curve_;
  central_curve_ = NULL;
  return temp;
}
void Node::set_allocated_central_curve(::apollo::hdmap::Curve* central_curve) {
  delete central_curve_;
  central_curve_ = central_curve;
  if (central_curve) {
    set_has_central_curve();
  } else {
    clear_has_central_curve();
  }

}

bool Node::has_is_virtual() const {
  return (_has_bits_[0] & 0x00000040u) != 0;
}
void Node::set_has_is_virtual() {
  _has_bits_[0] |= 0x00000040u;
}
void Node::clear_has_is_virtual() {
  _has_bits_[0] &= ~0x00000040u;
}
void Node::clear_is_virtual() {
  is_virtual_ = true;
  clear_has_is_virtual();
}
 bool Node::is_virtual() const {

  return is_virtual_;
}
 void Node::set_is_virtual(bool value) {
  set_has_is_virtual();
  is_virtual_ = value;

}

bool Node::has_road_id() const {
  return (_has_bits_[0] & 0x00000080u) != 0;
}
void Node::set_has_road_id() {
  _has_bits_[0] |= 0x00000080u;
}
void Node::clear_has_road_id() {
  _has_bits_[0] &= ~0x00000080u;
}
void Node::clear_road_id() {
  road_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_road_id();
}
 const ::std::string& Node::road_id() const {

  return road_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Node::set_road_id(const ::std::string& value) {
  set_has_road_id();
  road_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void Node::set_road_id(const char* value) {
  set_has_road_id();
  road_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void Node::set_road_id(const char* value, size_t size) {
  set_has_road_id();
  road_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* Node::mutable_road_id() {
  set_has_road_id();

  return road_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Node::release_road_id() {

  clear_has_road_id();
  return road_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Node::set_allocated_road_id(::std::string* road_id) {
  if (road_id != NULL) {
    set_has_road_id();
  } else {
    clear_has_road_id();
  }
  road_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), road_id);

}

#endif  

const ::google::protobuf::EnumDescriptor* Edge_DirectionType_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Edge_DirectionType_descriptor_;
}
bool Edge_DirectionType_IsValid(int value) {
  switch(value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Edge_DirectionType Edge::FORWARD;
const Edge_DirectionType Edge::LEFT;
const Edge_DirectionType Edge::RIGHT;
const Edge_DirectionType Edge::DirectionType_MIN;
const Edge_DirectionType Edge::DirectionType_MAX;
const int Edge::DirectionType_ARRAYSIZE;
#endif  
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Edge::kFromLaneIdFieldNumber;
const int Edge::kToLaneIdFieldNumber;
const int Edge::kCostFieldNumber;
const int Edge::kDirectionTypeFieldNumber;
#endif  

Edge::Edge()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void Edge::InitAsDefaultInstance() {
}

Edge::Edge(const Edge& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void Edge::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  from_lane_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  to_lane_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  cost_ = 0;
  direction_type_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Edge::~Edge() {

  SharedDtor();
}

void Edge::SharedDtor() {
  from_lane_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  to_lane_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
  }
}

void Edge::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Edge::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Edge_descriptor_;
}

const Edge& Edge::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

Edge* Edge::default_instance_ = NULL;

Edge* Edge::New(::google::protobuf::Arena* arena) const {
  Edge* n = new Edge;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Edge::Clear() {

#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(Edge, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<Edge*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&first, 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  if (_has_bits_[0 / 32] & 15u) {
    ZR_(cost_, direction_type_);
    if (has_from_lane_id()) {
      from_lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_to_lane_id()) {
      to_lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }

#undef ZR_HELPER_
#undef ZR_

  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Edge::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {

      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_from_lane_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->from_lane_id().data(), this->from_lane_id().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Edge.from_lane_id");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_to_lane_id;
        break;
      }

      case 2: {
        if (tag == 18) {
         parse_to_lane_id:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_to_lane_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->to_lane_id().data(), this->to_lane_id().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Edge.to_lane_id");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(25)) goto parse_cost;
        break;
      }

      case 3: {
        if (tag == 25) {
         parse_cost:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &cost_)));
          set_has_cost();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(32)) goto parse_direction_type;
        break;
      }

      case 4: {
        if (tag == 32) {
         parse_direction_type:
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::apollo::routing::Edge_DirectionType_IsValid(value)) {
            set_direction_type(static_cast< ::apollo::routing::Edge_DirectionType >(value));
          } else {
            mutable_unknown_fields()->AddVarint(4, value);
          }
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:

  return true;
failure:

  return false;
#undef DO_
}

void Edge::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_from_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->from_lane_id().data(), this->from_lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Edge.from_lane_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->from_lane_id(), output);
  }

  if (has_to_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->to_lane_id().data(), this->to_lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Edge.to_lane_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->to_lane_id(), output);
  }

  if (has_cost()) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(3, this->cost(), output);
  }

  if (has_direction_type()) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      4, this->direction_type(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* Edge::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_from_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->from_lane_id().data(), this->from_lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Edge.from_lane_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->from_lane_id(), target);
  }

  if (has_to_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->to_lane_id().data(), this->to_lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Edge.to_lane_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->to_lane_id(), target);
  }

  if (has_cost()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(3, this->cost(), target);
  }

  if (has_direction_type()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      4, this->direction_type(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int Edge::ByteSize() const {

  int total_size = 0;

  if (_has_bits_[0 / 32] & 15u) {

    if (has_from_lane_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->from_lane_id());
    }

    if (has_to_lane_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->to_lane_id());
    }

    if (has_cost()) {
      total_size += 1 + 8;
    }

    if (has_direction_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->direction_type());
    }

  }
  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void Edge::MergeFrom(const ::google::protobuf::Message& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Edge* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Edge>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void Edge::MergeFrom(const Edge& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_from_lane_id()) {
      set_has_from_lane_id();
      from_lane_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.from_lane_id_);
    }
    if (from.has_to_lane_id()) {
      set_has_to_lane_id();
      to_lane_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.to_lane_id_);
    }
    if (from.has_cost()) {
      set_cost(from.cost());
    }
    if (from.has_direction_type()) {
      set_direction_type(from.direction_type());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void Edge::CopyFrom(const ::google::protobuf::Message& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Edge::CopyFrom(const Edge& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Edge::IsInitialized() const {

  return true;
}

void Edge::Swap(Edge* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Edge::InternalSwap(Edge* other) {
  from_lane_id_.Swap(&other->from_lane_id_);
  to_lane_id_.Swap(&other->to_lane_id_);
  std::swap(cost_, other->cost_);
  std::swap(direction_type_, other->direction_type_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata Edge::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = Edge_descriptor_;
  metadata.reflection = Edge_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool Edge::has_from_lane_id() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Edge::set_has_from_lane_id() {
  _has_bits_[0] |= 0x00000001u;
}
void Edge::clear_has_from_lane_id() {
  _has_bits_[0] &= ~0x00000001u;
}
void Edge::clear_from_lane_id() {
  from_lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_from_lane_id();
}
 const ::std::string& Edge::from_lane_id() const {

  return from_lane_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Edge::set_from_lane_id(const ::std::string& value) {
  set_has_from_lane_id();
  from_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void Edge::set_from_lane_id(const char* value) {
  set_has_from_lane_id();
  from_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void Edge::set_from_lane_id(const char* value, size_t size) {
  set_has_from_lane_id();
  from_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* Edge::mutable_from_lane_id() {
  set_has_from_lane_id();

  return from_lane_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Edge::release_from_lane_id() {

  clear_has_from_lane_id();
  return from_lane_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Edge::set_allocated_from_lane_id(::std::string* from_lane_id) {
  if (from_lane_id != NULL) {
    set_has_from_lane_id();
  } else {
    clear_has_from_lane_id();
  }
  from_lane_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from_lane_id);

}

bool Edge::has_to_lane_id() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void Edge::set_has_to_lane_id() {
  _has_bits_[0] |= 0x00000002u;
}
void Edge::clear_has_to_lane_id() {
  _has_bits_[0] &= ~0x00000002u;
}
void Edge::clear_to_lane_id() {
  to_lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_to_lane_id();
}
 const ::std::string& Edge::to_lane_id() const {

  return to_lane_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Edge::set_to_lane_id(const ::std::string& value) {
  set_has_to_lane_id();
  to_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void Edge::set_to_lane_id(const char* value) {
  set_has_to_lane_id();
  to_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void Edge::set_to_lane_id(const char* value, size_t size) {
  set_has_to_lane_id();
  to_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* Edge::mutable_to_lane_id() {
  set_has_to_lane_id();

  return to_lane_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Edge::release_to_lane_id() {

  clear_has_to_lane_id();
  return to_lane_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Edge::set_allocated_to_lane_id(::std::string* to_lane_id) {
  if (to_lane_id != NULL) {
    set_has_to_lane_id();
  } else {
    clear_has_to_lane_id();
  }
  to_lane_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), to_lane_id);

}

bool Edge::has_cost() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void Edge::set_has_cost() {
  _has_bits_[0] |= 0x00000004u;
}
void Edge::clear_has_cost() {
  _has_bits_[0] &= ~0x00000004u;
}
void Edge::clear_cost() {
  cost_ = 0;
  clear_has_cost();
}
 double Edge::cost() const {

  return cost_;
}
 void Edge::set_cost(double value) {
  set_has_cost();
  cost_ = value;

}

bool Edge::has_direction_type() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void Edge::set_has_direction_type() {
  _has_bits_[0] |= 0x00000008u;
}
void Edge::clear_has_direction_type() {
  _has_bits_[0] &= ~0x00000008u;
}
void Edge::clear_direction_type() {
  direction_type_ = 0;
  clear_has_direction_type();
}
 ::apollo::routing::Edge_DirectionType Edge::direction_type() const {

  return static_cast< ::apollo::routing::Edge_DirectionType >(direction_type_);
}
 void Edge::set_direction_type(::apollo::routing::Edge_DirectionType value) {
  assert(::apollo::routing::Edge_DirectionType_IsValid(value));
  set_has_direction_type();
  direction_type_ = value;

}

#endif  

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Graph::kHdmapVersionFieldNumber;
const int Graph::kHdmapDistrictFieldNumber;
const int Graph::kNodeFieldNumber;
const int Graph::kEdgeFieldNumber;
#endif  

Graph::Graph()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();

}

void Graph::InitAsDefaultInstance() {
}

Graph::Graph(const Graph& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);

}

void Graph::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  hdmap_version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  hdmap_district_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Graph::~Graph() {

  SharedDtor();
}

void Graph::SharedDtor() {
  hdmap_version_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  hdmap_district_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
  }
}

void Graph::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Graph::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Graph_descriptor_;
}

const Graph& Graph::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

Graph* Graph::default_instance_ = NULL;

Graph* Graph::New(::google::protobuf::Arena* arena) const {
  Graph* n = new Graph;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Graph::Clear() {

  if (_has_bits_[0 / 32] & 3u) {
    if (has_hdmap_version()) {
      hdmap_version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_hdmap_district()) {
      hdmap_district_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  node_.Clear();
  edge_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Graph::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;

  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {

      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_hdmap_version()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->hdmap_version().data(), this->hdmap_version().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Graph.hdmap_version");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_hdmap_district;
        break;
      }

      case 2: {
        if (tag == 18) {
         parse_hdmap_district:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_hdmap_district()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->hdmap_district().data(), this->hdmap_district().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Graph.hdmap_district");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_node;
        break;
      }

      case 3: {
        if (tag == 26) {
         parse_node:
          DO_(input->IncrementRecursionDepth());
         parse_loop_node:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_node()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_loop_node;
        if (input->ExpectTag(34)) goto parse_loop_edge;
        input->UnsafeDecrementRecursionDepth();
        break;
      }

      case 4: {
        if (tag == 34) {
          DO_(input->IncrementRecursionDepth());
         parse_loop_edge:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_edge()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_loop_edge;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:

  return true;
failure:

  return false;
#undef DO_
}

void Graph::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {

  if (has_hdmap_version()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->hdmap_version().data(), this->hdmap_version().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Graph.hdmap_version");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->hdmap_version(), output);
  }

  if (has_hdmap_district()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->hdmap_district().data(), this->hdmap_district().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Graph.hdmap_district");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->hdmap_district(), output);
  }

  for (unsigned int i = 0, n = this->node_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->node(i), output);
  }

  for (unsigned int i = 0, n = this->edge_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, this->edge(i), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }

}

::google::protobuf::uint8* Graph::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {

  if (has_hdmap_version()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->hdmap_version().data(), this->hdmap_version().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Graph.hdmap_version");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->hdmap_version(), target);
  }

  if (has_hdmap_district()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->hdmap_district().data(), this->hdmap_district().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Graph.hdmap_district");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->hdmap_district(), target);
  }

  for (unsigned int i = 0, n = this->node_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        3, this->node(i), false, target);
  }

  for (unsigned int i = 0, n = this->edge_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        4, this->edge(i), false, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }

  return target;
}

int Graph::ByteSize() const {

  int total_size = 0;

  if (_has_bits_[0 / 32] & 3u) {

    if (has_hdmap_version()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->hdmap_version());
    }

    if (has_hdmap_district()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->hdmap_district());
    }

  }

  total_size += 1 * this->node_size();
  for (int i = 0; i < this->node_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->node(i));
  }

  total_size += 1 * this->edge_size();
  for (int i = 0; i < this->edge_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->edge(i));
  }

  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void Graph::MergeFrom(const ::google::protobuf::Message& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Graph* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Graph>(
          &from);
  if (source == NULL) {

    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {

    MergeFrom(*source);
  }
}

void Graph::MergeFrom(const Graph& from) {

  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  node_.MergeFrom(from.node_);
  edge_.MergeFrom(from.edge_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_hdmap_version()) {
      set_has_hdmap_version();
      hdmap_version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hdmap_version_);
    }
    if (from.has_hdmap_district()) {
      set_has_hdmap_district();
      hdmap_district_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hdmap_district_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void Graph::CopyFrom(const ::google::protobuf::Message& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Graph::CopyFrom(const Graph& from) {

  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Graph::IsInitialized() const {

  return true;
}

void Graph::Swap(Graph* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Graph::InternalSwap(Graph* other) {
  hdmap_version_.Swap(&other->hdmap_version_);
  hdmap_district_.Swap(&other->hdmap_district_);
  node_.UnsafeArenaSwap(&other->node_);
  edge_.UnsafeArenaSwap(&other->edge_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata Graph::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = Graph_descriptor_;
  metadata.reflection = Graph_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS

bool Graph::has_hdmap_version() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Graph::set_has_hdmap_version() {
  _has_bits_[0] |= 0x00000001u;
}
void Graph::clear_has_hdmap_version() {
  _has_bits_[0] &= ~0x00000001u;
}
void Graph::clear_hdmap_version() {
  hdmap_version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_hdmap_version();
}
 const ::std::string& Graph::hdmap_version() const {

  return hdmap_version_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Graph::set_hdmap_version(const ::std::string& value) {
  set_has_hdmap_version();
  hdmap_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void Graph::set_hdmap_version(const char* value) {
  set_has_hdmap_version();
  hdmap_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void Graph::set_hdmap_version(const char* value, size_t size) {
  set_has_hdmap_version();
  hdmap_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* Graph::mutable_hdmap_version() {
  set_has_hdmap_version();

  return hdmap_version_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Graph::release_hdmap_version() {

  clear_has_hdmap_version();
  return hdmap_version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Graph::set_allocated_hdmap_version(::std::string* hdmap_version) {
  if (hdmap_version != NULL) {
    set_has_hdmap_version();
  } else {
    clear_has_hdmap_version();
  }
  hdmap_version_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), hdmap_version);

}

bool Graph::has_hdmap_district() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void Graph::set_has_hdmap_district() {
  _has_bits_[0] |= 0x00000002u;
}
void Graph::clear_has_hdmap_district() {
  _has_bits_[0] &= ~0x00000002u;
}
void Graph::clear_hdmap_district() {
  hdmap_district_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_hdmap_district();
}
 const ::std::string& Graph::hdmap_district() const {

  return hdmap_district_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Graph::set_hdmap_district(const ::std::string& value) {
  set_has_hdmap_district();
  hdmap_district_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);

}
 void Graph::set_hdmap_district(const char* value) {
  set_has_hdmap_district();
  hdmap_district_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));

}
 void Graph::set_hdmap_district(const char* value, size_t size) {
  set_has_hdmap_district();
  hdmap_district_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));

}
 ::std::string* Graph::mutable_hdmap_district() {
  set_has_hdmap_district();

  return hdmap_district_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Graph::release_hdmap_district() {

  clear_has_hdmap_district();
  return hdmap_district_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Graph::set_allocated_hdmap_district(::std::string* hdmap_district) {
  if (hdmap_district != NULL) {
    set_has_hdmap_district();
  } else {
    clear_has_hdmap_district();
  }
  hdmap_district_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), hdmap_district);

}

int Graph::node_size() const {
  return node_.size();
}
void Graph::clear_node() {
  node_.Clear();
}
const ::apollo::routing::Node& Graph::node(int index) const {

  return node_.Get(index);
}
::apollo::routing::Node* Graph::mutable_node(int index) {

  return node_.Mutable(index);
}
::apollo::routing::Node* Graph::add_node() {

  return node_.Add();
}
::google::protobuf::RepeatedPtrField< ::apollo::routing::Node >*
Graph::mutable_node() {

  return &node_;
}
const ::google::protobuf::RepeatedPtrField< ::apollo::routing::Node >&
Graph::node() const {

  return node_;
}

int Graph::edge_size() const {
  return edge_.size();
}
void Graph::clear_edge() {
  edge_.Clear();
}
const ::apollo::routing::Edge& Graph::edge(int index) const {

  return edge_.Get(index);
}
::apollo::routing::Edge* Graph::mutable_edge(int index) {

  return edge_.Mutable(index);
}
::apollo::routing::Edge* Graph::add_edge() {

  return edge_.Add();
}
::google::protobuf::RepeatedPtrField< ::apollo::routing::Edge >*
Graph::mutable_edge() {

  return &edge_;
}
const ::google::protobuf::RepeatedPtrField< ::apollo::routing::Edge >&
Graph::edge() const {

  return edge_;
}

#endif  

}  
}
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: routing/topo_graph.proto

#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "routing/topo_graph.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)

namespace apollo {
namespace routing {

namespace {

const ::google::protobuf::Descriptor* CurvePoint_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CurvePoint_reflection_ = NULL;
const ::google::protobuf::Descriptor* CurveRange_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CurveRange_reflection_ = NULL;
const ::google::protobuf::Descriptor* Node_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  Node_reflection_ = NULL;
const ::google::protobuf::Descriptor* Edge_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  Edge_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* Edge_DirectionType_descriptor_ = NULL;
const ::google::protobuf::Descriptor* Graph_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  Graph_reflection_ = NULL;

}  // namespace


void protobuf_AssignDesc_routing_2ftopo_5fgraph_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AssignDesc_routing_2ftopo_5fgraph_2eproto() {
  protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "routing/topo_graph.proto");
  GOOGLE_CHECK(file != NULL);
  CurvePoint_descriptor_ = file->message_type(0);
  static const int CurvePoint_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurvePoint, s_),
  };
  CurvePoint_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      CurvePoint_descriptor_,
      CurvePoint::default_instance_,
      CurvePoint_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurvePoint, _has_bits_[0]),
      -1,
      -1,
      sizeof(CurvePoint),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurvePoint, _internal_metadata_),
      -1);
  CurveRange_descriptor_ = file->message_type(1);
  static const int CurveRange_offsets_[2] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurveRange, start_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurveRange, end_),
  };
  CurveRange_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      CurveRange_descriptor_,
      CurveRange::default_instance_,
      CurveRange_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurveRange, _has_bits_[0]),
      -1,
      -1,
      sizeof(CurveRange),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CurveRange, _internal_metadata_),
      -1);
  Node_descriptor_ = file->message_type(2);
  static const int Node_offsets_[8] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, lane_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, length_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, left_out_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, right_out_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, cost_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, central_curve_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, is_virtual_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, road_id_),
  };
  Node_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Node_descriptor_,
      Node::default_instance_,
      Node_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, _has_bits_[0]),
      -1,
      -1,
      sizeof(Node),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, _internal_metadata_),
      -1);
  Edge_descriptor_ = file->message_type(3);
  static const int Edge_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, from_lane_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, to_lane_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, cost_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, direction_type_),
  };
  Edge_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Edge_descriptor_,
      Edge::default_instance_,
      Edge_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, _has_bits_[0]),
      -1,
      -1,
      sizeof(Edge),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Edge, _internal_metadata_),
      -1);
  Edge_DirectionType_descriptor_ = Edge_descriptor_->enum_type(0);
  Graph_descriptor_ = file->message_type(4);
  static const int Graph_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, hdmap_version_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, hdmap_district_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, node_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, edge_),
  };
  Graph_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      Graph_descriptor_,
      Graph::default_instance_,
      Graph_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, _has_bits_[0]),
      -1,
      -1,
      sizeof(Graph),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Graph, _internal_metadata_),
      -1);
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_routing_2ftopo_5fgraph_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      CurvePoint_descriptor_, &CurvePoint::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      CurveRange_descriptor_, &CurveRange::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      Node_descriptor_, &Node::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      Edge_descriptor_, &Edge::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      Graph_descriptor_, &Graph::default_instance());
}

}  // namespace

void protobuf_ShutdownFile_routing_2ftopo_5fgraph_2eproto() {
  delete CurvePoint::default_instance_;
  delete CurvePoint_reflection_;
  delete CurveRange::default_instance_;
  delete CurveRange_reflection_;
  delete Node::default_instance_;
  delete Node_reflection_;
  delete Edge::default_instance_;
  delete Edge_reflection_;
  delete Graph::default_instance_;
  delete Graph_reflection_;
}

void protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto() {
  static bool already_here = false;
  if (already_here) return;
  already_here = true;
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::apollo::hdmap::protobuf_AddDesc_map_2fmap_5fgeometry_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\030routing/topo_graph.proto\022\016apollo.routi"
    "ng\032\026map/map_geometry.proto\"\027\n\nCurvePoint"
    "\022\t\n\001s\030\001 \001(\001\"`\n\nCurveRange\022)\n\005start\030\001 \001(\013"
    "2\032.apollo.routing.CurvePoint\022\'\n\003end\030\002 \001("
    "\0132\032.apollo.routing.CurvePoint\"\351\001\n\004Node\022\017"
    "\n\007lane_id\030\001 \001(\t\022\016\n\006length\030\002 \001(\001\022,\n\010left_"
    "out\030\003 \003(\0132\032.apollo.routing.CurveRange\022-\n"
    "\tright_out\030\004 \003(\0132\032.apollo.routing.CurveR"
    "ange\022\014\n\004cost\030\005 \001(\001\022*\n\rcentral_curve\030\006 \001("
    "\0132\023.apollo.hdmap.Curve\022\030\n\nis_virtual\030\007 \001"
    "(\010:\004true\022\017\n\007road_id\030\010 \001(\t\"\255\001\n\004Edge\022\024\n\014fr"
    "om_lane_id\030\001 \001(\t\022\022\n\nto_lane_id\030\002 \001(\t\022\014\n\004"
    "cost\030\003 \001(\001\022:\n\016direction_type\030\004 \001(\0162\".apo"
    "llo.routing.Edge.DirectionType\"1\n\rDirect"
    "ionType\022\013\n\007FORWARD\020\000\022\010\n\004LEFT\020\001\022\t\n\005RIGHT\020"
    "\002\"~\n\005Graph\022\025\n\rhdmap_version\030\001 \001(\t\022\026\n\016hdm"
    "ap_district\030\002 \001(\t\022\"\n\004node\030\003 \003(\0132\024.apollo"
    ".routing.Node\022\"\n\004edge\030\004 \003(\0132\024.apollo.rou"
    "ting.Edge", 729);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "routing/topo_graph.proto", &protobuf_RegisterTypes);
  CurvePoint::default_instance_ = new CurvePoint();
  CurveRange::default_instance_ = new CurveRange();
  Node::default_instance_ = new Node();
  Edge::default_instance_ = new Edge();
  Graph::default_instance_ = new Graph();
  CurvePoint::default_instance_->InitAsDefaultInstance();
  CurveRange::default_instance_->InitAsDefaultInstance();
  Node::default_instance_->InitAsDefaultInstance();
  Edge::default_instance_->InitAsDefaultInstance();
  Graph::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_routing_2ftopo_5fgraph_2eproto);
}

// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_routing_2ftopo_5fgraph_2eproto {
  StaticDescriptorInitializer_routing_2ftopo_5fgraph_2eproto() {
    protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  }
} static_descriptor_initializer_routing_2ftopo_5fgraph_2eproto_;

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int CurvePoint::kSFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

CurvePoint::CurvePoint()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:apollo.routing.CurvePoint)
}

void CurvePoint::InitAsDefaultInstance() {
}

CurvePoint::CurvePoint(const CurvePoint& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:apollo.routing.CurvePoint)
}

void CurvePoint::SharedCtor() {
  _cached_size_ = 0;
  s_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CurvePoint::~CurvePoint() {
  // @@protoc_insertion_point(destructor:apollo.routing.CurvePoint)
  SharedDtor();
}

void CurvePoint::SharedDtor() {
  if (this != default_instance_) {
  }
}

void CurvePoint::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CurvePoint::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CurvePoint_descriptor_;
}

const CurvePoint& CurvePoint::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

CurvePoint* CurvePoint::default_instance_ = NULL;

CurvePoint* CurvePoint::New(::google::protobuf::Arena* arena) const {
  CurvePoint* n = new CurvePoint;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void CurvePoint::Clear() {
// @@protoc_insertion_point(message_clear_start:apollo.routing.CurvePoint)
  s_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool CurvePoint::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:apollo.routing.CurvePoint)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional double s = 1;
      case 1: {
        if (tag == 9) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &s_)));
          set_has_s();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:apollo.routing.CurvePoint)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:apollo.routing.CurvePoint)
  return false;
#undef DO_
}

void CurvePoint::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:apollo.routing.CurvePoint)
  // optional double s = 1;
  if (has_s()) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->s(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:apollo.routing.CurvePoint)
}

::google::protobuf::uint8* CurvePoint::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:apollo.routing.CurvePoint)
  // optional double s = 1;
  if (has_s()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->s(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:apollo.routing.CurvePoint)
  return target;
}

int CurvePoint::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:apollo.routing.CurvePoint)
  int total_size = 0;

  // optional double s = 1;
  if (has_s()) {
    total_size += 1 + 8;
  }

  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void CurvePoint::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:apollo.routing.CurvePoint)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const CurvePoint* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const CurvePoint>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:apollo.routing.CurvePoint)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:apollo.routing.CurvePoint)
    MergeFrom(*source);
  }
}

void CurvePoint::MergeFrom(const CurvePoint& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:apollo.routing.CurvePoint)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_s()) {
      set_s(from.s());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void CurvePoint::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:apollo.routing.CurvePoint)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CurvePoint::CopyFrom(const CurvePoint& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:apollo.routing.CurvePoint)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CurvePoint::IsInitialized() const {

  return true;
}

void CurvePoint::Swap(CurvePoint* other) {
  if (other == this) return;
  InternalSwap(other);
}
void CurvePoint::InternalSwap(CurvePoint* other) {
  std::swap(s_, other->s_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata CurvePoint::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CurvePoint_descriptor_;
  metadata.reflection = CurvePoint_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// CurvePoint

// optional double s = 1;
bool CurvePoint::has_s() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void CurvePoint::set_has_s() {
  _has_bits_[0] |= 0x00000001u;
}
void CurvePoint::clear_has_s() {
  _has_bits_[0] &= ~0x00000001u;
}
void CurvePoint::clear_s() {
  s_ = 0;
  clear_has_s();
}
 double CurvePoint::s() const {
  // @@protoc_insertion_point(field_get:apollo.routing.CurvePoint.s)
  return s_;
}
 void CurvePoint::set_s(double value) {
  set_has_s();
  s_ = value;
  // @@protoc_insertion_point(field_set:apollo.routing.CurvePoint.s)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int CurveRange::kStartFieldNumber;
const int CurveRange::kEndFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

CurveRange::CurveRange()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:apollo.routing.CurveRange)
}

void CurveRange::InitAsDefaultInstance() {
  start_ = const_cast< ::apollo::routing::CurvePoint*>(&::apollo::routing::CurvePoint::default_instance());
  end_ = const_cast< ::apollo::routing::CurvePoint*>(&::apollo::routing::CurvePoint::default_instance());
}

CurveRange::CurveRange(const CurveRange& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:apollo.routing.CurveRange)
}

void CurveRange::SharedCtor() {
  _cached_size_ = 0;
  start_ = NULL;
  end_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CurveRange::~CurveRange() {
  // @@protoc_insertion_point(destructor:apollo.routing.CurveRange)
  SharedDtor();
}

void CurveRange::SharedDtor() {
  if (this != default_instance_) {
    delete start_;
    delete end_;
  }
}

void CurveRange::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CurveRange::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CurveRange_descriptor_;
}

const CurveRange& CurveRange::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

CurveRange* CurveRange::default_instance_ = NULL;

CurveRange* CurveRange::New(::google::protobuf::Arena* arena) const {
  CurveRange* n = new CurveRange;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void CurveRange::Clear() {
// @@protoc_insertion_point(message_clear_start:apollo.routing.CurveRange)
  if (_has_bits_[0 / 32] & 3u) {
    if (has_start()) {
      if (start_ != NULL) start_->::apollo::routing::CurvePoint::Clear();
    }
    if (has_end()) {
      if (end_ != NULL) end_->::apollo::routing::CurvePoint::Clear();
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool CurveRange::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:apollo.routing.CurveRange)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional .apollo.routing.CurvePoint start = 1;
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_start()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_end;
        break;
      }

      // optional .apollo.routing.CurvePoint end = 2;
      case 2: {
        if (tag == 18) {
         parse_end:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_end()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:apollo.routing.CurveRange)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:apollo.routing.CurveRange)
  return false;
#undef DO_
}

void CurveRange::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:apollo.routing.CurveRange)
  // optional .apollo.routing.CurvePoint start = 1;
  if (has_start()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, *this->start_, output);
  }

  // optional .apollo.routing.CurvePoint end = 2;
  if (has_end()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, *this->end_, output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:apollo.routing.CurveRange)
}

::google::protobuf::uint8* CurveRange::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:apollo.routing.CurveRange)
  // optional .apollo.routing.CurvePoint start = 1;
  if (has_start()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        1, *this->start_, false, target);
  }

  // optional .apollo.routing.CurvePoint end = 2;
  if (has_end()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        2, *this->end_, false, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:apollo.routing.CurveRange)
  return target;
}

int CurveRange::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:apollo.routing.CurveRange)
  int total_size = 0;

  if (_has_bits_[0 / 32] & 3u) {
    // optional .apollo.routing.CurvePoint start = 1;
    if (has_start()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->start_);
    }

    // optional .apollo.routing.CurvePoint end = 2;
    if (has_end()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->end_);
    }

  }
  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void CurveRange::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:apollo.routing.CurveRange)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const CurveRange* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const CurveRange>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:apollo.routing.CurveRange)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:apollo.routing.CurveRange)
    MergeFrom(*source);
  }
}

void CurveRange::MergeFrom(const CurveRange& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:apollo.routing.CurveRange)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_start()) {
      mutable_start()->::apollo::routing::CurvePoint::MergeFrom(from.start());
    }
    if (from.has_end()) {
      mutable_end()->::apollo::routing::CurvePoint::MergeFrom(from.end());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void CurveRange::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:apollo.routing.CurveRange)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CurveRange::CopyFrom(const CurveRange& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:apollo.routing.CurveRange)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CurveRange::IsInitialized() const {

  return true;
}

void CurveRange::Swap(CurveRange* other) {
  if (other == this) return;
  InternalSwap(other);
}
void CurveRange::InternalSwap(CurveRange* other) {
  std::swap(start_, other->start_);
  std::swap(end_, other->end_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata CurveRange::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CurveRange_descriptor_;
  metadata.reflection = CurveRange_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// CurveRange

// optional .apollo.routing.CurvePoint start = 1;
bool CurveRange::has_start() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void CurveRange::set_has_start() {
  _has_bits_[0] |= 0x00000001u;
}
void CurveRange::clear_has_start() {
  _has_bits_[0] &= ~0x00000001u;
}
void CurveRange::clear_start() {
  if (start_ != NULL) start_->::apollo::routing::CurvePoint::Clear();
  clear_has_start();
}
const ::apollo::routing::CurvePoint& CurveRange::start() const {
  // @@protoc_insertion_point(field_get:apollo.routing.CurveRange.start)
  return start_ != NULL ? *start_ : *default_instance_->start_;
}
::apollo::routing::CurvePoint* CurveRange::mutable_start() {
  set_has_start();
  if (start_ == NULL) {
    start_ = new ::apollo::routing::CurvePoint;
  }
  // @@protoc_insertion_point(field_mutable:apollo.routing.CurveRange.start)
  return start_;
}
::apollo::routing::CurvePoint* CurveRange::release_start() {
  // @@protoc_insertion_point(field_release:apollo.routing.CurveRange.start)
  clear_has_start();
  ::apollo::routing::CurvePoint* temp = start_;
  start_ = NULL;
  return temp;
}
void CurveRange::set_allocated_start(::apollo::routing::CurvePoint* start) {
  delete start_;
  start_ = start;
  if (start) {
    set_has_start();
  } else {
    clear_has_start();
  }
  // @@protoc_insertion_point(field_set_allocated:apollo.routing.CurveRange.start)
}

// optional .apollo.routing.CurvePoint end = 2;
bool CurveRange::has_end() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void CurveRange::set_has_end() {
  _has_bits_[0] |= 0x00000002u;
}
void CurveRange::clear_has_end() {
  _has_bits_[0] &= ~0x00000002u;
}
void CurveRange::clear_end() {
  if (end_ != NULL) end_->::apollo::routing::CurvePoint::Clear();
  clear_has_end();
}
const ::apollo::routing::CurvePoint& CurveRange::end() const {
  // @@protoc_insertion_point(field_get:apollo.routing.CurveRange.end)
  return end_ != NULL ? *end_ : *default_instance_->end_;
}
::apollo::routing::CurvePoint* CurveRange::mutable_end() {
  set_has_end();
  if (end_ == NULL) {
    end_ = new ::apollo::routing::CurvePoint;
  }
  // @@protoc_insertion_point(field_mutable:apollo.routing.CurveRange.end)
  return end_;
}
::apollo::routing::CurvePoint* CurveRange::release_end() {
  // @@protoc_insertion_point(field_release:apollo.routing.CurveRange.end)
  clear_has_end();
  ::apollo::routing::CurvePoint* temp = end_;
  end_ = NULL;
  return temp;
}
void CurveRange::set_allocated_end(::apollo::routing::CurvePoint* end) {
  delete end_;
  end_ = end;
  if (end) {
    set_has_end();
  } else {
    clear_has_end();
  }
  // @@protoc_insertion_point(field_set_allocated:apollo.routing.CurveRange.end)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Node::kLaneIdFieldNumber;
const int Node::kLengthFieldNumber;
const int Node::kLeftOutFieldNumber;
const int Node::kRightOutFieldNumber;
const int Node::kCostFieldNumber;
const int Node::kCentralCurveFieldNumber;
const int Node::kIsVirtualFieldNumber;
const int Node::kRoadIdFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Node::Node()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:apollo.routing.Node)
}

void Node::InitAsDefaultInstance() {
  central_curve_ = const_cast< ::apollo::hdmap::Curve*>(&::apollo::hdmap::Curve::default_instance());
}

Node::Node(const Node& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:apollo.routing.Node)
}

void Node::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  lane_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  length_ = 0;
  cost_ = 0;
  central_curve_ = NULL;
  is_virtual_ = true;
  road_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Node::~Node() {
  // @@protoc_insertion_point(destructor:apollo.routing.Node)
  SharedDtor();
}

void Node::SharedDtor() {
  lane_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  road_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
    delete central_curve_;
  }
}

void Node::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Node::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Node_descriptor_;
}

const Node& Node::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

Node* Node::default_instance_ = NULL;

Node* Node::New(::google::protobuf::Arena* arena) const {
  Node* n = new Node;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Node::Clear() {
// @@protoc_insertion_point(message_clear_start:apollo.routing.Node)
  if (_has_bits_[0 / 32] & 243u) {
    if (has_lane_id()) {
      lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    length_ = 0;
    cost_ = 0;
    if (has_central_curve()) {
      if (central_curve_ != NULL) central_curve_->::apollo::hdmap::Curve::Clear();
    }
    is_virtual_ = true;
    if (has_road_id()) {
      road_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  left_out_.Clear();
  right_out_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Node::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:apollo.routing.Node)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string lane_id = 1;
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_lane_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->lane_id().data(), this->lane_id().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Node.lane_id");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(17)) goto parse_length;
        break;
      }

      // optional double length = 2;
      case 2: {
        if (tag == 17) {
         parse_length:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &length_)));
          set_has_length();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_left_out;
        break;
      }

      // repeated .apollo.routing.CurveRange left_out = 3;
      case 3: {
        if (tag == 26) {
         parse_left_out:
          DO_(input->IncrementRecursionDepth());
         parse_loop_left_out:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_left_out()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_loop_left_out;
        if (input->ExpectTag(34)) goto parse_loop_right_out;
        input->UnsafeDecrementRecursionDepth();
        break;
      }

      // repeated .apollo.routing.CurveRange right_out = 4;
      case 4: {
        if (tag == 34) {
          DO_(input->IncrementRecursionDepth());
         parse_loop_right_out:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_right_out()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_loop_right_out;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectTag(41)) goto parse_cost;
        break;
      }

      // optional double cost = 5;
      case 5: {
        if (tag == 41) {
         parse_cost:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &cost_)));
          set_has_cost();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(50)) goto parse_central_curve;
        break;
      }

      // optional .apollo.hdmap.Curve central_curve = 6;
      case 6: {
        if (tag == 50) {
         parse_central_curve:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_central_curve()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(56)) goto parse_is_virtual;
        break;
      }

      // optional bool is_virtual = 7 [default = true];
      case 7: {
        if (tag == 56) {
         parse_is_virtual:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &is_virtual_)));
          set_has_is_virtual();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(66)) goto parse_road_id;
        break;
      }

      // optional string road_id = 8;
      case 8: {
        if (tag == 66) {
         parse_road_id:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_road_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->road_id().data(), this->road_id().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Node.road_id");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:apollo.routing.Node)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:apollo.routing.Node)
  return false;
#undef DO_
}

void Node::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:apollo.routing.Node)
  // optional string lane_id = 1;
  if (has_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->lane_id().data(), this->lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Node.lane_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->lane_id(), output);
  }

  // optional double length = 2;
  if (has_length()) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(2, this->length(), output);
  }

  // repeated .apollo.routing.CurveRange left_out = 3;
  for (unsigned int i = 0, n = this->left_out_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->left_out(i), output);
  }

  // repeated .apollo.routing.CurveRange right_out = 4;
  for (unsigned int i = 0, n = this->right_out_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, this->right_out(i), output);
  }

  // optional double cost = 5;
  if (has_cost()) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(5, this->cost(), output);
  }

  // optional .apollo.hdmap.Curve central_curve = 6;
  if (has_central_curve()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      6, *this->central_curve_, output);
  }

  // optional bool is_virtual = 7 [default = true];
  if (has_is_virtual()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->is_virtual(), output);
  }

  // optional string road_id = 8;
  if (has_road_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->road_id().data(), this->road_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Node.road_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      8, this->road_id(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:apollo.routing.Node)
}

::google::protobuf::uint8* Node::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:apollo.routing.Node)
  // optional string lane_id = 1;
  if (has_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->lane_id().data(), this->lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Node.lane_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->lane_id(), target);
  }

  // optional double length = 2;
  if (has_length()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(2, this->length(), target);
  }

  // repeated .apollo.routing.CurveRange left_out = 3;
  for (unsigned int i = 0, n = this->left_out_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        3, this->left_out(i), false, target);
  }

  // repeated .apollo.routing.CurveRange right_out = 4;
  for (unsigned int i = 0, n = this->right_out_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        4, this->right_out(i), false, target);
  }

  // optional double cost = 5;
  if (has_cost()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(5, this->cost(), target);
  }

  // optional .apollo.hdmap.Curve central_curve = 6;
  if (has_central_curve()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        6, *this->central_curve_, false, target);
  }

  // optional bool is_virtual = 7 [default = true];
  if (has_is_virtual()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->is_virtual(), target);
  }

  // optional string road_id = 8;
  if (has_road_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->road_id().data(), this->road_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Node.road_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        8, this->road_id(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:apollo.routing.Node)
  return target;
}

int Node::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:apollo.routing.Node)
  int total_size = 0;

  if (_has_bits_[0 / 32] & 243u) {
    // optional string lane_id = 1;
    if (has_lane_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->lane_id());
    }

    // optional double length = 2;
    if (has_length()) {
      total_size += 1 + 8;
    }

    // optional double cost = 5;
    if (has_cost()) {
      total_size += 1 + 8;
    }

    // optional .apollo.hdmap.Curve central_curve = 6;
    if (has_central_curve()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->central_curve_);
    }

    // optional bool is_virtual = 7 [default = true];
    if (has_is_virtual()) {
      total_size += 1 + 1;
    }

    // optional string road_id = 8;
    if (has_road_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->road_id());
    }

  }
  // repeated .apollo.routing.CurveRange left_out = 3;
  total_size += 1 * this->left_out_size();
  for (int i = 0; i < this->left_out_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->left_out(i));
  }

  // repeated .apollo.routing.CurveRange right_out = 4;
  total_size += 1 * this->right_out_size();
  for (int i = 0; i < this->right_out_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->right_out(i));
  }

  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void Node::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:apollo.routing.Node)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Node* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Node>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:apollo.routing.Node)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:apollo.routing.Node)
    MergeFrom(*source);
  }
}

void Node::MergeFrom(const Node& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:apollo.routing.Node)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  left_out_.MergeFrom(from.left_out_);
  right_out_.MergeFrom(from.right_out_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_lane_id()) {
      set_has_lane_id();
      lane_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.lane_id_);
    }
    if (from.has_length()) {
      set_length(from.length());
    }
    if (from.has_cost()) {
      set_cost(from.cost());
    }
    if (from.has_central_curve()) {
      mutable_central_curve()->::apollo::hdmap::Curve::MergeFrom(from.central_curve());
    }
    if (from.has_is_virtual()) {
      set_is_virtual(from.is_virtual());
    }
    if (from.has_road_id()) {
      set_has_road_id();
      road_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.road_id_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void Node::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:apollo.routing.Node)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Node::CopyFrom(const Node& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:apollo.routing.Node)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Node::IsInitialized() const {

  return true;
}

void Node::Swap(Node* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Node::InternalSwap(Node* other) {
  lane_id_.Swap(&other->lane_id_);
  std::swap(length_, other->length_);
  left_out_.UnsafeArenaSwap(&other->left_out_);
  right_out_.UnsafeArenaSwap(&other->right_out_);
  std::swap(cost_, other->cost_);
  std::swap(central_curve_, other->central_curve_);
  std::swap(is_virtual_, other->is_virtual_);
  road_id_.Swap(&other->road_id_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata Node::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = Node_descriptor_;
  metadata.reflection = Node_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// Node

// optional string lane_id = 1;
bool Node::has_lane_id() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Node::set_has_lane_id() {
  _has_bits_[0] |= 0x00000001u;
}
void Node::clear_has_lane_id() {
  _has_bits_[0] &= ~0x00000001u;
}
void Node::clear_lane_id() {
  lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_lane_id();
}
 const ::std::string& Node::lane_id() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Node.lane_id)
  return lane_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Node::set_lane_id(const ::std::string& value) {
  set_has_lane_id();
  lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:apollo.routing.Node.lane_id)
}
 void Node::set_lane_id(const char* value) {
  set_has_lane_id();
  lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:apollo.routing.Node.lane_id)
}
 void Node::set_lane_id(const char* value, size_t size) {
  set_has_lane_id();
  lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:apollo.routing.Node.lane_id)
}
 ::std::string* Node::mutable_lane_id() {
  set_has_lane_id();
  // @@protoc_insertion_point(field_mutable:apollo.routing.Node.lane_id)
  return lane_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Node::release_lane_id() {
  // @@protoc_insertion_point(field_release:apollo.routing.Node.lane_id)
  clear_has_lane_id();
  return lane_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Node::set_allocated_lane_id(::std::string* lane_id) {
  if (lane_id != NULL) {
    set_has_lane_id();
  } else {
    clear_has_lane_id();
  }
  lane_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), lane_id);
  // @@protoc_insertion_point(field_set_allocated:apollo.routing.Node.lane_id)
}

// optional double length = 2;
bool Node::has_length() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void Node::set_has_length() {
  _has_bits_[0] |= 0x00000002u;
}
void Node::clear_has_length() {
  _has_bits_[0] &= ~0x00000002u;
}
void Node::clear_length() {
  length_ = 0;
  clear_has_length();
}
 double Node::length() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Node.length)
  return length_;
}
 void Node::set_length(double value) {
  set_has_length();
  length_ = value;
  // @@protoc_insertion_point(field_set:apollo.routing.Node.length)
}

// repeated .apollo.routing.CurveRange left_out = 3;
int Node::left_out_size() const {
  return left_out_.size();
}
void Node::clear_left_out() {
  left_out_.Clear();
}
const ::apollo::routing::CurveRange& Node::left_out(int index) const {
  // @@protoc_insertion_point(field_get:apollo.routing.Node.left_out)
  return left_out_.Get(index);
}
::apollo::routing::CurveRange* Node::mutable_left_out(int index) {
  // @@protoc_insertion_point(field_mutable:apollo.routing.Node.left_out)
  return left_out_.Mutable(index);
}
::apollo::routing::CurveRange* Node::add_left_out() {
  // @@protoc_insertion_point(field_add:apollo.routing.Node.left_out)
  return left_out_.Add();
}
::google::protobuf::RepeatedPtrField< ::apollo::routing::CurveRange >*
Node::mutable_left_out() {
  // @@protoc_insertion_point(field_mutable_list:apollo.routing.Node.left_out)
  return &left_out_;
}
const ::google::protobuf::RepeatedPtrField< ::apollo::routing::CurveRange >&
Node::left_out() const {
  // @@protoc_insertion_point(field_list:apollo.routing.Node.left_out)
  return left_out_;
}

// repeated .apollo.routing.CurveRange right_out = 4;
int Node::right_out_size() const {
  return right_out_.size();
}
void Node::clear_right_out() {
  right_out_.Clear();
}
const ::apollo::routing::CurveRange& Node::right_out(int index) const {
  // @@protoc_insertion_point(field_get:apollo.routing.Node.right_out)
  return right_out_.Get(index);
}
::apollo::routing::CurveRange* Node::mutable_right_out(int index) {
  // @@protoc_insertion_point(field_mutable:apollo.routing.Node.right_out)
  return right_out_.Mutable(index);
}
::apollo::routing::CurveRange* Node::add_right_out() {
  // @@protoc_insertion_point(field_add:apollo.routing.Node.right_out)
  return right_out_.Add();
}
::google::protobuf::RepeatedPtrField< ::apollo::routing::CurveRange >*
Node::mutable_right_out() {
  // @@protoc_insertion_point(field_mutable_list:apollo.routing.Node.right_out)
  return &right_out_;
}
const ::google::protobuf::RepeatedPtrField< ::apollo::routing::CurveRange >&
Node::right_out() const {
  // @@protoc_insertion_point(field_list:apollo.routing.Node.right_out)
  return right_out_;
}

// optional double cost = 5;
bool Node::has_cost() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void Node::set_has_cost() {
  _has_bits_[0] |= 0x00000010u;
}
void Node::clear_has_cost() {
  _has_bits_[0] &= ~0x00000010u;
}
void Node::clear_cost() {
  cost_ = 0;
  clear_has_cost();
}
 double Node::cost() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Node.cost)
  return cost_;
}
 void Node::set_cost(double value) {
  set_has_cost();
  cost_ = value;
  // @@protoc_insertion_point(field_set:apollo.routing.Node.cost)
}

// optional .apollo.hdmap.Curve central_curve = 6;
bool Node::has_central_curve() const {
  return (_has_bits_[0] & 0x00000020u) != 0;
}
void Node::set_has_central_curve() {
  _has_bits_[0] |= 0x00000020u;
}
void Node::clear_has_central_curve() {
  _has_bits_[0] &= ~0x00000020u;
}
void Node::clear_central_curve() {
  if (central_curve_ != NULL) central_curve_->::apollo::hdmap::Curve::Clear();
  clear_has_central_curve();
}
const ::apollo::hdmap::Curve& Node::central_curve() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Node.central_curve)
  return central_curve_ != NULL ? *central_curve_ : *default_instance_->central_curve_;
}
::apollo::hdmap::Curve* Node::mutable_central_curve() {
  set_has_central_curve();
  if (central_curve_ == NULL) {
    central_curve_ = new ::apollo::hdmap::Curve;
  }
  // @@protoc_insertion_point(field_mutable:apollo.routing.Node.central_curve)
  return central_curve_;
}
::apollo::hdmap::Curve* Node::release_central_curve() {
  // @@protoc_insertion_point(field_release:apollo.routing.Node.central_curve)
  clear_has_central_curve();
  ::apollo::hdmap::Curve* temp = central_curve_;
  central_curve_ = NULL;
  return temp;
}
void Node::set_allocated_central_curve(::apollo::hdmap::Curve* central_curve) {
  delete central_curve_;
  central_curve_ = central_curve;
  if (central_curve) {
    set_has_central_curve();
  } else {
    clear_has_central_curve();
  }
  // @@protoc_insertion_point(field_set_allocated:apollo.routing.Node.central_curve)
}

// optional bool is_virtual = 7 [default = true];
bool Node::has_is_virtual() const {
  return (_has_bits_[0] & 0x00000040u) != 0;
}
void Node::set_has_is_virtual() {
  _has_bits_[0] |= 0x00000040u;
}
void Node::clear_has_is_virtual() {
  _has_bits_[0] &= ~0x00000040u;
}
void Node::clear_is_virtual() {
  is_virtual_ = true;
  clear_has_is_virtual();
}
 bool Node::is_virtual() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Node.is_virtual)
  return is_virtual_;
}
 void Node::set_is_virtual(bool value) {
  set_has_is_virtual();
  is_virtual_ = value;
  // @@protoc_insertion_point(field_set:apollo.routing.Node.is_virtual)
}

// optional string road_id = 8;
bool Node::has_road_id() const {
  return (_has_bits_[0] & 0x00000080u) != 0;
}
void Node::set_has_road_id() {
  _has_bits_[0] |= 0x00000080u;
}
void Node::clear_has_road_id() {
  _has_bits_[0] &= ~0x00000080u;
}
void Node::clear_road_id() {
  road_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_road_id();
}
 const ::std::string& Node::road_id() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Node.road_id)
  return road_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Node::set_road_id(const ::std::string& value) {
  set_has_road_id();
  road_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:apollo.routing.Node.road_id)
}
 void Node::set_road_id(const char* value) {
  set_has_road_id();
  road_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:apollo.routing.Node.road_id)
}
 void Node::set_road_id(const char* value, size_t size) {
  set_has_road_id();
  road_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:apollo.routing.Node.road_id)
}
 ::std::string* Node::mutable_road_id() {
  set_has_road_id();
  // @@protoc_insertion_point(field_mutable:apollo.routing.Node.road_id)
  return road_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Node::release_road_id() {
  // @@protoc_insertion_point(field_release:apollo.routing.Node.road_id)
  clear_has_road_id();
  return road_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Node::set_allocated_road_id(::std::string* road_id) {
  if (road_id != NULL) {
    set_has_road_id();
  } else {
    clear_has_road_id();
  }
  road_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), road_id);
  // @@protoc_insertion_point(field_set_allocated:apollo.routing.Node.road_id)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

const ::google::protobuf::EnumDescriptor* Edge_DirectionType_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Edge_DirectionType_descriptor_;
}
bool Edge_DirectionType_IsValid(int value) {
  switch(value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const Edge_DirectionType Edge::FORWARD;
const Edge_DirectionType Edge::LEFT;
const Edge_DirectionType Edge::RIGHT;
const Edge_DirectionType Edge::DirectionType_MIN;
const Edge_DirectionType Edge::DirectionType_MAX;
const int Edge::DirectionType_ARRAYSIZE;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Edge::kFromLaneIdFieldNumber;
const int Edge::kToLaneIdFieldNumber;
const int Edge::kCostFieldNumber;
const int Edge::kDirectionTypeFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Edge::Edge()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:apollo.routing.Edge)
}

void Edge::InitAsDefaultInstance() {
}

Edge::Edge(const Edge& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:apollo.routing.Edge)
}

void Edge::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  from_lane_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  to_lane_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  cost_ = 0;
  direction_type_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Edge::~Edge() {
  // @@protoc_insertion_point(destructor:apollo.routing.Edge)
  SharedDtor();
}

void Edge::SharedDtor() {
  from_lane_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  to_lane_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
  }
}

void Edge::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Edge::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Edge_descriptor_;
}

const Edge& Edge::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

Edge* Edge::default_instance_ = NULL;

Edge* Edge::New(::google::protobuf::Arena* arena) const {
  Edge* n = new Edge;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Edge::Clear() {
// @@protoc_insertion_point(message_clear_start:apollo.routing.Edge)
#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(Edge, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<Edge*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&first, 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  if (_has_bits_[0 / 32] & 15u) {
    ZR_(cost_, direction_type_);
    if (has_from_lane_id()) {
      from_lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_to_lane_id()) {
      to_lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }

#undef ZR_HELPER_
#undef ZR_

  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Edge::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:apollo.routing.Edge)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string from_lane_id = 1;
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_from_lane_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->from_lane_id().data(), this->from_lane_id().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Edge.from_lane_id");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_to_lane_id;
        break;
      }

      // optional string to_lane_id = 2;
      case 2: {
        if (tag == 18) {
         parse_to_lane_id:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_to_lane_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->to_lane_id().data(), this->to_lane_id().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Edge.to_lane_id");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(25)) goto parse_cost;
        break;
      }

      // optional double cost = 3;
      case 3: {
        if (tag == 25) {
         parse_cost:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &cost_)));
          set_has_cost();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(32)) goto parse_direction_type;
        break;
      }

      // optional .apollo.routing.Edge.DirectionType direction_type = 4;
      case 4: {
        if (tag == 32) {
         parse_direction_type:
          int value;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          if (::apollo::routing::Edge_DirectionType_IsValid(value)) {
            set_direction_type(static_cast< ::apollo::routing::Edge_DirectionType >(value));
          } else {
            mutable_unknown_fields()->AddVarint(4, value);
          }
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:apollo.routing.Edge)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:apollo.routing.Edge)
  return false;
#undef DO_
}

void Edge::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:apollo.routing.Edge)
  // optional string from_lane_id = 1;
  if (has_from_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->from_lane_id().data(), this->from_lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Edge.from_lane_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->from_lane_id(), output);
  }

  // optional string to_lane_id = 2;
  if (has_to_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->to_lane_id().data(), this->to_lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Edge.to_lane_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->to_lane_id(), output);
  }

  // optional double cost = 3;
  if (has_cost()) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(3, this->cost(), output);
  }

  // optional .apollo.routing.Edge.DirectionType direction_type = 4;
  if (has_direction_type()) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      4, this->direction_type(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:apollo.routing.Edge)
}

::google::protobuf::uint8* Edge::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:apollo.routing.Edge)
  // optional string from_lane_id = 1;
  if (has_from_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->from_lane_id().data(), this->from_lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Edge.from_lane_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->from_lane_id(), target);
  }

  // optional string to_lane_id = 2;
  if (has_to_lane_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->to_lane_id().data(), this->to_lane_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Edge.to_lane_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->to_lane_id(), target);
  }

  // optional double cost = 3;
  if (has_cost()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(3, this->cost(), target);
  }

  // optional .apollo.routing.Edge.DirectionType direction_type = 4;
  if (has_direction_type()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      4, this->direction_type(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:apollo.routing.Edge)
  return target;
}

int Edge::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:apollo.routing.Edge)
  int total_size = 0;

  if (_has_bits_[0 / 32] & 15u) {
    // optional string from_lane_id = 1;
    if (has_from_lane_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->from_lane_id());
    }

    // optional string to_lane_id = 2;
    if (has_to_lane_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->to_lane_id());
    }

    // optional double cost = 3;
    if (has_cost()) {
      total_size += 1 + 8;
    }

    // optional .apollo.routing.Edge.DirectionType direction_type = 4;
    if (has_direction_type()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::EnumSize(this->direction_type());
    }

  }
  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void Edge::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:apollo.routing.Edge)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Edge* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Edge>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:apollo.routing.Edge)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:apollo.routing.Edge)
    MergeFrom(*source);
  }
}

void Edge::MergeFrom(const Edge& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:apollo.routing.Edge)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_from_lane_id()) {
      set_has_from_lane_id();
      from_lane_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.from_lane_id_);
    }
    if (from.has_to_lane_id()) {
      set_has_to_lane_id();
      to_lane_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.to_lane_id_);
    }
    if (from.has_cost()) {
      set_cost(from.cost());
    }
    if (from.has_direction_type()) {
      set_direction_type(from.direction_type());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void Edge::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:apollo.routing.Edge)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Edge::CopyFrom(const Edge& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:apollo.routing.Edge)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Edge::IsInitialized() const {

  return true;
}

void Edge::Swap(Edge* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Edge::InternalSwap(Edge* other) {
  from_lane_id_.Swap(&other->from_lane_id_);
  to_lane_id_.Swap(&other->to_lane_id_);
  std::swap(cost_, other->cost_);
  std::swap(direction_type_, other->direction_type_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata Edge::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = Edge_descriptor_;
  metadata.reflection = Edge_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// Edge

// optional string from_lane_id = 1;
bool Edge::has_from_lane_id() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Edge::set_has_from_lane_id() {
  _has_bits_[0] |= 0x00000001u;
}
void Edge::clear_has_from_lane_id() {
  _has_bits_[0] &= ~0x00000001u;
}
void Edge::clear_from_lane_id() {
  from_lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_from_lane_id();
}
 const ::std::string& Edge::from_lane_id() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Edge.from_lane_id)
  return from_lane_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Edge::set_from_lane_id(const ::std::string& value) {
  set_has_from_lane_id();
  from_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:apollo.routing.Edge.from_lane_id)
}
 void Edge::set_from_lane_id(const char* value) {
  set_has_from_lane_id();
  from_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:apollo.routing.Edge.from_lane_id)
}
 void Edge::set_from_lane_id(const char* value, size_t size) {
  set_has_from_lane_id();
  from_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:apollo.routing.Edge.from_lane_id)
}
 ::std::string* Edge::mutable_from_lane_id() {
  set_has_from_lane_id();
  // @@protoc_insertion_point(field_mutable:apollo.routing.Edge.from_lane_id)
  return from_lane_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Edge::release_from_lane_id() {
  // @@protoc_insertion_point(field_release:apollo.routing.Edge.from_lane_id)
  clear_has_from_lane_id();
  return from_lane_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Edge::set_allocated_from_lane_id(::std::string* from_lane_id) {
  if (from_lane_id != NULL) {
    set_has_from_lane_id();
  } else {
    clear_has_from_lane_id();
  }
  from_lane_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from_lane_id);
  // @@protoc_insertion_point(field_set_allocated:apollo.routing.Edge.from_lane_id)
}

// optional string to_lane_id = 2;
bool Edge::has_to_lane_id() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void Edge::set_has_to_lane_id() {
  _has_bits_[0] |= 0x00000002u;
}
void Edge::clear_has_to_lane_id() {
  _has_bits_[0] &= ~0x00000002u;
}
void Edge::clear_to_lane_id() {
  to_lane_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_to_lane_id();
}
 const ::std::string& Edge::to_lane_id() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Edge.to_lane_id)
  return to_lane_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Edge::set_to_lane_id(const ::std::string& value) {
  set_has_to_lane_id();
  to_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:apollo.routing.Edge.to_lane_id)
}
 void Edge::set_to_lane_id(const char* value) {
  set_has_to_lane_id();
  to_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:apollo.routing.Edge.to_lane_id)
}
 void Edge::set_to_lane_id(const char* value, size_t size) {
  set_has_to_lane_id();
  to_lane_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:apollo.routing.Edge.to_lane_id)
}
 ::std::string* Edge::mutable_to_lane_id() {
  set_has_to_lane_id();
  // @@protoc_insertion_point(field_mutable:apollo.routing.Edge.to_lane_id)
  return to_lane_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Edge::release_to_lane_id() {
  // @@protoc_insertion_point(field_release:apollo.routing.Edge.to_lane_id)
  clear_has_to_lane_id();
  return to_lane_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Edge::set_allocated_to_lane_id(::std::string* to_lane_id) {
  if (to_lane_id != NULL) {
    set_has_to_lane_id();
  } else {
    clear_has_to_lane_id();
  }
  to_lane_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), to_lane_id);
  // @@protoc_insertion_point(field_set_allocated:apollo.routing.Edge.to_lane_id)
}

// optional double cost = 3;
bool Edge::has_cost() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void Edge::set_has_cost() {
  _has_bits_[0] |= 0x00000004u;
}
void Edge::clear_has_cost() {
  _has_bits_[0] &= ~0x00000004u;
}
void Edge::clear_cost() {
  cost_ = 0;
  clear_has_cost();
}
 double Edge::cost() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Edge.cost)
  return cost_;
}
 void Edge::set_cost(double value) {
  set_has_cost();
  cost_ = value;
  // @@protoc_insertion_point(field_set:apollo.routing.Edge.cost)
}

// optional .apollo.routing.Edge.DirectionType direction_type = 4;
bool Edge::has_direction_type() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void Edge::set_has_direction_type() {
  _has_bits_[0] |= 0x00000008u;
}
void Edge::clear_has_direction_type() {
  _has_bits_[0] &= ~0x00000008u;
}
void Edge::clear_direction_type() {
  direction_type_ = 0;
  clear_has_direction_type();
}
 ::apollo::routing::Edge_DirectionType Edge::direction_type() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Edge.direction_type)
  return static_cast< ::apollo::routing::Edge_DirectionType >(direction_type_);
}
 void Edge::set_direction_type(::apollo::routing::Edge_DirectionType value) {
  assert(::apollo::routing::Edge_DirectionType_IsValid(value));
  set_has_direction_type();
  direction_type_ = value;
  // @@protoc_insertion_point(field_set:apollo.routing.Edge.direction_type)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Graph::kHdmapVersionFieldNumber;
const int Graph::kHdmapDistrictFieldNumber;
const int Graph::kNodeFieldNumber;
const int Graph::kEdgeFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Graph::Graph()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:apollo.routing.Graph)
}

void Graph::InitAsDefaultInstance() {
}

Graph::Graph(const Graph& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:apollo.routing.Graph)
}

void Graph::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  hdmap_version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  hdmap_district_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Graph::~Graph() {
  // @@protoc_insertion_point(destructor:apollo.routing.Graph)
  SharedDtor();
}

void Graph::SharedDtor() {
  hdmap_version_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  hdmap_district_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
  }
}

void Graph::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Graph::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Graph_descriptor_;
}

const Graph& Graph::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_routing_2ftopo_5fgraph_2eproto();
  return *default_instance_;
}

Graph* Graph::default_instance_ = NULL;

Graph* Graph::New(::google::protobuf::Arena* arena) const {
  Graph* n = new Graph;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void Graph::Clear() {
// @@protoc_insertion_point(message_clear_start:apollo.routing.Graph)
  if (_has_bits_[0 / 32] & 3u) {
    if (has_hdmap_version()) {
      hdmap_version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_hdmap_district()) {
      hdmap_district_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  node_.Clear();
  edge_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool Graph::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:apollo.routing.Graph)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string hdmap_version = 1;
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_hdmap_version()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->hdmap_version().data(), this->hdmap_version().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Graph.hdmap_version");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_hdmap_district;
        break;
      }

      // optional string hdmap_district = 2;
      case 2: {
        if (tag == 18) {
         parse_hdmap_district:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_hdmap_district()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->hdmap_district().data(), this->hdmap_district().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "apollo.routing.Graph.hdmap_district");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_node;
        break;
      }

      // repeated .apollo.routing.Node node = 3;
      case 3: {
        if (tag == 26) {
         parse_node:
          DO_(input->IncrementRecursionDepth());
         parse_loop_node:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_node()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_loop_node;
        if (input->ExpectTag(34)) goto parse_loop_edge;
        input->UnsafeDecrementRecursionDepth();
        break;
      }

      // repeated .apollo.routing.Edge edge = 4;
      case 4: {
        if (tag == 34) {
          DO_(input->IncrementRecursionDepth());
         parse_loop_edge:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_edge()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_loop_edge;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:apollo.routing.Graph)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:apollo.routing.Graph)
  return false;
#undef DO_
}

void Graph::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:apollo.routing.Graph)
  // optional string hdmap_version = 1;
  if (has_hdmap_version()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->hdmap_version().data(), this->hdmap_version().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Graph.hdmap_version");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->hdmap_version(), output);
  }

  // optional string hdmap_district = 2;
  if (has_hdmap_district()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->hdmap_district().data(), this->hdmap_district().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Graph.hdmap_district");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->hdmap_district(), output);
  }

  // repeated .apollo.routing.Node node = 3;
  for (unsigned int i = 0, n = this->node_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->node(i), output);
  }

  // repeated .apollo.routing.Edge edge = 4;
  for (unsigned int i = 0, n = this->edge_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, this->edge(i), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:apollo.routing.Graph)
}

::google::protobuf::uint8* Graph::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:apollo.routing.Graph)
  // optional string hdmap_version = 1;
  if (has_hdmap_version()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->hdmap_version().data(), this->hdmap_version().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Graph.hdmap_version");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->hdmap_version(), target);
  }

  // optional string hdmap_district = 2;
  if (has_hdmap_district()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->hdmap_district().data(), this->hdmap_district().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "apollo.routing.Graph.hdmap_district");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->hdmap_district(), target);
  }

  // repeated .apollo.routing.Node node = 3;
  for (unsigned int i = 0, n = this->node_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        3, this->node(i), false, target);
  }

  // repeated .apollo.routing.Edge edge = 4;
  for (unsigned int i = 0, n = this->edge_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        4, this->edge(i), false, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:apollo.routing.Graph)
  return target;
}

int Graph::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:apollo.routing.Graph)
  int total_size = 0;

  if (_has_bits_[0 / 32] & 3u) {
    // optional string hdmap_version = 1;
    if (has_hdmap_version()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->hdmap_version());
    }

    // optional string hdmap_district = 2;
    if (has_hdmap_district()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->hdmap_district());
    }

  }
  // repeated .apollo.routing.Node node = 3;
  total_size += 1 * this->node_size();
  for (int i = 0; i < this->node_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->node(i));
  }

  // repeated .apollo.routing.Edge edge = 4;
  total_size += 1 * this->edge_size();
  for (int i = 0; i < this->edge_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->edge(i));
  }

  if (_internal_metadata_.have_unknown_fields()) {
    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;
}

void Graph::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:apollo.routing.Graph)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const Graph* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const Graph>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:apollo.routing.Graph)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:apollo.routing.Graph)
    MergeFrom(*source);
  }
}

void Graph::MergeFrom(const Graph& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:apollo.routing.Graph)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  node_.MergeFrom(from.node_);
  edge_.MergeFrom(from.edge_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_hdmap_version()) {
      set_has_hdmap_version();
      hdmap_version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hdmap_version_);
    }
    if (from.has_hdmap_district()) {
      set_has_hdmap_district();
      hdmap_district_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.hdmap_district_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void Graph::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:apollo.routing.Graph)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Graph::CopyFrom(const Graph& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:apollo.routing.Graph)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Graph::IsInitialized() const {

  return true;
}

void Graph::Swap(Graph* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Graph::InternalSwap(Graph* other) {
  hdmap_version_.Swap(&other->hdmap_version_);
  hdmap_district_.Swap(&other->hdmap_district_);
  node_.UnsafeArenaSwap(&other->node_);
  edge_.UnsafeArenaSwap(&other->edge_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata Graph::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = Graph_descriptor_;
  metadata.reflection = Graph_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// Graph

// optional string hdmap_version = 1;
bool Graph::has_hdmap_version() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void Graph::set_has_hdmap_version() {
  _has_bits_[0] |= 0x00000001u;
}
void Graph::clear_has_hdmap_version() {
  _has_bits_[0] &= ~0x00000001u;
}
void Graph::clear_hdmap_version() {
  hdmap_version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_hdmap_version();
}
 const ::std::string& Graph::hdmap_version() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Graph.hdmap_version)
  return hdmap_version_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Graph::set_hdmap_version(const ::std::string& value) {
  set_has_hdmap_version();
  hdmap_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:apollo.routing.Graph.hdmap_version)
}
 void Graph::set_hdmap_version(const char* value) {
  set_has_hdmap_version();
  hdmap_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:apollo.routing.Graph.hdmap_version)
}
 void Graph::set_hdmap_version(const char* value, size_t size) {
  set_has_hdmap_version();
  hdmap_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:apollo.routing.Graph.hdmap_version)
}
 ::std::string* Graph::mutable_hdmap_version() {
  set_has_hdmap_version();
  // @@protoc_insertion_point(field_mutable:apollo.routing.Graph.hdmap_version)
  return hdmap_version_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Graph::release_hdmap_version() {
  // @@protoc_insertion_point(field_release:apollo.routing.Graph.hdmap_version)
  clear_has_hdmap_version();
  return hdmap_version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Graph::set_allocated_hdmap_version(::std::string* hdmap_version) {
  if (hdmap_version != NULL) {
    set_has_hdmap_version();
  } else {
    clear_has_hdmap_version();
  }
  hdmap_version_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), hdmap_version);
  // @@protoc_insertion_point(field_set_allocated:apollo.routing.Graph.hdmap_version)
}

// optional string hdmap_district = 2;
bool Graph::has_hdmap_district() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void Graph::set_has_hdmap_district() {
  _has_bits_[0] |= 0x00000002u;
}
void Graph::clear_has_hdmap_district() {
  _has_bits_[0] &= ~0x00000002u;
}
void Graph::clear_hdmap_district() {
  hdmap_district_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_hdmap_district();
}
 const ::std::string& Graph::hdmap_district() const {
  // @@protoc_insertion_point(field_get:apollo.routing.Graph.hdmap_district)
  return hdmap_district_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Graph::set_hdmap_district(const ::std::string& value) {
  set_has_hdmap_district();
  hdmap_district_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:apollo.routing.Graph.hdmap_district)
}
 void Graph::set_hdmap_district(const char* value) {
  set_has_hdmap_district();
  hdmap_district_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:apollo.routing.Graph.hdmap_district)
}
 void Graph::set_hdmap_district(const char* value, size_t size) {
  set_has_hdmap_district();
  hdmap_district_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:apollo.routing.Graph.hdmap_district)
}
 ::std::string* Graph::mutable_hdmap_district() {
  set_has_hdmap_district();
  // @@protoc_insertion_point(field_mutable:apollo.routing.Graph.hdmap_district)
  return hdmap_district_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* Graph::release_hdmap_district() {
  // @@protoc_insertion_point(field_release:apollo.routing.Graph.hdmap_district)
  clear_has_hdmap_district();
  return hdmap_district_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void Graph::set_allocated_hdmap_district(::std::string* hdmap_district) {
  if (hdmap_district != NULL) {
    set_has_hdmap_district();
  } else {
    clear_has_hdmap_district();
  }
  hdmap_district_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), hdmap_district);
  // @@protoc_insertion_point(field_set_allocated:apollo.routing.Graph.hdmap_district)
}

// repeated .apollo.routing.Node node = 3;
int Graph::node_size() const {
  return node_.size();
}
void Graph::clear_node() {
  node_.Clear();
}
const ::apollo::routing::Node& Graph::node(int index) const {
  // @@protoc_insertion_point(field_get:apollo.routing.Graph.node)
  return node_.Get(index);
}
::apollo::routing::Node* Graph::mutable_node(int index) {
  // @@protoc_insertion_point(field_mutable:apollo.routing.Graph.node)
  return node_.Mutable(index);
}
::apollo::routing::Node* Graph::add_node() {
  // @@protoc_insertion_point(field_add:apollo.routing.Graph.node)
  return node_.Add();
}
::google::protobuf::RepeatedPtrField< ::apollo::routing::Node >*
Graph::mutable_node() {
  // @@protoc_insertion_point(field_mutable_list:apollo.routing.Graph.node)
  return &node_;
}
const ::google::protobuf::RepeatedPtrField< ::apollo::routing::Node >&
Graph::node() const {
  // @@protoc_insertion_point(field_list:apollo.routing.Graph.node)
  return node_;
}

// repeated .apollo.routing.Edge edge = 4;
int Graph::edge_size() const {
  return edge_.size();
}
void Graph::clear_edge() {
  edge_.Clear();
}
const ::apollo::routing::Edge& Graph::edge(int index) const {
  // @@protoc_insertion_point(field_get:apollo.routing.Graph.edge)
  return edge_.Get(index);
}
::apollo::routing::Edge* Graph::mutable_edge(int index) {
  // @@protoc_insertion_point(field_mutable:apollo.routing.Graph.edge)
  return edge_.Mutable(index);
}
::apollo::routing::Edge* Graph::add_edge() {
  // @@protoc_insertion_point(field_add:apollo.routing.Graph.edge)
  return edge_.Add();
}
::google::protobuf::RepeatedPtrField< ::apollo::routing::Edge >*
Graph::mutable_edge() {
  // @@protoc_insertion_point(field_mutable_list:apollo.routing.Graph.edge)
  return &edge_;
}
const ::google::protobuf::RepeatedPtrField< ::apollo::routing::Edge >&
Graph::edge() const {
  // @@protoc_insertion_point(field_list:apollo.routing.Graph.edge)
  return edge_;
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// @@protoc_insertion_point(namespace_scope)

}  // namespace routing
}  // namespace apollo

// @@protoc_insertion_point(global_scope)
