// automatically generated by the FlatBuffers compiler, do not modify

/**
 * @const
 * @namespace
 */
var osrm = osrm || {};

/**
 * @const
 * @namespace
 */
osrm.engine = osrm.engine || {};

/**
 * @const
 * @namespace
 */
osrm.engine.api = osrm.engine.api || {};

/**
 * @const
 * @namespace
 */
osrm.engine.api.fbresult = osrm.engine.api.fbresult || {};

/**
 * @enum {number}
 */
osrm.engine.api.fbresult.ManeuverType = {
  Turn: 0,
  NewName: 1,
  Depart: 2,
  Arrive: 3,
  Merge: 4,
  OnRamp: 5,
  OffRamp: 6,
  Fork: 7,
  EndOfRoad: 8,
  Continue: 9,
  Roundabout: 10,
  Rotary: 11,
  RoundaboutTurn: 12,
  Notification: 13,
  ExitRoundabout: 14,
  ExitRotary: 15
};

/**
 * @enum {string}
 */
osrm.engine.api.fbresult.ManeuverTypeName = {
  0: 'Turn',
  1: 'NewName',
  2: 'Depart',
  3: 'Arrive',
  4: 'Merge',
  5: 'OnRamp',
  6: 'OffRamp',
  7: 'Fork',
  8: 'EndOfRoad',
  9: 'Continue',
  10: 'Roundabout',
  11: 'Rotary',
  12: 'RoundaboutTurn',
  13: 'Notification',
  14: 'ExitRoundabout',
  15: 'ExitRotary'
};

/**
 * @enum {number}
 */
osrm.engine.api.fbresult.Turn = {
  None: 0,
  UTurn: 1,
  SharpRight: 2,
  Right: 3,
  SlightRight: 4,
  Straight: 5,
  SlightLeft: 6,
  Left: 7,
  SharpLeft: 8
};

/**
 * @enum {string}
 */
osrm.engine.api.fbresult.TurnName = {
  0: 'None',
  1: 'UTurn',
  2: 'SharpRight',
  3: 'Right',
  4: 'SlightRight',
  5: 'Straight',
  6: 'SlightLeft',
  7: 'Left',
  8: 'SharpLeft'
};

/**
 * @constructor
 */
osrm.engine.api.fbresult.Position = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Position}
 */
osrm.engine.api.fbresult.Position.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Position.prototype.longitude = function() {
  return this.bb.readFloat32(this.bb_pos);
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Position.prototype.latitude = function() {
  return this.bb.readFloat32(this.bb_pos + 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} longitude
 * @param {number} latitude
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Position.createPosition = function(builder, longitude, latitude) {
  builder.prep(4, 8);
  builder.writeFloat32(latitude);
  builder.writeFloat32(longitude);
  return builder.offset();
};

/**
 * @constructor
 */
osrm.engine.api.fbresult.Uint64Pair = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Uint64Pair}
 */
osrm.engine.api.fbresult.Uint64Pair.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @returns {flatbuffers.Long}
 */
osrm.engine.api.fbresult.Uint64Pair.prototype.first = function() {
  return this.bb.readUint64(this.bb_pos);
};

/**
 * @returns {flatbuffers.Long}
 */
osrm.engine.api.fbresult.Uint64Pair.prototype.second = function() {
  return this.bb.readUint64(this.bb_pos + 8);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} first
 * @param {flatbuffers.Long} second
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Uint64Pair.createUint64Pair = function(builder, first, second) {
  builder.prep(8, 16);
  builder.writeInt64(second);
  builder.writeInt64(first);
  return builder.offset();
};

/**
 * @constructor
 */
osrm.engine.api.fbresult.Waypoint = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Waypoint}
 */
osrm.engine.api.fbresult.Waypoint.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Waypoint=} obj
 * @returns {osrm.engine.api.fbresult.Waypoint}
 */
osrm.engine.api.fbresult.Waypoint.getRootAsWaypoint = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Waypoint).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Waypoint=} obj
 * @returns {osrm.engine.api.fbresult.Waypoint}
 */
osrm.engine.api.fbresult.Waypoint.getSizePrefixedRootAsWaypoint = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Waypoint).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Waypoint.prototype.hint = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Waypoint.prototype.distance = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Waypoint.prototype.name = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {osrm.engine.api.fbresult.Position=} obj
 * @returns {osrm.engine.api.fbresult.Position|null}
 */
osrm.engine.api.fbresult.Waypoint.prototype.location = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? (obj || new osrm.engine.api.fbresult.Position).__init(this.bb_pos + offset, this.bb) : null;
};

/**
 * @param {osrm.engine.api.fbresult.Uint64Pair=} obj
 * @returns {osrm.engine.api.fbresult.Uint64Pair|null}
 */
