Skip to content

Commit

Permalink
update lrs_generated
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristramg committed Feb 27, 2024
1 parent e04ad50 commit 2c90d08
Showing 1 changed file with 62 additions and 34 deletions.
96 changes: 62 additions & 34 deletions src/lrs_generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,34 +933,34 @@ impl<'a> Lrs<'a> {
/// Networks are segments connected by nodes.
/// There can be multiple networks, such as railway tracks and lines, sewer pipe and power lines.
#[inline]
pub fn networks(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Network<'a>>> {
pub fn networks(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Network<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Network>>>>(Lrs::VT_NETWORKS, None).unwrap()}
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Network>>>>(Lrs::VT_NETWORKS, None)}
}
#[inline]
pub fn anchors(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Anchor<'a>>> {
pub fn anchors(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Anchor<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Anchor>>>>(Lrs::VT_ANCHORS, None).unwrap()}
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Anchor>>>>(Lrs::VT_ANCHORS, None)}
}
#[inline]
pub fn linear_referencing_methods(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<LinearReferencingMethod<'a>>> {
pub fn linear_referencing_methods(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<LinearReferencingMethod<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<LinearReferencingMethod>>>>(Lrs::VT_LINEAR_REFERENCING_METHODS, None).unwrap()}
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<LinearReferencingMethod>>>>(Lrs::VT_LINEAR_REFERENCING_METHODS, None)}
}
/// There can be multiple geometries
/// For instance a geographic and and schematic representation of the same network
#[inline]
pub fn views(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<GeometryView<'a>>> {
pub fn views(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<GeometryView<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<GeometryView>>>>(Lrs::VT_VIEWS, None).unwrap()}
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<GeometryView>>>>(Lrs::VT_VIEWS, None)}
}
}

Expand All @@ -972,10 +972,10 @@ impl flatbuffers::Verifiable for Lrs<'_> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Property>>>>("properties", Self::VT_PROPERTIES, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Network>>>>("networks", Self::VT_NETWORKS, true)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Anchor>>>>("anchors", Self::VT_ANCHORS, true)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<LinearReferencingMethod>>>>("linear_referencing_methods", Self::VT_LINEAR_REFERENCING_METHODS, true)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<GeometryView>>>>("views", Self::VT_VIEWS, true)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Network>>>>("networks", Self::VT_NETWORKS, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Anchor>>>>("anchors", Self::VT_ANCHORS, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<LinearReferencingMethod>>>>("linear_referencing_methods", Self::VT_LINEAR_REFERENCING_METHODS, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<GeometryView>>>>("views", Self::VT_VIEWS, false)?
.finish();
Ok(())
}
Expand All @@ -992,10 +992,10 @@ impl<'a> Default for LrsArgs<'a> {
fn default() -> Self {
LrsArgs {
properties: None,
networks: None, // required field
anchors: None, // required field
linear_referencing_methods: None, // required field
views: None, // required field
networks: None,
anchors: None,
linear_referencing_methods: None,
views: None,
}
}
}
Expand Down Expand Up @@ -1036,10 +1036,6 @@ impl<'a: 'b, 'b> LrsBuilder<'a, 'b> {
#[inline]
pub fn finish(self) -> flatbuffers::WIPOffset<Lrs<'a>> {
let o = self.fbb_.end_table(self.start_);
self.fbb_.required(o, Lrs::VT_NETWORKS,"networks");
self.fbb_.required(o, Lrs::VT_ANCHORS,"anchors");
self.fbb_.required(o, Lrs::VT_LINEAR_REFERENCING_METHODS,"linear_referencing_methods");
self.fbb_.required(o, Lrs::VT_VIEWS,"views");
flatbuffers::WIPOffset::new(o.value())
}
}
Expand Down Expand Up @@ -1614,8 +1610,9 @@ impl<'a> flatbuffers::Follow<'a> for Traversal<'a> {