osrm.engine.api.fbresult.Waypoint.prototype.nodes = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? (obj || new osrm.engine.api.fbresult.Uint64Pair).__init(this.bb_pos + offset, this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Waypoint.prototype.matchingsIndex = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Waypoint.prototype.waypointIndex = function() {
  var offset = this.bb.__offset(this.bb_pos, 16);
  return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Waypoint.prototype.alternativesCount = function() {
  var offset = this.bb.__offset(this.bb_pos, 18);
  return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Waypoint.prototype.tripsIndex = function() {
  var offset = this.bb.__offset(this.bb_pos, 20);
  return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.Waypoint.startWaypoint = function(builder) {
  builder.startObject(9);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} hintOffset
 */
osrm.engine.api.fbresult.Waypoint.addHint = function(builder, hintOffset) {
  builder.addFieldOffset(0, hintOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} distance
 */
osrm.engine.api.fbresult.Waypoint.addDistance = function(builder, distance) {
  builder.addFieldFloat32(1, distance, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} nameOffset
 */
osrm.engine.api.fbresult.Waypoint.addName = function(builder, nameOffset) {
  builder.addFieldOffset(2, nameOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} locationOffset
 */
osrm.engine.api.fbresult.Waypoint.addLocation = function(builder, locationOffset) {
  builder.addFieldStruct(3, locationOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} nodesOffset
 */
osrm.engine.api.fbresult.Waypoint.addNodes = function(builder, nodesOffset) {
  builder.addFieldStruct(4, nodesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} matchingsIndex
 */
osrm.engine.api.fbresult.Waypoint.addMatchingsIndex = function(builder, matchingsIndex) {
  builder.addFieldInt32(5, matchingsIndex, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} waypointIndex
 */
osrm.engine.api.fbresult.Waypoint.addWaypointIndex = function(builder, waypointIndex) {
  builder.addFieldInt32(6, waypointIndex, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} alternativesCount
 */
osrm.engine.api.fbresult.Waypoint.addAlternativesCount = function(builder, alternativesCount) {
  builder.addFieldInt32(7, alternativesCount, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} tripsIndex
 */
osrm.engine.api.fbresult.Waypoint.addTripsIndex = function(builder, tripsIndex) {
  builder.addFieldInt32(8, tripsIndex, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Waypoint.endWaypoint = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} hintOffset
 * @param {number} distance
 * @param {flatbuffers.Offset} nameOffset
 * @param {flatbuffers.Offset} locationOffset
 * @param {flatbuffers.Offset} nodesOffset
 * @param {number} matchingsIndex
 * @param {number} waypointIndex
 * @param {number} alternativesCount
 * @param {number} tripsIndex
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Waypoint.createWaypoint = function(builder, hintOffset, distance, nameOffset, locationOffset, nodesOffset, matchingsIndex, waypointIndex, alternativesCount, tripsIndex) {
  osrm.engine.api.fbresult.Waypoint.startWaypoint(builder);
  osrm.engine.api.fbresult.Waypoint.addHint(builder, hintOffset);
  osrm.engine.api.fbresult.Waypoint.addDistance(builder, distance);
  osrm.engine.api.fbresult.Waypoint.addName(builder, nameOffset);
  osrm.engine.api.fbresult.Waypoint.addLocation(builder, locationOffset);
  osrm.engine.api.fbresult.Waypoint.addNodes(builder, nodesOffset);
  osrm.engine.api.fbresult.Waypoint.addMatchingsIndex(builder, matchingsIndex);
  osrm.engine.api.fbresult.Waypoint.addWaypointIndex(builder, waypointIndex);
  osrm.engine.api.fbresult.Waypoint.addAlternativesCount(builder, alternativesCount);
  osrm.engine.api.fbresult.Waypoint.addTripsIndex(builder, tripsIndex);
  return osrm.engine.api.fbresult.Waypoint.endWaypoint(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.Metadata = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Metadata}
 */
osrm.engine.api.fbresult.Metadata.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Metadata=} obj
 * @returns {osrm.engine.api.fbresult.Metadata}
 */
osrm.engine.api.fbresult.Metadata.getRootAsMetadata = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Metadata).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Metadata=} obj
 * @returns {osrm.engine.api.fbresult.Metadata}
 */
osrm.engine.api.fbresult.Metadata.getSizePrefixedRootAsMetadata = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Metadata).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {number} index
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array}
 */
osrm.engine.api.fbresult.Metadata.prototype.datasourceNames = function(index, optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Metadata.prototype.datasourceNamesLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.Metadata.startMetadata = function(builder) {
  builder.startObject(1);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} datasourceNamesOffset
 */
osrm.engine.api.fbresult.Metadata.addDatasourceNames = function(builder, datasourceNamesOffset) {
  builder.addFieldOffset(0, datasourceNamesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<flatbuffers.Offset>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Metadata.createDatasourceNamesVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Metadata.startDatasourceNamesVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Metadata.endMetadata = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} datasourceNamesOffset
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Metadata.createMetadata = function(builder, datasourceNamesOffset) {
  osrm.engine.api.fbresult.Metadata.startMetadata(builder);
  osrm.engine.api.fbresult.Metadata.addDatasourceNames(builder, datasourceNamesOffset);
  return osrm.engine.api.fbresult.Metadata.endMetadata(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.Annotation = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Annotation}
 */
osrm.engine.api.fbresult.Annotation.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Annotation=} obj
 * @returns {osrm.engine.api.fbresult.Annotation}
 */
osrm.engine.api.fbresult.Annotation.getRootAsAnnotation = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Annotation).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Annotation=} obj
 * @returns {osrm.engine.api.fbresult.Annotation}
 */
osrm.engine.api.fbresult.Annotation.getSizePrefixedRootAsAnnotation = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Annotation).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.distance = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.distanceLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Uint32Array}
 */
osrm.engine.api.fbresult.Annotation.prototype.distanceArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.duration = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.durationLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Uint32Array}
 */
osrm.engine.api.fbresult.Annotation.prototype.durationArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.datasources = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.datasourcesLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Uint32Array}
 */
osrm.engine.api.fbresult.Annotation.prototype.datasourcesArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.nodes = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.nodesLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Uint32Array}
 */
osrm.engine.api.fbresult.Annotation.prototype.nodesArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.weight = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.weightLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Uint32Array}
 */
osrm.engine.api.fbresult.Annotation.prototype.weightArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.speed = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Annotation.prototype.speedLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Float32Array}
 */
osrm.engine.api.fbresult.Annotation.prototype.speedArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {osrm.engine.api.fbresult.Metadata=} obj
 * @returns {osrm.engine.api.fbresult.Metadata|null}
 */
osrm.engine.api.fbresult.Annotation.prototype.metadata = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 16);
  return offset ? (obj || new osrm.engine.api.fbresult.Metadata).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.Annotation.startAnnotation = function(builder) {
  builder.startObject(7);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} distanceOffset
 */
osrm.engine.api.fbresult.Annotation.addDistance = function(builder, distanceOffset) {
  builder.addFieldOffset(0, distanceOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Annotation.createDistanceVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Annotation.startDistanceVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} durationOffset
 */
osrm.engine.api.fbresult.Annotation.addDuration = function(builder, durationOffset) {
  builder.addFieldOffset(1, durationOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Annotation.createDurationVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Annotation.startDurationVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} datasourcesOffset
 */
osrm.engine.api.fbresult.Annotation.addDatasources = function(builder, datasourcesOffset) {
  builder.addFieldOffset(2, datasourcesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Annotation.createDatasourcesVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Annotation.startDatasourcesVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} nodesOffset
 */
osrm.engine.api.fbresult.Annotation.addNodes = function(builder, nodesOffset) {
  builder.addFieldOffset(3, nodesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Annotation.createNodesVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Annotation.startNodesVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} weightOffset
 */
osrm.engine.api.fbresult.Annotation.addWeight = function(builder, weightOffset) {
  builder.addFieldOffset(4, weightOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Annotation.createWeightVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Annotation.startWeightVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} speedOffset
 */
osrm.engine.api.fbresult.Annotation.addSpeed = function(builder, speedOffset) {
  builder.addFieldOffset(5, speedOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Annotation.createSpeedVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addFloat32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Annotation.startSpeedVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} metadataOffset
 */
osrm.engine.api.fbresult.Annotation.addMetadata = function(builder, metadataOffset) {
  builder.addFieldOffset(6, metadataOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Annotation.endAnnotation = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} distanceOffset
 * @param {flatbuffers.Offset} durationOffset
 * @param {flatbuffers.Offset} datasourcesOffset
 * @param {flatbuffers.Offset} nodesOffset
 * @param {flatbuffers.Offset} weightOffset
 * @param {flatbuffers.Offset} speedOffset
 * @param {flatbuffers.Offset} metadataOffset
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Annotation.createAnnotation = function(builder, distanceOffset, durationOffset, datasourcesOffset, nodesOffset, weightOffset, speedOffset, metadataOffset) {
  osrm.engine.api.fbresult.Annotation.startAnnotation(builder);
  osrm.engine.api.fbresult.Annotation.addDistance(builder, distanceOffset);
  osrm.engine.api.fbresult.Annotation.addDuration(builder, durationOffset);
  osrm.engine.api.fbresult.Annotation.addDatasources(builder, datasourcesOffset);
  osrm.engine.api.fbresult.Annotation.addNodes(builder, nodesOffset);
  osrm.engine.api.fbresult.Annotation.addWeight(builder, weightOffset);
  osrm.engine.api.fbresult.Annotation.addSpeed(builder, speedOffset);
  osrm.engine.api.fbresult.Annotation.addMetadata(builder, metadataOffset);
  return osrm.engine.api.fbresult.Annotation.endAnnotation(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.StepManeuver = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.StepManeuver}
 */
osrm.engine.api.fbresult.StepManeuver.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.StepManeuver=} obj
 * @returns {osrm.engine.api.fbresult.StepManeuver}
 */
osrm.engine.api.fbresult.StepManeuver.getRootAsStepManeuver = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.StepManeuver).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.StepManeuver=} obj
 * @returns {osrm.engine.api.fbresult.StepManeuver}
 */
osrm.engine.api.fbresult.StepManeuver.getSizePrefixedRootAsStepManeuver = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.StepManeuver).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {osrm.engine.api.fbresult.Position=} obj
 * @returns {osrm.engine.api.fbresult.Position|null}
 */
osrm.engine.api.fbresult.StepManeuver.prototype.location = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? (obj || new osrm.engine.api.fbresult.Position).__init(this.bb_pos + offset, this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.StepManeuver.prototype.bearingBefore = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.StepManeuver.prototype.bearingAfter = function() {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
};

/**
 * @returns {osrm.engine.api.fbresult.ManeuverType}
 */
osrm.engine.api.fbresult.StepManeuver.prototype.type = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? /** @type {osrm.engine.api.fbresult.ManeuverType} */ (this.bb.readInt8(this.bb_pos + offset)) : osrm.engine.api.fbresult.ManeuverType.Turn;
};

/**
 * @returns {osrm.engine.api.fbresult.Turn}
 */
osrm.engine.api.fbresult.StepManeuver.prototype.modifier = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? /** @type {osrm.engine.api.fbresult.Turn} */ (this.bb.readInt8(this.bb_pos + offset)) : osrm.engine.api.fbresult.Turn.None;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.StepManeuver.prototype.exit = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.StepManeuver.startStepManeuver = function(builder) {
  builder.startObject(6);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} locationOffset
 */
osrm.engine.api.fbresult.StepManeuver.addLocation = function(builder, locationOffset) {
  builder.addFieldStruct(0, locationOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} bearingBefore
 */
osrm.engine.api.fbresult.StepManeuver.addBearingBefore = function(builder, bearingBefore) {
  builder.addFieldInt16(1, bearingBefore, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} bearingAfter
 */
osrm.engine.api.fbresult.StepManeuver.addBearingAfter = function(builder, bearingAfter) {
  builder.addFieldInt16(2, bearingAfter, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {osrm.engine.api.fbresult.ManeuverType} type
 */
osrm.engine.api.fbresult.StepManeuver.addType = function(builder, type) {
  builder.addFieldInt8(3, type, osrm.engine.api.fbresult.ManeuverType.Turn);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {osrm.engine.api.fbresult.Turn} modifier
 */
osrm.engine.api.fbresult.StepManeuver.addModifier = function(builder, modifier) {
  builder.addFieldInt8(4, modifier, osrm.engine.api.fbresult.Turn.None);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} exit
 */
osrm.engine.api.fbresult.StepManeuver.addExit = function(builder, exit) {
  builder.addFieldInt8(5, exit, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.StepManeuver.endStepManeuver = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} locationOffset
 * @param {number} bearingBefore
 * @param {number} bearingAfter
 * @param {osrm.engine.api.fbresult.ManeuverType} type
 * @param {osrm.engine.api.fbresult.Turn} modifier
 * @param {number} exit
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.StepManeuver.createStepManeuver = function(builder, locationOffset, bearingBefore, bearingAfter, type, modifier, exit) {
  osrm.engine.api.fbresult.StepManeuver.startStepManeuver(builder);
  osrm.engine.api.fbresult.StepManeuver.addLocation(builder, locationOffset);
  osrm.engine.api.fbresult.StepManeuver.addBearingBefore(builder, bearingBefore);
  osrm.engine.api.fbresult.StepManeuver.addBearingAfter(builder, bearingAfter);
  osrm.engine.api.fbresult.StepManeuver.addType(builder, type);
  osrm.engine.api.fbresult.StepManeuver.addModifier(builder, modifier);
  osrm.engine.api.fbresult.StepManeuver.addExit(builder, exit);
  return osrm.engine.api.fbresult.StepManeuver.endStepManeuver(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.Lane = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Lane}
 */
osrm.engine.api.fbresult.Lane.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Lane=} obj
 * @returns {osrm.engine.api.fbresult.Lane}
 */
osrm.engine.api.fbresult.Lane.getRootAsLane = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Lane).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Lane=} obj
 * @returns {osrm.engine.api.fbresult.Lane}
 */
osrm.engine.api.fbresult.Lane.getSizePrefixedRootAsLane = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Lane).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {number} index
 * @returns {osrm.engine.api.fbresult.Turn}
 */
osrm.engine.api.fbresult.Lane.prototype.indications = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? /** @type {osrm.engine.api.fbresult.Turn} */ (this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index)) : /** @type {osrm.engine.api.fbresult.Turn} */ (0);
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Lane.prototype.indicationsLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Int8Array}
 */
osrm.engine.api.fbresult.Lane.prototype.indicationsArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @returns {boolean}
 */
osrm.engine.api.fbresult.Lane.prototype.valid = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.Lane.startLane = function(builder) {
  builder.startObject(2);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} indicationsOffset
 */
osrm.engine.api.fbresult.Lane.addIndications = function(builder, indicationsOffset) {
  builder.addFieldOffset(0, indicationsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<osrm.engine.api.fbresult.Turn>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Lane.createIndicationsVector = function(builder, data) {
  builder.startVector(1, data.length, 1);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt8(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Lane.startIndicationsVector = function(builder, numElems) {
  builder.startVector(1, numElems, 1);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {boolean} valid
 */
osrm.engine.api.fbresult.Lane.addValid = function(builder, valid) {
  builder.addFieldInt8(1, +valid, +false);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Lane.endLane = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} indicationsOffset
 * @param {boolean} valid
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Lane.createLane = function(builder, indicationsOffset, valid) {
  osrm.engine.api.fbresult.Lane.startLane(builder);
  osrm.engine.api.fbresult.Lane.addIndications(builder, indicationsOffset);
  osrm.engine.api.fbresult.Lane.addValid(builder, valid);
  return osrm.engine.api.fbresult.Lane.endLane(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.Intersection = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Intersection}
 */
osrm.engine.api.fbresult.Intersection.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Intersection=} obj
 * @returns {osrm.engine.api.fbresult.Intersection}
 */
osrm.engine.api.fbresult.Intersection.getRootAsIntersection = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Intersection).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Intersection=} obj
 * @returns {osrm.engine.api.fbresult.Intersection}
 */
osrm.engine.api.fbresult.Intersection.getSizePrefixedRootAsIntersection = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Intersection).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {osrm.engine.api.fbresult.Position=} obj
 * @returns {osrm.engine.api.fbresult.Position|null}
 */
osrm.engine.api.fbresult.Intersection.prototype.location = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? (obj || new osrm.engine.api.fbresult.Position).__init(this.bb_pos + offset, this.bb) : null;
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Intersection.prototype.bearings = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.readInt16(this.bb.__vector(this.bb_pos + offset) + index * 2) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Intersection.prototype.bearingsLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Int16Array}
 */
osrm.engine.api.fbresult.Intersection.prototype.bearingsArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? new Int16Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {number} index
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array}
 */
osrm.engine.api.fbresult.Intersection.prototype.classes = function(index, optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Intersection.prototype.classesLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {number} index
 * @returns {boolean}
 */
osrm.engine.api.fbresult.Intersection.prototype.entry = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? !!this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : false;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Intersection.prototype.entryLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Int8Array}
 */
osrm.engine.api.fbresult.Intersection.prototype.entryArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? new Int8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Intersection.prototype.inBearing = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Intersection.prototype.outBearing = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
};

/**
 * @param {number} index
 * @param {osrm.engine.api.fbresult.Lane=} obj
 * @returns {osrm.engine.api.fbresult.Lane}
 */
osrm.engine.api.fbresult.Intersection.prototype.lanes = function(index, obj) {
  var offset = this.bb.__offset(this.bb_pos, 16);
  return offset ? (obj || new osrm.engine.api.fbresult.Lane).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Intersection.prototype.lanesLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 16);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.Intersection.startIntersection = function(builder) {
  builder.startObject(7);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} locationOffset
 */
osrm.engine.api.fbresult.Intersection.addLocation = function(builder, locationOffset) {
  builder.addFieldStruct(0, locationOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} bearingsOffset
 */
osrm.engine.api.fbresult.Intersection.addBearings = function(builder, bearingsOffset) {
  builder.addFieldOffset(1, bearingsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Intersection.createBearingsVector = function(builder, data) {
  builder.startVector(2, data.length, 2);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt16(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Intersection.startBearingsVector = function(builder, numElems) {
  builder.startVector(2, numElems, 2);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} classesOffset
 */
osrm.engine.api.fbresult.Intersection.addClasses = function(builder, classesOffset) {
  builder.addFieldOffset(2, classesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<flatbuffers.Offset>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Intersection.createClassesVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Intersection.startClassesVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} entryOffset
 */
osrm.engine.api.fbresult.Intersection.addEntry = function(builder, entryOffset) {
  builder.addFieldOffset(3, entryOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<boolean>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Intersection.createEntryVector = function(builder, data) {
  builder.startVector(1, data.length, 1);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt8(+data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Intersection.startEntryVector = function(builder, numElems) {
  builder.startVector(1, numElems, 1);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} inBearing
 */
osrm.engine.api.fbresult.Intersection.addInBearing = function(builder, inBearing) {
  builder.addFieldInt32(4, inBearing, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} outBearing
 */
osrm.engine.api.fbresult.Intersection.addOutBearing = function(builder, outBearing) {
  builder.addFieldInt32(5, outBearing, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} lanesOffset
 */
osrm.engine.api.fbresult.Intersection.addLanes = function(builder, lanesOffset) {
  builder.addFieldOffset(6, lanesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<flatbuffers.Offset>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Intersection.createLanesVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Intersection.startLanesVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Intersection.endIntersection = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} locationOffset
 * @param {flatbuffers.Offset} bearingsOffset
 * @param {flatbuffers.Offset} classesOffset
 * @param {flatbuffers.Offset} entryOffset
 * @param {number} inBearing
 * @param {number} outBearing
 * @param {flatbuffers.Offset} lanesOffset
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Intersection.createIntersection = function(builder, locationOffset, bearingsOffset, classesOffset, entryOffset, inBearing, outBearing, lanesOffset) {
  osrm.engine.api.fbresult.Intersection.startIntersection(builder);
  osrm.engine.api.fbresult.Intersection.addLocation(builder, locationOffset);
  osrm.engine.api.fbresult.Intersection.addBearings(builder, bearingsOffset);
  osrm.engine.api.fbresult.Intersection.addClasses(builder, classesOffset);
  osrm.engine.api.fbresult.Intersection.addEntry(builder, entryOffset);
  osrm.engine.api.fbresult.Intersection.addInBearing(builder, inBearing);
  osrm.engine.api.fbresult.Intersection.addOutBearing(builder, outBearing);
  osrm.engine.api.fbresult.Intersection.addLanes(builder, lanesOffset);
  return osrm.engine.api.fbresult.Intersection.endIntersection(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.Step = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Step}
 */
osrm.engine.api.fbresult.Step.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Step=} obj
 * @returns {osrm.engine.api.fbresult.Step}
 */
osrm.engine.api.fbresult.Step.getRootAsStep = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Step).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Step=} obj
 * @returns {osrm.engine.api.fbresult.Step}
 */
osrm.engine.api.fbresult.Step.getSizePrefixedRootAsStep = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Step).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Step.prototype.distance = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Step.prototype.duration = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Step.prototype.polyline = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {number} index
 * @param {osrm.engine.api.fbresult.Position=} obj
 * @returns {osrm.engine.api.fbresult.Position}
 */
osrm.engine.api.fbresult.Step.prototype.coordinates = function(index, obj) {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? (obj || new osrm.engine.api.fbresult.Position).__init(this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Step.prototype.coordinatesLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Step.prototype.weight = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Step.prototype.name = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Step.prototype.ref = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 16);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Step.prototype.pronunciation = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 18);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Step.prototype.destinations = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 20);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Step.prototype.exits = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 22);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Step.prototype.mode = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 24);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {osrm.engine.api.fbresult.StepManeuver=} obj
 * @returns {osrm.engine.api.fbresult.StepManeuver|null}
 */
osrm.engine.api.fbresult.Step.prototype.maneuver = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 26);
  return offset ? (obj || new osrm.engine.api.fbresult.StepManeuver).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {number} index
 * @param {osrm.engine.api.fbresult.Intersection=} obj
 * @returns {osrm.engine.api.fbresult.Intersection}
 */
osrm.engine.api.fbresult.Step.prototype.intersections = function(index, obj) {
  var offset = this.bb.__offset(this.bb_pos, 28);
  return offset ? (obj || new osrm.engine.api.fbresult.Intersection).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Step.prototype.intersectionsLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 28);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Step.prototype.rotaryName = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 30);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Step.prototype.rotaryPronunciation = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 32);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @returns {boolean}
 */
osrm.engine.api.fbresult.Step.prototype.drivingSide = function() {
  var offset = this.bb.__offset(this.bb_pos, 34);
  return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.Step.startStep = function(builder) {
  builder.startObject(16);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} distance
 */
osrm.engine.api.fbresult.Step.addDistance = function(builder, distance) {
  builder.addFieldFloat32(0, distance, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} duration
 */
osrm.engine.api.fbresult.Step.addDuration = function(builder, duration) {
  builder.addFieldFloat32(1, duration, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} polylineOffset
 */
osrm.engine.api.fbresult.Step.addPolyline = function(builder, polylineOffset) {
  builder.addFieldOffset(2, polylineOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} coordinatesOffset
 */
osrm.engine.api.fbresult.Step.addCoordinates = function(builder, coordinatesOffset) {
  builder.addFieldOffset(3, coordinatesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Step.startCoordinatesVector = function(builder, numElems) {
  builder.startVector(8, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} weight
 */
osrm.engine.api.fbresult.Step.addWeight = function(builder, weight) {
  builder.addFieldFloat32(4, weight, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} nameOffset
 */
osrm.engine.api.fbresult.Step.addName = function(builder, nameOffset) {
  builder.addFieldOffset(5, nameOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} refOffset
 */
osrm.engine.api.fbresult.Step.addRef = function(builder, refOffset) {
  builder.addFieldOffset(6, refOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} pronunciationOffset
 */
osrm.engine.api.fbresult.Step.addPronunciation = function(builder, pronunciationOffset) {
  builder.addFieldOffset(7, pronunciationOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} destinationsOffset
 */
osrm.engine.api.fbresult.Step.addDestinations = function(builder, destinationsOffset) {
  builder.addFieldOffset(8, destinationsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} exitsOffset
 */
osrm.engine.api.fbresult.Step.addExits = function(builder, exitsOffset) {
  builder.addFieldOffset(9, exitsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} modeOffset
 */
osrm.engine.api.fbresult.Step.addMode = function(builder, modeOffset) {
  builder.addFieldOffset(10, modeOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} maneuverOffset
 */
osrm.engine.api.fbresult.Step.addManeuver = function(builder, maneuverOffset) {
  builder.addFieldOffset(11, maneuverOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} intersectionsOffset
 */
osrm.engine.api.fbresult.Step.addIntersections = function(builder, intersectionsOffset) {
  builder.addFieldOffset(12, intersectionsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<flatbuffers.Offset>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Step.createIntersectionsVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Step.startIntersectionsVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} rotaryNameOffset
 */
osrm.engine.api.fbresult.Step.addRotaryName = function(builder, rotaryNameOffset) {
  builder.addFieldOffset(13, rotaryNameOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} rotaryPronunciationOffset
 */
osrm.engine.api.fbresult.Step.addRotaryPronunciation = function(builder, rotaryPronunciationOffset) {
  builder.addFieldOffset(14, rotaryPronunciationOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {boolean} drivingSide
 */
osrm.engine.api.fbresult.Step.addDrivingSide = function(builder, drivingSide) {
  builder.addFieldInt8(15, +drivingSide, +false);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Step.endStep = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} distance
 * @param {number} duration
 * @param {flatbuffers.Offset} polylineOffset
 * @param {flatbuffers.Offset} coordinatesOffset
 * @param {number} weight
 * @param {flatbuffers.Offset} nameOffset
 * @param {flatbuffers.Offset} refOffset
 * @param {flatbuffers.Offset} pronunciationOffset
 * @param {flatbuffers.Offset} destinationsOffset
 * @param {flatbuffers.Offset} exitsOffset
 * @param {flatbuffers.Offset} modeOffset
 * @param {flatbuffers.Offset} maneuverOffset
 * @param {flatbuffers.Offset} intersectionsOffset
 * @param {flatbuffers.Offset} rotaryNameOffset
 * @param {flatbuffers.Offset} rotaryPronunciationOffset
 * @param {boolean} drivingSide
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Step.createStep = function(builder, distance, duration, polylineOffset, coordinatesOffset, weight, nameOffset, refOffset, pronunciationOffset, destinationsOffset, exitsOffset, modeOffset, maneuverOffset, intersectionsOffset, rotaryNameOffset, rotaryPronunciationOffset, drivingSide) {
  osrm.engine.api.fbresult.Step.startStep(builder);
  osrm.engine.api.fbresult.Step.addDistance(builder, distance);
  osrm.engine.api.fbresult.Step.addDuration(builder, duration);
  osrm.engine.api.fbresult.Step.addPolyline(builder, polylineOffset);
  osrm.engine.api.fbresult.Step.addCoordinates(builder, coordinatesOffset);
  osrm.engine.api.fbresult.Step.addWeight(builder, weight);
  osrm.engine.api.fbresult.Step.addName(builder, nameOffset);
  osrm.engine.api.fbresult.Step.addRef(builder, refOffset);
  osrm.engine.api.fbresult.Step.addPronunciation(builder, pronunciationOffset);
  osrm.engine.api.fbresult.Step.addDestinations(builder, destinationsOffset);
  osrm.engine.api.fbresult.Step.addExits(builder, exitsOffset);
  osrm.engine.api.fbresult.Step.addMode(builder, modeOffset);
  osrm.engine.api.fbresult.Step.addManeuver(builder, maneuverOffset);
  osrm.engine.api.fbresult.Step.addIntersections(builder, intersectionsOffset);
  osrm.engine.api.fbresult.Step.addRotaryName(builder, rotaryNameOffset);
  osrm.engine.api.fbresult.Step.addRotaryPronunciation(builder, rotaryPronunciationOffset);
  osrm.engine.api.fbresult.Step.addDrivingSide(builder, drivingSide);
  return osrm.engine.api.fbresult.Step.endStep(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.Leg = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Leg}
 */
osrm.engine.api.fbresult.Leg.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Leg=} obj
 * @returns {osrm.engine.api.fbresult.Leg}
 */
osrm.engine.api.fbresult.Leg.getRootAsLeg = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Leg).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Leg=} obj
 * @returns {osrm.engine.api.fbresult.Leg}
 */
osrm.engine.api.fbresult.Leg.getSizePrefixedRootAsLeg = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Leg).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Leg.prototype.distance = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Leg.prototype.duration = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Leg.prototype.weight = function() {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Leg.prototype.summary = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {osrm.engine.api.fbresult.Annotation=} obj
 * @returns {osrm.engine.api.fbresult.Annotation|null}
 */
osrm.engine.api.fbresult.Leg.prototype.annotations = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? (obj || new osrm.engine.api.fbresult.Annotation).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {number} index
 * @param {osrm.engine.api.fbresult.Step=} obj
 * @returns {osrm.engine.api.fbresult.Step}
 */
osrm.engine.api.fbresult.Leg.prototype.steps = function(index, obj) {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? (obj || new osrm.engine.api.fbresult.Step).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Leg.prototype.stepsLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.Leg.startLeg = function(builder) {
  builder.startObject(6);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} distance
 */
osrm.engine.api.fbresult.Leg.addDistance = function(builder, distance) {
  builder.addFieldFloat64(0, distance, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} duration
 */
osrm.engine.api.fbresult.Leg.addDuration = function(builder, duration) {
  builder.addFieldFloat64(1, duration, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} weight
 */
osrm.engine.api.fbresult.Leg.addWeight = function(builder, weight) {
  builder.addFieldFloat64(2, weight, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} summaryOffset
 */
osrm.engine.api.fbresult.Leg.addSummary = function(builder, summaryOffset) {
  builder.addFieldOffset(3, summaryOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} annotationsOffset
 */
osrm.engine.api.fbresult.Leg.addAnnotations = function(builder, annotationsOffset) {
  builder.addFieldOffset(4, annotationsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} stepsOffset
 */
osrm.engine.api.fbresult.Leg.addSteps = function(builder, stepsOffset) {
  builder.addFieldOffset(5, stepsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<flatbuffers.Offset>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Leg.createStepsVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Leg.startStepsVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Leg.endLeg = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} distance
 * @param {number} duration
 * @param {number} weight
 * @param {flatbuffers.Offset} summaryOffset
 * @param {flatbuffers.Offset} annotationsOffset
 * @param {flatbuffers.Offset} stepsOffset
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Leg.createLeg = function(builder, distance, duration, weight, summaryOffset, annotationsOffset, stepsOffset) {
  osrm.engine.api.fbresult.Leg.startLeg(builder);
  osrm.engine.api.fbresult.Leg.addDistance(builder, distance);
  osrm.engine.api.fbresult.Leg.addDuration(builder, duration);
  osrm.engine.api.fbresult.Leg.addWeight(builder, weight);
  osrm.engine.api.fbresult.Leg.addSummary(builder, summaryOffset);
  osrm.engine.api.fbresult.Leg.addAnnotations(builder, annotationsOffset);
  osrm.engine.api.fbresult.Leg.addSteps(builder, stepsOffset);
  return osrm.engine.api.fbresult.Leg.endLeg(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.RouteObject = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.RouteObject}
 */
osrm.engine.api.fbresult.RouteObject.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.RouteObject=} obj
 * @returns {osrm.engine.api.fbresult.RouteObject}
 */
osrm.engine.api.fbresult.RouteObject.getRootAsRouteObject = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.RouteObject).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.RouteObject=} obj
 * @returns {osrm.engine.api.fbresult.RouteObject}
 */
osrm.engine.api.fbresult.RouteObject.getSizePrefixedRootAsRouteObject = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.RouteObject).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.RouteObject.prototype.distance = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.RouteObject.prototype.duration = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.RouteObject.prototype.weight = function() {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.RouteObject.prototype.weightName = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.RouteObject.prototype.confidence = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.RouteObject.prototype.polyline = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {number} index
 * @param {osrm.engine.api.fbresult.Position=} obj
 * @returns {osrm.engine.api.fbresult.Position}
 */
osrm.engine.api.fbresult.RouteObject.prototype.coordinates = function(index, obj) {
  var offset = this.bb.__offset(this.bb_pos, 16);
  return offset ? (obj || new osrm.engine.api.fbresult.Position).__init(this.bb.__vector(this.bb_pos + offset) + index * 8, this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.RouteObject.prototype.coordinatesLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 16);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {number} index
 * @param {osrm.engine.api.fbresult.Leg=} obj
 * @returns {osrm.engine.api.fbresult.Leg}
 */
osrm.engine.api.fbresult.RouteObject.prototype.legs = function(index, obj) {
  var offset = this.bb.__offset(this.bb_pos, 18);
  return offset ? (obj || new osrm.engine.api.fbresult.Leg).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.RouteObject.prototype.legsLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 18);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.RouteObject.startRouteObject = function(builder) {
  builder.startObject(8);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} distance
 */
osrm.engine.api.fbresult.RouteObject.addDistance = function(builder, distance) {
  builder.addFieldFloat32(0, distance, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} duration
 */
osrm.engine.api.fbresult.RouteObject.addDuration = function(builder, duration) {
  builder.addFieldFloat32(1, duration, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} weight
 */
osrm.engine.api.fbresult.RouteObject.addWeight = function(builder, weight) {
  builder.addFieldFloat32(2, weight, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} weightNameOffset
 */
osrm.engine.api.fbresult.RouteObject.addWeightName = function(builder, weightNameOffset) {
  builder.addFieldOffset(3, weightNameOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} confidence
 */
osrm.engine.api.fbresult.RouteObject.addConfidence = function(builder, confidence) {
  builder.addFieldFloat32(4, confidence, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} polylineOffset
 */
osrm.engine.api.fbresult.RouteObject.addPolyline = function(builder, polylineOffset) {
  builder.addFieldOffset(5, polylineOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} coordinatesOffset
 */
osrm.engine.api.fbresult.RouteObject.addCoordinates = function(builder, coordinatesOffset) {
  builder.addFieldOffset(6, coordinatesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.RouteObject.startCoordinatesVector = function(builder, numElems) {
  builder.startVector(8, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} legsOffset
 */
osrm.engine.api.fbresult.RouteObject.addLegs = function(builder, legsOffset) {
  builder.addFieldOffset(7, legsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<flatbuffers.Offset>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.RouteObject.createLegsVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.RouteObject.startLegsVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.RouteObject.endRouteObject = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} distance
 * @param {number} duration
 * @param {number} weight
 * @param {flatbuffers.Offset} weightNameOffset
 * @param {number} confidence
 * @param {flatbuffers.Offset} polylineOffset
 * @param {flatbuffers.Offset} coordinatesOffset
 * @param {flatbuffers.Offset} legsOffset
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.RouteObject.createRouteObject = function(builder, distance, duration, weight, weightNameOffset, confidence, polylineOffset, coordinatesOffset, legsOffset) {
  osrm.engine.api.fbresult.RouteObject.startRouteObject(builder);
  osrm.engine.api.fbresult.RouteObject.addDistance(builder, distance);
  osrm.engine.api.fbresult.RouteObject.addDuration(builder, duration);
  osrm.engine.api.fbresult.RouteObject.addWeight(builder, weight);
  osrm.engine.api.fbresult.RouteObject.addWeightName(builder, weightNameOffset);
  osrm.engine.api.fbresult.RouteObject.addConfidence(builder, confidence);
  osrm.engine.api.fbresult.RouteObject.addPolyline(builder, polylineOffset);
  osrm.engine.api.fbresult.RouteObject.addCoordinates(builder, coordinatesOffset);
  osrm.engine.api.fbresult.RouteObject.addLegs(builder, legsOffset);
  return osrm.engine.api.fbresult.RouteObject.endRouteObject(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.Table = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Table}
 */
osrm.engine.api.fbresult.Table.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Table=} obj
 * @returns {osrm.engine.api.fbresult.Table}
 */
osrm.engine.api.fbresult.Table.getRootAsTable = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Table).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Table=} obj
 * @returns {osrm.engine.api.fbresult.Table}
 */
osrm.engine.api.fbresult.Table.getSizePrefixedRootAsTable = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Table).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Table.prototype.durations = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Table.prototype.durationsLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Float32Array}
 */
osrm.engine.api.fbresult.Table.prototype.durationsArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Table.prototype.rows = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Table.prototype.cols = function() {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Table.prototype.distances = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.readFloat32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Table.prototype.distancesLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Float32Array}
 */
osrm.engine.api.fbresult.Table.prototype.distancesArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? new Float32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {number} index
 * @param {osrm.engine.api.fbresult.Waypoint=} obj
 * @returns {osrm.engine.api.fbresult.Waypoint}
 */
osrm.engine.api.fbresult.Table.prototype.destinations = function(index, obj) {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? (obj || new osrm.engine.api.fbresult.Waypoint).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Table.prototype.destinationsLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {number} index
 * @returns {number}
 */
osrm.engine.api.fbresult.Table.prototype.fallbackSpeedCells = function(index) {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.Table.prototype.fallbackSpeedCellsLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @returns {Uint32Array}
 */
osrm.engine.api.fbresult.Table.prototype.fallbackSpeedCellsArray = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.Table.startTable = function(builder) {
  builder.startObject(6);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} durationsOffset
 */
osrm.engine.api.fbresult.Table.addDurations = function(builder, durationsOffset) {
  builder.addFieldOffset(0, durationsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Table.createDurationsVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addFloat32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Table.startDurationsVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} rows
 */
osrm.engine.api.fbresult.Table.addRows = function(builder, rows) {
  builder.addFieldInt16(1, rows, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} cols
 */
osrm.engine.api.fbresult.Table.addCols = function(builder, cols) {
  builder.addFieldInt16(2, cols, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} distancesOffset
 */
osrm.engine.api.fbresult.Table.addDistances = function(builder, distancesOffset) {
  builder.addFieldOffset(3, distancesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Table.createDistancesVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addFloat32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Table.startDistancesVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} destinationsOffset
 */
osrm.engine.api.fbresult.Table.addDestinations = function(builder, destinationsOffset) {
  builder.addFieldOffset(4, destinationsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<flatbuffers.Offset>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Table.createDestinationsVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Table.startDestinationsVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} fallbackSpeedCellsOffset
 */
osrm.engine.api.fbresult.Table.addFallbackSpeedCells = function(builder, fallbackSpeedCellsOffset) {
  builder.addFieldOffset(5, fallbackSpeedCellsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<number>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Table.createFallbackSpeedCellsVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addInt32(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.Table.startFallbackSpeedCellsVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Table.endTable = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} durationsOffset
 * @param {number} rows
 * @param {number} cols
 * @param {flatbuffers.Offset} distancesOffset
 * @param {flatbuffers.Offset} destinationsOffset
 * @param {flatbuffers.Offset} fallbackSpeedCellsOffset
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Table.createTable = function(builder, durationsOffset, rows, cols, distancesOffset, destinationsOffset, fallbackSpeedCellsOffset) {
  osrm.engine.api.fbresult.Table.startTable(builder);
  osrm.engine.api.fbresult.Table.addDurations(builder, durationsOffset);
  osrm.engine.api.fbresult.Table.addRows(builder, rows);
  osrm.engine.api.fbresult.Table.addCols(builder, cols);
  osrm.engine.api.fbresult.Table.addDistances(builder, distancesOffset);
  osrm.engine.api.fbresult.Table.addDestinations(builder, destinationsOffset);
  osrm.engine.api.fbresult.Table.addFallbackSpeedCells(builder, fallbackSpeedCellsOffset);
  return osrm.engine.api.fbresult.Table.endTable(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.Error = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.Error}
 */
osrm.engine.api.fbresult.Error.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Error=} obj
 * @returns {osrm.engine.api.fbresult.Error}
 */
osrm.engine.api.fbresult.Error.getRootAsError = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Error).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.Error=} obj
 * @returns {osrm.engine.api.fbresult.Error}
 */
osrm.engine.api.fbresult.Error.getSizePrefixedRootAsError = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.Error).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Error.prototype.code = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.Error.prototype.message = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.Error.startError = function(builder) {
  builder.startObject(2);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} codeOffset
 */
osrm.engine.api.fbresult.Error.addCode = function(builder, codeOffset) {
  builder.addFieldOffset(0, codeOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} messageOffset
 */
osrm.engine.api.fbresult.Error.addMessage = function(builder, messageOffset) {
  builder.addFieldOffset(1, messageOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Error.endError = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} codeOffset
 * @param {flatbuffers.Offset} messageOffset
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.Error.createError = function(builder, codeOffset, messageOffset) {
  osrm.engine.api.fbresult.Error.startError(builder);
  osrm.engine.api.fbresult.Error.addCode(builder, codeOffset);
  osrm.engine.api.fbresult.Error.addMessage(builder, messageOffset);
  return osrm.engine.api.fbresult.Error.endError(builder);
}

/**
 * @constructor
 */
osrm.engine.api.fbresult.FBResult = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {osrm.engine.api.fbresult.FBResult}
 */
osrm.engine.api.fbresult.FBResult.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.FBResult=} obj
 * @returns {osrm.engine.api.fbresult.FBResult}
 */
osrm.engine.api.fbresult.FBResult.getRootAsFBResult = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.FBResult).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {osrm.engine.api.fbresult.FBResult=} obj
 * @returns {osrm.engine.api.fbresult.FBResult}
 */
osrm.engine.api.fbresult.FBResult.getSizePrefixedRootAsFBResult = function(bb, obj) {
  return (obj || new osrm.engine.api.fbresult.FBResult).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @returns {boolean}
 */
osrm.engine.api.fbresult.FBResult.prototype.error = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
};

/**
 * @param {osrm.engine.api.fbresult.Error=} obj
 * @returns {osrm.engine.api.fbresult.Error|null}
 */
osrm.engine.api.fbresult.FBResult.prototype.code = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? (obj || new osrm.engine.api.fbresult.Error).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {flatbuffers.Encoding=} optionalEncoding
 * @returns {string|Uint8Array|null}
 */
osrm.engine.api.fbresult.FBResult.prototype.dataVersion = function(optionalEncoding) {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
};

/**
 * @param {number} index
 * @param {osrm.engine.api.fbresult.Waypoint=} obj
 * @returns {osrm.engine.api.fbresult.Waypoint}
 */
osrm.engine.api.fbresult.FBResult.prototype.waypoints = function(index, obj) {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? (obj || new osrm.engine.api.fbresult.Waypoint).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.FBResult.prototype.waypointsLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {number} index
 * @param {osrm.engine.api.fbresult.RouteObject=} obj
 * @returns {osrm.engine.api.fbresult.RouteObject}
 */
osrm.engine.api.fbresult.FBResult.prototype.routes = function(index, obj) {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? (obj || new osrm.engine.api.fbresult.RouteObject).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
};

/**
 * @returns {number}
 */
osrm.engine.api.fbresult.FBResult.prototype.routesLength = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};

/**
 * @param {osrm.engine.api.fbresult.Table=} obj
 * @returns {osrm.engine.api.fbresult.Table|null}
 */
osrm.engine.api.fbresult.FBResult.prototype.table = function(obj) {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? (obj || new osrm.engine.api.fbresult.Table).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
};

/**
 * @param {flatbuffers.Builder} builder
 */
osrm.engine.api.fbresult.FBResult.startFBResult = function(builder) {
  builder.startObject(6);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {boolean} error
 */
osrm.engine.api.fbresult.FBResult.addError = function(builder, error) {
  builder.addFieldInt8(0, +error, +false);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} codeOffset
 */
osrm.engine.api.fbresult.FBResult.addCode = function(builder, codeOffset) {
  builder.addFieldOffset(1, codeOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} dataVersionOffset
 */
osrm.engine.api.fbresult.FBResult.addDataVersion = function(builder, dataVersionOffset) {
  builder.addFieldOffset(2, dataVersionOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} waypointsOffset
 */
osrm.engine.api.fbresult.FBResult.addWaypoints = function(builder, waypointsOffset) {
  builder.addFieldOffset(3, waypointsOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<flatbuffers.Offset>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.FBResult.createWaypointsVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.FBResult.startWaypointsVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} routesOffset
 */
osrm.engine.api.fbresult.FBResult.addRoutes = function(builder, routesOffset) {
  builder.addFieldOffset(4, routesOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {Array.<flatbuffers.Offset>} data
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.FBResult.createRoutesVector = function(builder, data) {
  builder.startVector(4, data.length, 4);
  for (var i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]);
  }
  return builder.endVector();
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} numElems
 */
osrm.engine.api.fbresult.FBResult.startRoutesVector = function(builder, numElems) {
  builder.startVector(4, numElems, 4);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} tableOffset
 */
osrm.engine.api.fbresult.FBResult.addTable = function(builder, tableOffset) {
  builder.addFieldOffset(5, tableOffset, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.FBResult.endFBResult = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} offset
 */
osrm.engine.api.fbresult.FBResult.finishFBResultBuffer = function(builder, offset) {
  builder.finish(offset);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} offset
 */
osrm.engine.api.fbresult.FBResult.finishSizePrefixedFBResultBuffer = function(builder, offset) {
  builder.finish(offset, undefined, true);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {boolean} error
 * @param {flatbuffers.Offset} codeOffset
 * @param {flatbuffers.Offset} dataVersionOffset
 * @param {flatbuffers.Offset} waypointsOffset
 * @param {flatbuffers.Offset} routesOffset
 * @param {flatbuffers.Offset} tableOffset
 * @returns {flatbuffers.Offset}
 */
osrm.engine.api.fbresult.FBResult.createFBResult = function(builder, error, codeOffset, dataVersionOffset, waypointsOffset, routesOffset, tableOffset) {
  osrm.engine.api.fbresult.FBResult.startFBResult(builder);
  osrm.engine.api.fbresult.FBResult.addError(builder, error);
  osrm.engine.api.fbresult.FBResult.addCode(builder, codeOffset);
  osrm.engine.api.fbresult.FBResult.addDataVersion(builder, dataVersionOffset);
  osrm.engine.api.fbresult.FBResult.addWaypoints(builder, waypointsOffset);
  osrm.engine.api.fbresult.FBResult.addRoutes(builder, routesOffset);
  osrm.engine.api.fbresult.FBResult.addTable(builder, tableOffset);
  return osrm.engine.api.fbresult.FBResult.endFBResult(builder);
}

// Exports for Node.js and RequireJS
this.osrm = osrm;