impl<'a> Traversal<'a> {
pub const VT_ID: flatbuffers::VOffsetT = 4;
pub const VT_SEGMENTS: flatbuffers::VOffsetT = 6;
pub const VT_DIRECTIONS: flatbuffers::VOffsetT = 8;
pub const VT_PROPERTIES: flatbuffers::VOffsetT = 6;
pub const VT_SEGMENTS: flatbuffers::VOffsetT = 8;
pub const VT_DIRECTIONS: flatbuffers::VOffsetT = 10;

#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
Expand All @@ -1629,6 +1626,7 @@ impl<'a> Traversal<'a> {
let mut builder = TraversalBuilder::new(_fbb);
if let Some(x) = args.directions { builder.add_directions(x); }
if let Some(x) = args.segments { builder.add_segments(x); }
if let Some(x) = args.properties { builder.add_properties(x); }
if let Some(x) = args.id { builder.add_id(x); }
builder.finish()
}
Expand All @@ -1642,6 +1640,13 @@ impl<'a> Traversal<'a> {
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Traversal::VT_ID, None).unwrap()}
}
#[inline]
pub fn properties(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Property<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Property>>>>(Traversal::VT_PROPERTIES, None)}
}
#[inline]
pub fn segments(&self) -> flatbuffers::Vector<'a, u64> {
// Safety:
// Created from valid Table for this object
Expand All @@ -1665,6 +1670,7 @@ impl flatbuffers::Verifiable for Traversal<'_> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, true)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Property>>>>("properties", Self::VT_PROPERTIES, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u64>>>("segments", Self::VT_SEGMENTS, true)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, Direction>>>("directions", Self::VT_DIRECTIONS, true)?
.finish();
Expand All @@ -1673,6 +1679,7 @@ impl flatbuffers::Verifiable for Traversal<'_> {
}
pub struct TraversalArgs<'a> {
pub id: Option<flatbuffers::WIPOffset<&'a str>>,
pub properties: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Property<'a>>>>>,
pub segments: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u64>>>,
pub directions: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, Direction>>>,
}
Expand All @@ -1681,6 +1688,7 @@ impl<'a> Default for TraversalArgs<'a> {
fn default() -> Self {
TraversalArgs {
id: None, // required field
properties: None,
segments: None, // required field
directions: None, // required field
}
Expand All @@ -1697,6 +1705,10 @@ impl<'a: 'b, 'b> TraversalBuilder<'a, 'b> {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Traversal::VT_ID, id);
}
#[inline]
pub fn add_properties(&mut self, properties: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Property<'b >>>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Traversal::VT_PROPERTIES, properties);
}
#[inline]
pub fn add_segments(&mut self, segments: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u64>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Traversal::VT_SEGMENTS, segments);
}
Expand Down Expand Up @@ -1726,6 +1738,7 @@ impl core::fmt::Debug for Traversal<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let mut ds = f.debug_struct("Traversal");
ds.field("id", &self.id());
ds.field("properties", &self.properties());
ds.field("segments", &self.segments());
ds.field("directions", &self.directions());
ds.finish()
Expand All @@ -1752,8 +1765,9 @@ impl<'a> flatbuffers::Follow<'a> for Anchor<'a> {

impl<'a> Anchor<'a> {
pub const VT_ID: flatbuffers::VOffsetT = 4;
pub const VT_NAME: flatbuffers::VOffsetT = 6;
pub const VT_NODE: flatbuffers::VOffsetT = 8;
pub const VT_PROPERTIES: flatbuffers::VOffsetT = 6;
pub const VT_NAME: flatbuffers::VOffsetT = 8;
pub const VT_NODE: flatbuffers::VOffsetT = 10;

#[inline]
pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
Expand All @@ -1767,6 +1781,7 @@ impl<'a> Anchor<'a> {
let mut builder = AnchorBuilder::new(_fbb);
if let Some(x) = args.node { builder.add_node(x); }
if let Some(x) = args.name { builder.add_name(x); }
if let Some(x) = args.properties { builder.add_properties(x); }
if let Some(x) = args.id { builder.add_id(x); }
builder.finish()
}
Expand All @@ -1779,6 +1794,13 @@ impl<'a> Anchor<'a> {
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Anchor::VT_ID, None).unwrap()}
}
#[inline]
pub fn properties(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Property<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Property>>>>(Anchor::VT_PROPERTIES, None)}
}
/// Most anchors have a name, which is used to reference the location.
/// More often than not a kilometer or mile number, but it can also be a letter or word.
#[inline]
Expand Down Expand Up @@ -1807,6 +1829,7 @@ impl flatbuffers::Verifiable for Anchor<'_> {
use self::flatbuffers::Verifiable;
v.visit_table(pos)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, true)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Property>>>>("properties", Self::VT_PROPERTIES, false)?
.visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
.visit_field::<NodeRef>("node", Self::VT_NODE, false)?
.finish();
Expand All @@ -1815,6 +1838,7 @@ impl flatbuffers::Verifiable for Anchor<'_> {
}
pub struct AnchorArgs<'a> {
pub id: Option<flatbuffers::WIPOffset<&'a str>>,
pub properties: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Property<'a>>>>>,
pub name: Option<flatbuffers::WIPOffset<&'a str>>,
pub node: Option<&'a NodeRef>,
}
Expand All @@ -1823,6 +1847,7 @@ impl<'a> Default for AnchorArgs<'a> {
fn default() -> Self {
AnchorArgs {
id: None, // required field
properties: None,
name: None,
node: None,
}
Expand All @@ -1839,6 +1864,10 @@ impl<'a: 'b, 'b> AnchorBuilder<'a, 'b> {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Anchor::VT_ID, id);
}
#[inline]
pub fn add_properties(&mut self, properties: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Property<'b >>>>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Anchor::VT_PROPERTIES, properties);
}
#[inline]
pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Anchor::VT_NAME, name);
}
Expand Down Expand Up @@ -1866,6 +1895,7 @@ impl core::fmt::Debug for Anchor<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let mut ds = f.debug_struct("Anchor");
ds.field("id", &self.id());
ds.field("properties", &self.properties());
ds.field("name", &self.name());
ds.field("node", &self.node());
ds.finish()
Expand Down Expand Up @@ -2154,19 +2184,19 @@ impl<'a> GeometryView<'a> {
unsafe { self._tab.get::<GeometryType>(GeometryView::VT_GEOMETRY_TYPE, None)}
}
#[inline]
pub fn anchors(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<AnchorGeometry<'a>>> {
pub fn anchors(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<AnchorGeometry<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<AnchorGeometry>>>>(GeometryView::VT_ANCHORS, None).unwrap()}
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<AnchorGeometry>>>>(GeometryView::VT_ANCHORS, None)}
}
/// Must be the same size as the top level network array
#[inline]
pub fn networks(&self) -> flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<NetworkGeometry<'a>>> {
pub fn networks(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<NetworkGeometry<'a>>>> {
// Safety:
// Created from valid Table for this object
// which contains a valid value in this slot
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<NetworkGeometry>>>>(GeometryView::VT_NETWORKS, None).unwrap()}
unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<NetworkGeometry>>>>(GeometryView::VT_NETWORKS, None)}
}
}

Expand All @@ -2179,8 +2209,8 @@ impl flatbuffers::Verifiable for GeometryView<'_> {
v.visit_table(pos)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Property>>>>("properties", Self::VT_PROPERTIES, false)?
.visit_field::<GeometryType>("geometry_type", Self::VT_GEOMETRY_TYPE, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<AnchorGeometry>>>>("anchors", Self::VT_ANCHORS, true)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<NetworkGeometry>>>>("networks", Self::VT_NETWORKS, true)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<AnchorGeometry>>>>("anchors", Self::VT_ANCHORS, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<NetworkGeometry>>>>("networks", Self::VT_NETWORKS, false)?
.finish();
Ok(())
}
Expand All @@ -2197,8 +2227,8 @@ impl<'a> Default for GeometryViewArgs<'a> {
GeometryViewArgs {
properties: None,
geometry_type: None,
anchors: None, // required field
networks: None, // required field
anchors: None,
networks: None,
}
}
}
Expand Down Expand Up @@ -2235,8 +2265,6 @@ impl<'a: 'b, 'b> GeometryViewBuilder<'a, 'b> {
#[inline]
pub fn finish(self) -> flatbuffers::WIPOffset<GeometryView<'a>> {
let o = self.fbb_.end_table(self.start_);
self.fbb_.required(o, GeometryView::VT_ANCHORS,"anchors");
self.fbb_.required(o, GeometryView::VT_NETWORKS,"networks");
flatbuffers::WIPOffset::new(o.value())
}
}
Expand Down

0 comments on commit 2c90d08

Please sign in to comment.