#[allow(unused_imports)]
use super::{common as com, common_extension as comx, location_referencing as loc, location_extension as locx, situation as sit, road_traffic_data as roa, vms, parking as prk, energy_infrastructure as egi, afir_energy_infrastructure as aegi, facilities as fac, afir_facilities as afac, traffic_regulation as tro, controlled_zone as cz, rerouting_management_enhanced as rer, urban_extensions as ubx, fault_and_status as fst};
#[allow(unused_imports)]
use crate::out::{Out, Pattern};
#[allow(unused_imports)]
use crate::xml::{Enumeration, Xml};
#[allow(unused_imports)]
use crate::{Date, DateTime, Decimal, Error, Extension, MultilingualString, Time};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ConditionOperator {
And,
Or,
Xor,
Extended(String),
}
impl ConditionOperator {
pub fn as_str(&self) -> &str {
match self {
Self::And => "and",
Self::Or => "or",
Self::Xor => "xor",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ConditionOperator {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"and" => Some(Self::And),
"or" => Some(Self::Or),
"xor" => Some(Self::Xor),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ConditionOperator {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type Duration = String;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ResponseEffectTypeEnum {
CapacityIncrease,
InflowReduction,
OutflowIncrease,
Prewarning,
Rerouting,
Extended(String),
}
impl ResponseEffectTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::CapacityIncrease => "capacityIncrease",
Self::InflowReduction => "inflowReduction",
Self::OutflowIncrease => "outflowIncrease",
Self::Prewarning => "prewarning",
Self::Rerouting => "rerouting",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ResponseEffectTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"capacityIncrease" => Some(Self::CapacityIncrease),
"inflowReduction" => Some(Self::InflowReduction),
"outflowIncrease" => Some(Self::OutflowIncrease),
"prewarning" => Some(Self::Prewarning),
"rerouting" => Some(Self::Rerouting),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ResponseEffectTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ResponseStageEnum {
Prewarning,
Basic,
TrafficCondition,
Extended(String),
}
impl ResponseStageEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Prewarning => "prewarning",
Self::Basic => "basic",
Self::TrafficCondition => "trafficCondition",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ResponseStageEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"prewarning" => Some(Self::Prewarning),
"basic" => Some(Self::Basic),
"trafficCondition" => Some(Self::TrafficCondition),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ResponseStageEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TmplanOperationStatusEnum {
Scheduled,
SchedulingAborted,
SchedulingRejected,
SchedulingRequested,
Extended(String),
}
impl TmplanOperationStatusEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Scheduled => "scheduled",
Self::SchedulingAborted => "schedulingAborted",
Self::SchedulingRejected => "schedulingRejected",
Self::SchedulingRequested => "schedulingRequested",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TmplanOperationStatusEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"scheduled" => Some(Self::Scheduled),
"schedulingAborted" => Some(Self::SchedulingAborted),
"schedulingRejected" => Some(Self::SchedulingRejected),
"schedulingRequested" => Some(Self::SchedulingRequested),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TmplanOperationStatusEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ActionByReference {
pub version_time: Option<DateTime>,
pub action_extension: Option<Box<Extension>>,
pub action_reference: Option<Box<com::VersionedReference>>,
pub action_by_reference_extension: Option<Box<Extension>>,
}
impl ActionByReference {
const FIELDS: &'static [u32] = &[0x100c4e, 0x1003fb, 0x100679, 0x1003f9];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10000c);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100c4e => { let v = r.date_time()?; r.set(&mut e0, v, 3150); }
0x1003fb => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1019); }
0x100679 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 1657); }
0x1003f9 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1017); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3150);
r.required(&e2, 1657);
let v = Self {
version_time: e0,
action_extension: e1,
action_reference: e2,
action_by_reference_extension: e3,
};
r.close();
Ok(v)
}
}
impl ActionByReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.action_extension { w.extension("tmp:_actionExtension", v)?; }
match &self.action_reference {
Some(v) => { v.write(w, "tmp:actionReference", "", " targetClass=\"tmp:ActionDefinition\"")?; }
None => return Err(w.missing("tmp:actionReference")),
}
if let Some(v) = &self.action_by_reference_extension { w.extension("tmp:_actionByReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ActionDefinition {
pub id: Option<String>,
pub version: Option<String>,
pub version_time: Option<DateTime>,
pub action_extension: Option<Box<Extension>>,
pub external_identification: Option<String>,
pub description: Option<MultilingualString>,
pub action_implementer: Option<Box<com::InternationalIdentifier>>,
pub operator_action_definition: Option<OperatorActionDefinition>,
pub activation_delay: Option<Box<ActivationDelay>>,
pub action_definition_extension: Option<Box<Extension>>,
}
impl ActionDefinition {
const FIELDS: &'static [u32] = &[0x100c4e, 0x1003fb, 0x100804, 0x100777, 0x100675, 0x1009d3, 0x10067c, 0x1003fa];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10000d);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100c4e => { let v = r.date_time()?; r.set(&mut e0, v, 3150); }
0x1003fb => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1019); }
0x100804 => { let v = r.string()?; r.set(&mut e2, v, 2052); }
0x100777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x100675 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e4, v.map(Box::new), 1653); }
0x1009d3 => { let v = OperatorActionDefinition::read(r)?; r.set(&mut e5, v, 2515); }
0x10067c => { let v = Some(ActivationDelay::read(r)?); r.set(&mut e6, v.map(Box::new), 1660); }
0x1003fa => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1018); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3150);
r.required(&e3, 1911);
let v = Self {
id: a0,
version: a1,
version_time: e0,
action_extension: e1,
external_identification: e2,
description: e3,
action_implementer: e4,
operator_action_definition: e5,
activation_delay: e6,
action_definition_extension: e7,
};
r.close();
Ok(v)
}
}
impl ActionDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.action_extension { w.extension("tmp:_actionExtension", v)?; }
if let Some(v) = &self.external_identification { w.max_len("externalIdentification", v, 1024)?; w.leaf("tmp:externalIdentification", v)?; }
match &self.description {
Some(v) => { w.multilingual("tmp:description", v)?; }
None => return Err(w.missing("tmp:description")),
}
if let Some(v) = &self.action_implementer { v.write(w, "tmp:actionImplementer", "", "")?; }
if let Some(v) = &self.operator_action_definition { v.write(w, "tmp:operatorActionDefinition")?; }
if let Some(v) = &self.activation_delay { v.write(w, "tmp:activationDelay", "", "")?; }
if let Some(v) = &self.action_definition_extension { w.extension("tmp:_actionDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ActivationConditions {
pub automatically_approved: Option<com::Boolean>,
pub automatically_implemented: Option<com::Boolean>,
pub automatically_deactivated: Option<com::Boolean>,
pub activation_delay: Option<Box<ActivationDelay>>,
pub activation_trigger: Option<Condition>,
pub deactivation_trigger: Option<Condition>,
pub activation_conditions_extension: Option<Box<Extension>>,
}
impl ActivationConditions {
const FIELDS: &'static [u32] = &[0x1006d8, 0x1006da, 0x1006d9, 0x10067c, 0x100680, 0x100761, 0x1003fd];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10000f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1006d8 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 1752); }
0x1006da => { let v = r.value::<bool>()?; r.set(&mut e1, v, 1754); }
0x1006d9 => { let v = r.value::<bool>()?; r.set(&mut e2, v, 1753); }
0x10067c => { let v = Some(ActivationDelay::read(r)?); r.set(&mut e3, v.map(Box::new), 1660); }
0x100680 => { let v = Condition::read(r)?; r.set(&mut e4, v, 1664); }
0x100761 => { let v = Condition::read(r)?; r.set(&mut e5, v, 1889); }
0x1003fd => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1021); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
automatically_approved: e0,
automatically_implemented: e1,
automatically_deactivated: e2,
activation_delay: e3,
activation_trigger: e4,
deactivation_trigger: e5,
activation_conditions_extension: e6,
};
r.close();
Ok(v)
}
}
impl ActivationConditions {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.automatically_approved { w.leaf("tmp:automaticallyApproved", v)?; }
if let Some(v) = &self.automatically_implemented { w.leaf("tmp:automaticallyImplemented", v)?; }
if let Some(v) = &self.automatically_deactivated { w.leaf("tmp:automaticallyDeactivated", v)?; }
if let Some(v) = &self.activation_delay { v.write(w, "tmp:activationDelay", "", "")?; }
if let Some(v) = &self.activation_trigger { v.write(w, "tmp:activationTrigger")?; }
if let Some(v) = &self.deactivation_trigger { v.write(w, "tmp:deactivationTrigger")?; }
if let Some(v) = &self.activation_conditions_extension { w.extension("tmp:_activationConditionsExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ActivationDelay {
pub activation_delay: Option<com::Seconds>,
pub deactivation_delay: Option<com::Seconds>,
pub activation_delay_extension: Option<Box<Extension>>,
}
impl ActivationDelay {
const FIELDS: &'static [u32] = &[0x10067c, 0x100760, 0x1003fe];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100010);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10067c => { let v = r.value::<f32>()?; r.set(&mut e0, v, 1660); }
0x100760 => { let v = r.value::<f32>()?; r.set(&mut e1, v, 1888); }
0x1003fe => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1022); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1660);
r.required(&e1, 1888);
let v = Self {
activation_delay: e0,
deactivation_delay: e1,
activation_delay_extension: e2,
};
r.close();
Ok(v)
}
}
impl ActivationDelay {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.activation_delay {
Some(v) => { w.leaf("tmp:activationDelay", v)?; }
None => return Err(w.missing("tmp:activationDelay")),
}
match &self.deactivation_delay {
Some(v) => { w.leaf("tmp:deactivationDelay", v)?; }
None => return Err(w.missing("tmp:deactivationDelay")),
}
if let Some(v) = &self.activation_delay_extension { w.extension("tmp:_activationDelayExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct CompositeMeasure {
pub id: Option<String>,
pub version: Option<String>,
pub version_time: Option<DateTime>,
pub measure_extension: Option<Box<Extension>>,
pub measure: Vec<Measure>,
pub composite_measure_extension: Option<Box<Extension>>,
}
impl CompositeMeasure {
const FIELDS: &'static [u32] = &[0x100c4e, 0x1004ed, 0x100913, 0x10043f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100053);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100c4e => { let v = r.date_time()?; r.set(&mut e0, v, 3150); }
0x1004ed => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1261); }
0x100913 => { let v = Measure::read(r)?; e2.extend(v); }
0x10043f => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1087); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3150);
let v = Self {
id: a0,
version: a1,
version_time: e0,
measure_extension: e1,
measure: e2,
composite_measure_extension: e3,
};
r.close();
Ok(v)
}
}
impl CompositeMeasure {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.measure_extension { w.extension("tmp:_measureExtension", v)?; }
w.count("tmp:measure", self.measure.len(), 2, usize::MAX)?;
for v in &self.measure { v.write(w, "tmp:measure")?; }
if let Some(v) = &self.composite_measure_extension { w.extension("tmp:_compositeMeasureExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ConditionSet {
pub negate: Option<com::Boolean>,
pub condition_extension: Option<Box<Extension>>,
pub operator: Option<ConditionOperator>,
pub condition: Vec<Condition>,
pub condition_set_extension: Option<Box<Extension>>,
}
impl ConditionSet {
const FIELDS: &'static [u32] = &[0x100955, 0x100442, 0x1009d2, 0x100731, 0x100444];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100058);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x100442 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1090); }
0x1009d2 => { let v = r.enumeration::<ConditionOperator>()?; r.set(&mut e2, v, 2514); }
0x100731 => { let v = Condition::read(r)?; e3.extend(v); }
0x100444 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1092); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2514);
let v = Self {
negate: e0,
condition_extension: e1,
operator: e2,
condition: e3,
condition_set_extension: e4,
};
r.close();
Ok(v)
}
}
impl ConditionSet {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tmp:negate", v)?; }
if let Some(v) = &self.condition_extension { w.extension("tmp:_conditionExtension", v)?; }
match &self.operator {
Some(v) => { w.enumeration("tmp:operator", v.literal())?; }
None => return Err(w.missing("tmp:operator")),
}
w.count("tmp:condition", self.condition.len(), 1, usize::MAX)?;
for v in &self.condition { v.write(w, "tmp:condition")?; }
if let Some(v) = &self.condition_set_extension { w.extension("tmp:_conditionSetExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GeneralInstructionOrMessageToRoadUsersDefinition {
pub target_location: Vec<loc::LocationReference>,
pub operator_action_definition_extension: Option<Box<Extension>>,
pub compliance_option: Option<sit::ComplianceOptionEnum>,
pub applicable_for_traffic_direction: Vec<loc::DirectionEnum>,
pub applicable_for_traffic_type: Vec<sit::TrafficTypeEnum>,
pub places_at_which_applicable: Vec<sit::PlacesEnum>,
pub automatically_initiated: Option<com::Boolean>,
pub for_vehicles_with_characteristics_of: Vec<com::VehicleCharacteristics>,
pub network_management_definition_extension: Option<Box<Extension>>,
pub general_instruction_to_road_users_type: Option<sit::GeneralInstructionToRoadUsersTypeEnum>,
pub general_message_to_road_users: Option<MultilingualString>,
pub general_instruction_or_message_to_road_users_definition_extension: Option<Box<Extension>>,
}
impl GeneralInstructionOrMessageToRoadUsersDefinition {
const FIELDS: &'static [u32] = &[0x100b9e, 0x100532, 0x10072b, 0x1006c3, 0x1006c4, 0x100a41, 0x1006db, 0x100827, 0x1004fc, 0x10083b, 0x10083c, 0x1004a6];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1000bd);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b9e => { let v = loc::LocationReference::read(r)?; e0.extend(v); }
0x100532 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1330); }
0x10072b => { let v = r.enumeration::<sit::ComplianceOptionEnum>()?; r.set(&mut e2, v, 1835); }
0x1006c3 => { let v = r.enumeration::<loc::DirectionEnum>()?; e3.extend(v); }
0x1006c4 => { let v = r.enumeration::<sit::TrafficTypeEnum>()?; e4.extend(v); }
0x100a41 => { let v = r.enumeration::<sit::PlacesEnum>()?; e5.extend(v); }
0x1006db => { let v = r.value::<bool>()?; r.set(&mut e6, v, 1755); }
0x100827 => { let v = Some(com::VehicleCharacteristics::read(r)?); e7.extend(v); }
0x1004fc => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1276); }
0x10083b => { let v = r.enumeration::<sit::GeneralInstructionToRoadUsersTypeEnum>()?; r.set(&mut e9, v, 2107); }
0x10083c => { let v = r.multilingual()?; r.set(&mut e10, v, 2108); }
0x1004a6 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1190); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 1835);
let v = Self {
target_location: e0,
operator_action_definition_extension: e1,
compliance_option: e2,
applicable_for_traffic_direction: e3,
applicable_for_traffic_type: e4,
places_at_which_applicable: e5,
automatically_initiated: e6,
for_vehicles_with_characteristics_of: e7,
network_management_definition_extension: e8,
general_instruction_to_road_users_type: e9,
general_message_to_road_users: e10,
general_instruction_or_message_to_road_users_definition_extension: e11,
};
r.close();
Ok(v)
}
}
impl GeneralInstructionOrMessageToRoadUsersDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
for v in &self.target_location { v.write(w, "tmp:targetLocation")?; }
if let Some(v) = &self.operator_action_definition_extension { w.extension("tmp:_operatorActionDefinitionExtension", v)?; }
match &self.compliance_option {
Some(v) => { w.enumeration("tmp:complianceOption", v.literal())?; }
None => return Err(w.missing("tmp:complianceOption")),
}
for v in &self.applicable_for_traffic_direction { w.enumeration("tmp:applicableForTrafficDirection", v.literal())?; }
for v in &self.applicable_for_traffic_type { w.enumeration("tmp:applicableForTrafficType", v.literal())?; }
for v in &self.places_at_which_applicable { w.enumeration("tmp:placesAtWhichApplicable", v.literal())?; }
if let Some(v) = &self.automatically_initiated { w.leaf("tmp:automaticallyInitiated", v)?; }
for v in &self.for_vehicles_with_characteristics_of { v.write(w, "tmp:forVehiclesWithCharacteristicsOf", "", "")?; }
if let Some(v) = &self.network_management_definition_extension { w.extension("tmp:_networkManagementDefinitionExtension", v)?; }
if let Some(v) = &self.general_instruction_to_road_users_type { w.enumeration("tmp:generalInstructionToRoadUsersType", v.literal())?; }
if let Some(v) = &self.general_message_to_road_users { w.multilingual("tmp:generalMessageToRoadUsers", v)?; }
if let Some(v) = &self.general_instruction_or_message_to_road_users_definition_extension { w.extension("tmp:_generalInstructionOrMessageToRoadUsersDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GeneralNetworkManagementDefinition {
pub target_location: Vec<loc::LocationReference>,
pub operator_action_definition_extension: Option<Box<Extension>>,
pub compliance_option: Option<sit::ComplianceOptionEnum>,
pub applicable_for_traffic_direction: Vec<loc::DirectionEnum>,
pub applicable_for_traffic_type: Vec<sit::TrafficTypeEnum>,
pub places_at_which_applicable: Vec<sit::PlacesEnum>,
pub automatically_initiated: Option<com::Boolean>,
pub for_vehicles_with_characteristics_of: Vec<com::VehicleCharacteristics>,
pub network_management_definition_extension: Option<Box<Extension>>,
pub general_network_management_type: Option<sit::GeneralNetworkManagementTypeEnum>,
pub traffic_manually_directed_by: Option<sit::PersonCategoryEnum>,
pub general_network_management_definition_extension: Option<Box<Extension>>,
}
impl GeneralNetworkManagementDefinition {
const FIELDS: &'static [u32] = &[0x100b9e, 0x100532, 0x10072b, 0x1006c3, 0x1006c4, 0x100a41, 0x1006db, 0x100827, 0x1004fc, 0x10083d, 0x100bdf, 0x1004a8];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1000bf);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b9e => { let v = loc::LocationReference::read(r)?; e0.extend(v); }
0x100532 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1330); }
0x10072b => { let v = r.enumeration::<sit::ComplianceOptionEnum>()?; r.set(&mut e2, v, 1835); }
0x1006c3 => { let v = r.enumeration::<loc::DirectionEnum>()?; e3.extend(v); }
0x1006c4 => { let v = r.enumeration::<sit::TrafficTypeEnum>()?; e4.extend(v); }
0x100a41 => { let v = r.enumeration::<sit::PlacesEnum>()?; e5.extend(v); }
0x1006db => { let v = r.value::<bool>()?; r.set(&mut e6, v, 1755); }
0x100827 => { let v = Some(com::VehicleCharacteristics::read(r)?); e7.extend(v); }
0x1004fc => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1276); }
0x10083d => { let v = r.enumeration::<sit::GeneralNetworkManagementTypeEnum>()?; r.set(&mut e9, v, 2109); }
0x100bdf => { let v = r.enumeration::<sit::PersonCategoryEnum>()?; r.set(&mut e10, v, 3039); }
0x1004a8 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1192); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 1835);
r.required(&e9, 2109);
let v = Self {
target_location: e0,
operator_action_definition_extension: e1,
compliance_option: e2,
applicable_for_traffic_direction: e3,
applicable_for_traffic_type: e4,
places_at_which_applicable: e5,
automatically_initiated: e6,
for_vehicles_with_characteristics_of: e7,
network_management_definition_extension: e8,
general_network_management_type: e9,
traffic_manually_directed_by: e10,
general_network_management_definition_extension: e11,
};
r.close();
Ok(v)
}
}
impl GeneralNetworkManagementDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
for v in &self.target_location { v.write(w, "tmp:targetLocation")?; }
if let Some(v) = &self.operator_action_definition_extension { w.extension("tmp:_operatorActionDefinitionExtension", v)?; }
match &self.compliance_option {
Some(v) => { w.enumeration("tmp:complianceOption", v.literal())?; }
None => return Err(w.missing("tmp:complianceOption")),
}
for v in &self.applicable_for_traffic_direction { w.enumeration("tmp:applicableForTrafficDirection", v.literal())?; }
for v in &self.applicable_for_traffic_type { w.enumeration("tmp:applicableForTrafficType", v.literal())?; }
for v in &self.places_at_which_applicable { w.enumeration("tmp:placesAtWhichApplicable", v.literal())?; }
if let Some(v) = &self.automatically_initiated { w.leaf("tmp:automaticallyInitiated", v)?; }
for v in &self.for_vehicles_with_characteristics_of { v.write(w, "tmp:forVehiclesWithCharacteristicsOf", "", "")?; }
if let Some(v) = &self.network_management_definition_extension { w.extension("tmp:_networkManagementDefinitionExtension", v)?; }
match &self.general_network_management_type {
Some(v) => { w.enumeration("tmp:generalNetworkManagementType", v.literal())?; }
None => return Err(w.missing("tmp:generalNetworkManagementType")),
}
if let Some(v) = &self.traffic_manually_directed_by { w.enumeration("tmp:trafficManuallyDirectedBy", v.literal())?; }
if let Some(v) = &self.general_network_management_definition_extension { w.extension("tmp:_generalNetworkManagementDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ImpactKind {
pub capacity_reduced: Option<com::Boolean>,
pub impact_detail: Option<Box<sit::Impact>>,
pub impact_kind_extension: Option<Box<Extension>>,
}
impl ImpactKind {
const FIELDS: &'static [u32] = &[0x100705, 0x10087a, 0x1004c7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1000de);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100705 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 1797); }
0x10087a => { let v = Some(sit::Impact::read(r)?); r.set(&mut e1, v.map(Box::new), 2170); }
0x1004c7 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1223); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
capacity_reduced: e0,
impact_detail: e1,
impact_kind_extension: e2,
};
r.close();
Ok(v)
}
}
impl ImpactKind {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.capacity_reduced { w.leaf("tmp:capacityReduced", v)?; }
if let Some(v) = &self.impact_detail { v.write(w, "tmp:impactDetail", "", "")?; }
if let Some(v) = &self.impact_kind_extension { w.extension("tmp:_impactKindExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MeasureByReference {
pub version_time: Option<DateTime>,
pub measure_extension: Option<Box<Extension>>,
pub measure_reference: Option<Box<com::VersionedReference>>,
pub measure_by_reference_extension: Option<Box<Extension>>,
}
impl MeasureByReference {
const FIELDS: &'static [u32] = &[0x100c4e, 0x1004ed, 0x100914, 0x1004eb];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100103);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100c4e => { let v = r.date_time()?; r.set(&mut e0, v, 3150); }
0x1004ed => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1261); }
0x100914 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 2324); }
0x1004eb => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1259); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3150);
r.required(&e2, 2324);
let v = Self {
version_time: e0,
measure_extension: e1,
measure_reference: e2,
measure_by_reference_extension: e3,
};
r.close();
Ok(v)
}
}
impl MeasureByReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.measure_extension { w.extension("tmp:_measureExtension", v)?; }
match &self.measure_reference {
Some(v) => { v.write(w, "tmp:measureReference", "", " targetClass=\"tmp:MeasureDefinition\"")?; }
None => return Err(w.missing("tmp:measureReference")),
}
if let Some(v) = &self.measure_by_reference_extension { w.extension("tmp:_measureByReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct MeasureDefinition {
pub id: Option<String>,
pub version: Option<String>,
pub version_time: Option<DateTime>,
pub measure_extension: Option<Box<Extension>>,
pub external_identification: Option<String>,
pub description: Option<MultilingualString>,
pub responsible_road_operator: Option<Box<com::Reference>>,
pub short_name: Option<String>,
pub action: Vec<Action>,
pub response_type: Option<Box<ResponseType>>,
pub activation_conditions: Option<Box<ActivationConditions>>,
pub measure_definition_extension: Option<Box<Extension>>,
}
impl MeasureDefinition {
const FIELDS: &'static [u32] = &[0x100c4e, 0x1004ed, 0x100804, 0x100777, 0x100aef, 0x100b38, 0x100674, 0x100aec, 0x10067b, 0x1004ec];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100104);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100c4e => { let v = r.date_time()?; r.set(&mut e0, v, 3150); }
0x1004ed => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1261); }
0x100804 => { let v = r.string()?; r.set(&mut e2, v, 2052); }
0x100777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x100aef => { let v = Some(com::Reference::read(r)?); r.set(&mut e4, v.map(Box::new), 2799); }
0x100b38 => { let v = r.string()?; r.set(&mut e5, v, 2872); }
0x100674 => { let v = Action::read(r)?; e6.extend(v); }
0x100aec => { let v = Some(ResponseType::read(r)?); r.set(&mut e7, v.map(Box::new), 2796); }
0x10067b => { let v = Some(ActivationConditions::read(r)?); r.set(&mut e8, v.map(Box::new), 1659); }
0x1004ec => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1260); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3150);
r.required(&e3, 1911);
r.required(&e4, 2799);
let v = Self {
id: a0,
version: a1,
version_time: e0,
measure_extension: e1,
external_identification: e2,
description: e3,
responsible_road_operator: e4,
short_name: e5,
action: e6,
response_type: e7,
activation_conditions: e8,
measure_definition_extension: e9,
};
r.close();
Ok(v)
}
}
impl MeasureDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.measure_extension { w.extension("tmp:_measureExtension", v)?; }
if let Some(v) = &self.external_identification { w.max_len("externalIdentification", v, 1024)?; w.leaf("tmp:externalIdentification", v)?; }
match &self.description {
Some(v) => { w.multilingual("tmp:description", v)?; }
None => return Err(w.missing("tmp:description")),
}
match &self.responsible_road_operator {
Some(v) => { v.write(w, "tmp:responsibleRoadOperator", "", " targetClass=\"fac:Organisation\"")?; }
None => return Err(w.missing("tmp:responsibleRoadOperator")),
}
if let Some(v) = &self.short_name { w.max_len("shortName", v, 1024)?; w.leaf("tmp:shortName", v)?; }
w.count("tmp:action", self.action.len(), 1, usize::MAX)?;
for v in &self.action { v.write(w, "tmp:action")?; }
if let Some(v) = &self.response_type { v.write(w, "tmp:responseType", "", "")?; }
if let Some(v) = &self.activation_conditions { v.write(w, "tmp:activationConditions", "", "")?; }
if let Some(v) = &self.measure_definition_extension { w.extension("tmp:_measureDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct NonPredefinedAction {
pub non_predefined_action_description: Option<MultilingualString>,
pub non_predefined_action_id: Option<String>,
pub action_implementing_situation_record: Option<Box<com::VersionedReference>>,
pub international_identifier: Option<Box<com::InternationalIdentifier>>,
pub operator_action_definition: Option<OperatorActionDefinition>,
pub non_predefined_action_extension: Option<Box<Extension>>,
}
impl NonPredefinedAction {
const FIELDS: &'static [u32] = &[0x100960, 0x100961, 0x100676, 0x100890, 0x1009d3, 0x100500];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10011b);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100960 => { let v = r.multilingual()?; r.set(&mut e0, v, 2400); }
0x100961 => { let v = r.string()?; r.set(&mut e1, v, 2401); }
0x100676 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 1654); }
0x100890 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2192); }
0x1009d3 => { let v = OperatorActionDefinition::read(r)?; r.set(&mut e4, v, 2515); }
0x100500 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1280); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2400);
r.required(&e3, 2192);
let v = Self {
non_predefined_action_description: e0,
non_predefined_action_id: e1,
action_implementing_situation_record: e2,
international_identifier: e3,
operator_action_definition: e4,
non_predefined_action_extension: e5,
};
r.close();
Ok(v)
}
}
impl NonPredefinedAction {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.non_predefined_action_description {
Some(v) => { w.multilingual("tmp:nonPredefinedActionDescription", v)?; }
None => return Err(w.missing("tmp:nonPredefinedActionDescription")),
}
if let Some(v) = &self.non_predefined_action_id { w.max_len("nonPredefinedActionId", v, 1024)?; w.leaf("tmp:nonPredefinedActionId", v)?; }
if let Some(v) = &self.action_implementing_situation_record { v.write(w, "tmp:actionImplementingSituationRecord", "", " targetClass=\"sit:SituationRecord\"")?; }
match &self.international_identifier {
Some(v) => { v.write(w, "tmp:internationalIdentifier", "", "")?; }
None => return Err(w.missing("tmp:internationalIdentifier")),
}
if let Some(v) = &self.operator_action_definition { v.write(w, "tmp:operatorActionDefinition")?; }
if let Some(v) = &self.non_predefined_action_extension { w.extension("tmp:_nonPredefinedActionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct NonPredefinedTmplanOperation {
pub id: Option<String>,
pub version: Option<String>,
pub creation_time: Option<DateTime>,
pub expiry_time: Option<DateTime>,
pub status: Option<TmplanOperationStatusEnum>,
pub status_reason: Option<MultilingualString>,
pub version_time: Option<DateTime>,
pub involved_road_operator_consensus_rate: Option<com::Percentage>,
pub header_information: Option<Box<com::HeaderInformation>>,
pub tmplan_operation_extension: Option<Box<Extension>>,
pub non_predefined_scenario_description: Option<MultilingualString>,
pub non_predefined_scenario_id: Option<String>,
pub non_predefined_strategy_description: Option<MultilingualString>,
pub non_predefined_strategy_id: Option<String>,
pub non_predefined_action: Vec<NonPredefinedAction>,
pub non_predefined_tmplan_operation_extension: Option<Box<Extension>>,
}
impl NonPredefinedTmplanOperation {
const FIELDS: &'static [u32] = &[0x10074d, 0x1007fd, 0x100b73, 0x100b79, 0x100c4e, 0x100894, 0x100857, 0x1005f9, 0x100963, 0x100964, 0x100965, 0x100966, 0x10095f, 0x100502];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10011d);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = Vec::new();
let mut e13 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10074d => { let v = r.date_time()?; r.set(&mut e0, v, 1869); }
0x1007fd => { let v = r.date_time()?; r.set(&mut e1, v, 2045); }
0x100b73 => { let v = r.enumeration::<TmplanOperationStatusEnum>()?; r.set(&mut e2, v, 2931); }
0x100b79 => { let v = r.multilingual()?; r.set(&mut e3, v, 2937); }
0x100c4e => { let v = r.date_time()?; r.set(&mut e4, v, 3150); }
0x100894 => { let v = r.value::<f32>()?; r.set(&mut e5, v, 2196); }
0x100857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e6, v.map(Box::new), 2135); }
0x1005f9 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1529); }
0x100963 => { let v = r.multilingual()?; r.set(&mut e8, v, 2403); }
0x100964 => { let v = r.string()?; r.set(&mut e9, v, 2404); }
0x100965 => { let v = r.multilingual()?; r.set(&mut e10, v, 2405); }
0x100966 => { let v = r.string()?; r.set(&mut e11, v, 2406); }
0x10095f => { let v = Some(NonPredefinedAction::read(r)?); e12.extend(v); }
0x100502 => { let v = r.raw()?; r.set(&mut e13, v.map(Box::new), 1282); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1869);
r.required(&e2, 2931);
r.required(&e4, 3150);
r.required(&e6, 2135);
r.required(&e8, 2403);
r.required(&e10, 2405);
let v = Self {
id: a0,
version: a1,
creation_time: e0,
expiry_time: e1,
status: e2,
status_reason: e3,
version_time: e4,
involved_road_operator_consensus_rate: e5,
header_information: e6,
tmplan_operation_extension: e7,
non_predefined_scenario_description: e8,
non_predefined_scenario_id: e9,
non_predefined_strategy_description: e10,
non_predefined_strategy_id: e11,
non_predefined_action: e12,
non_predefined_tmplan_operation_extension: e13,
};
r.close();
Ok(v)
}
}
impl NonPredefinedTmplanOperation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
match &self.creation_time {
Some(v) => { w.leaf("tmp:creationTime", v)?; }
None => return Err(w.missing("tmp:creationTime")),
}
if let Some(v) = &self.expiry_time { w.leaf("tmp:expiryTime", v)?; }
match &self.status {
Some(v) => { w.enumeration("tmp:status", v.literal())?; }
None => return Err(w.missing("tmp:status")),
}
if let Some(v) = &self.status_reason { w.multilingual("tmp:statusReason", v)?; }
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.involved_road_operator_consensus_rate { w.leaf("tmp:involvedRoadOperatorConsensusRate", v)?; }
match &self.header_information {
Some(v) => { v.write(w, "tmp:headerInformation", "", "")?; }
None => return Err(w.missing("tmp:headerInformation")),
}
if let Some(v) = &self.tmplan_operation_extension { w.extension("tmp:_tmplanOperationExtension", v)?; }
match &self.non_predefined_scenario_description {
Some(v) => { w.multilingual("tmp:nonPredefinedScenarioDescription", v)?; }
None => return Err(w.missing("tmp:nonPredefinedScenarioDescription")),
}
if let Some(v) = &self.non_predefined_scenario_id { w.max_len("nonPredefinedScenarioId", v, 1024)?; w.leaf("tmp:nonPredefinedScenarioId", v)?; }
match &self.non_predefined_strategy_description {
Some(v) => { w.multilingual("tmp:nonPredefinedStrategyDescription", v)?; }
None => return Err(w.missing("tmp:nonPredefinedStrategyDescription")),
}
if let Some(v) = &self.non_predefined_strategy_id { w.max_len("nonPredefinedStrategyId", v, 1024)?; w.leaf("tmp:nonPredefinedStrategyId", v)?; }
w.count("tmp:nonPredefinedAction", self.non_predefined_action.len(), 1, usize::MAX)?;
for v in &self.non_predefined_action { v.write(w, "tmp:nonPredefinedAction", "", "")?; }
if let Some(v) = &self.non_predefined_tmplan_operation_extension { w.extension("tmp:_nonPredefinedTmplanOperationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OperatorActionExtendedTmplan {
pub tmplan_implementing_action: Option<Box<TmplanImplementingAction>>,
}
impl OperatorActionExtendedTmplan {
const FIELDS: &'static [u32] = &[0x100bc0];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10014f);
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100bc0 => { let v = Some(TmplanImplementingAction::read(r)?); r.set(&mut e0, v.map(Box::new), 3008); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
tmplan_implementing_action: e0,
};
r.close();
Ok(v)
}
}
impl OperatorActionExtendedTmplan {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.tmplan_implementing_action { v.write(w, "tmp:tmplanImplementingAction", "", "")?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PredefinedAction {
pub action_implementing_situation_record: Option<Box<com::VersionedReference>>,
pub predefined_action_reference: Option<Box<com::VersionedReference>>,
pub predefined_action_extension: Option<Box<Extension>>,
}
impl PredefinedAction {
const FIELDS: &'static [u32] = &[0x100676, 0x100a5d, 0x10056d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10018a);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100676 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 1654); }
0x100a5d => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e1, v.map(Box::new), 2653); }
0x10056d => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1389); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2653);
let v = Self {
action_implementing_situation_record: e0,
predefined_action_reference: e1,
predefined_action_extension: e2,
};
r.close();
Ok(v)
}
}
impl PredefinedAction {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.action_implementing_situation_record { v.write(w, "tmp:actionImplementingSituationRecord", "", " targetClass=\"sit:SituationRecord\"")?; }
match &self.predefined_action_reference {
Some(v) => { v.write(w, "tmp:predefinedActionReference", "", " targetClass=\"tmp:ActionDefinition\"")?; }
None => return Err(w.missing("tmp:predefinedActionReference")),
}
if let Some(v) = &self.predefined_action_extension { w.extension("tmp:_predefinedActionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PredefinedMeasureSelected {
pub predefined_measure_reference: Option<Box<com::VersionedReference>>,
pub predefined_action: Vec<PredefinedAction>,
pub predefined_measure_selected_extension: Option<Box<Extension>>,
}
impl PredefinedMeasureSelected {
const FIELDS: &'static [u32] = &[0x100a68, 0x100a5c, 0x100576];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100193);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100a68 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2664); }
0x100a5c => { let v = Some(PredefinedAction::read(r)?); e1.extend(v); }
0x100576 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1398); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2664);
let v = Self {
predefined_measure_reference: e0,
predefined_action: e1,
predefined_measure_selected_extension: e2,
};
r.close();
Ok(v)
}
}
impl PredefinedMeasureSelected {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.predefined_measure_reference {
Some(v) => { v.write(w, "tmp:predefinedMeasureReference", "", " targetClass=\"tmp:MeasureDefinition\"")?; }
None => return Err(w.missing("tmp:predefinedMeasureReference")),
}
for v in &self.predefined_action { v.write(w, "tmp:predefinedAction", "", "")?; }
if let Some(v) = &self.predefined_measure_selected_extension { w.extension("tmp:_predefinedMeasureSelectedExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PredefinedTmplanOperation {
pub id: Option<String>,
pub version: Option<String>,
pub creation_time: Option<DateTime>,
pub expiry_time: Option<DateTime>,
pub status: Option<TmplanOperationStatusEnum>,
pub status_reason: Option<MultilingualString>,
pub version_time: Option<DateTime>,
pub involved_road_operator_consensus_rate: Option<com::Percentage>,
pub header_information: Option<Box<com::HeaderInformation>>,
pub tmplan_operation_extension: Option<Box<Extension>>,
pub tmplan_table_reference: Option<Box<com::VersionedReference>>,
pub predefined_scenario_reference: Option<Box<com::VersionedReference>>,
pub predefined_strategy_reference: Option<Box<com::VersionedReference>>,
pub predefined_measure_selected: Option<Box<PredefinedMeasureSelected>>,
pub problem_location_override: Option<loc::LocationReference>,
pub predefined_tmplan_operation_extension: Option<Box<Extension>>,
}
impl PredefinedTmplanOperation {
const FIELDS: &'static [u32] = &[0x10074d, 0x1007fd, 0x100b73, 0x100b79, 0x100c4e, 0x100894, 0x100857, 0x1005f9, 0x100bc3, 0x100a6a, 0x100a6b, 0x100a69, 0x100a7e, 0x100577];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100194);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x10074d => { let v = r.date_time()?; r.set(&mut e0, v, 1869); }
0x1007fd => { let v = r.date_time()?; r.set(&mut e1, v, 2045); }
0x100b73 => { let v = r.enumeration::<TmplanOperationStatusEnum>()?; r.set(&mut e2, v, 2931); }
0x100b79 => { let v = r.multilingual()?; r.set(&mut e3, v, 2937); }
0x100c4e => { let v = r.date_time()?; r.set(&mut e4, v, 3150); }
0x100894 => { let v = r.value::<f32>()?; r.set(&mut e5, v, 2196); }
0x100857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e6, v.map(Box::new), 2135); }
0x1005f9 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1529); }
0x100bc3 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e8, v.map(Box::new), 3011); }
0x100a6a => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e9, v.map(Box::new), 2666); }
0x100a6b => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e10, v.map(Box::new), 2667); }
0x100a69 => { let v = Some(PredefinedMeasureSelected::read(r)?); r.set(&mut e11, v.map(Box::new), 2665); }
0x100a7e => { let v = loc::LocationReference::read(r)?; r.set(&mut e12, v, 2686); }
0x100577 => { let v = r.raw()?; r.set(&mut e13, v.map(Box::new), 1399); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1869);
r.required(&e2, 2931);
r.required(&e4, 3150);
r.required(&e6, 2135);
r.required(&e8, 3011);
let v = Self {
id: a0,
version: a1,
creation_time: e0,
expiry_time: e1,
status: e2,
status_reason: e3,
version_time: e4,
involved_road_operator_consensus_rate: e5,
header_information: e6,
tmplan_operation_extension: e7,
tmplan_table_reference: e8,
predefined_scenario_reference: e9,
predefined_strategy_reference: e10,
predefined_measure_selected: e11,
problem_location_override: e12,
predefined_tmplan_operation_extension: e13,
};
r.close();
Ok(v)
}
}
impl PredefinedTmplanOperation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
match &self.creation_time {
Some(v) => { w.leaf("tmp:creationTime", v)?; }
None => return Err(w.missing("tmp:creationTime")),
}
if let Some(v) = &self.expiry_time { w.leaf("tmp:expiryTime", v)?; }
match &self.status {
Some(v) => { w.enumeration("tmp:status", v.literal())?; }
None => return Err(w.missing("tmp:status")),
}
if let Some(v) = &self.status_reason { w.multilingual("tmp:statusReason", v)?; }
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.involved_road_operator_consensus_rate { w.leaf("tmp:involvedRoadOperatorConsensusRate", v)?; }
match &self.header_information {
Some(v) => { v.write(w, "tmp:headerInformation", "", "")?; }
None => return Err(w.missing("tmp:headerInformation")),
}
if let Some(v) = &self.tmplan_operation_extension { w.extension("tmp:_tmplanOperationExtension", v)?; }
match &self.tmplan_table_reference {
Some(v) => { v.write(w, "tmp:tmplanTableReference", "", " targetClass=\"tmp:TmplanTable\"")?; }
None => return Err(w.missing("tmp:tmplanTableReference")),
}
if let Some(v) = &self.predefined_scenario_reference { v.write(w, "tmp:predefinedScenarioReference", "", " targetClass=\"tmp:Scenario\"")?; }
if let Some(v) = &self.predefined_strategy_reference { v.write(w, "tmp:predefinedStrategyReference", "", " targetClass=\"tmp:Strategy\"")?; }
if let Some(v) = &self.predefined_measure_selected { v.write(w, "tmp:predefinedMeasureSelected", "", "")?; }
if let Some(v) = &self.problem_location_override { v.write(w, "tmp:problemLocationOverride")?; }
if let Some(v) = &self.predefined_tmplan_operation_extension { w.extension("tmp:_predefinedTmplanOperationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ReroutingManagementDefinition {
pub target_location: Vec<loc::LocationReference>,
pub operator_action_definition_extension: Option<Box<Extension>>,
pub compliance_option: Option<sit::ComplianceOptionEnum>,
pub applicable_for_traffic_direction: Vec<loc::DirectionEnum>,
pub applicable_for_traffic_type: Vec<sit::TrafficTypeEnum>,
pub places_at_which_applicable: Vec<sit::PlacesEnum>,
pub automatically_initiated: Option<com::Boolean>,
pub for_vehicles_with_characteristics_of: Vec<com::VehicleCharacteristics>,
pub network_management_definition_extension: Option<Box<Extension>>,
pub name: Option<MultilingualString>,
pub r#type: Option<rer::ReroutingTypeEnum>,
pub binding_traffic_regulation: Option<com::Boolean>,
pub preventive_measure: Option<com::Boolean>,
pub routing_origin: Vec<loc::Location>,
pub routing_through: Vec<loc::Location>,
pub routing_destination: Vec<loc::Location>,
pub original_route: Option<Box<rer::RouteDescription>>,
pub alternative_route: Vec<rer::RouteDescription>,
pub rerouting_management_definition_extension: Option<Box<Extension>>,
}
impl ReroutingManagementDefinition {
const FIELDS: &'static [u32] = &[0x100b9e, 0x100532, 0x10072b, 0x1006c3, 0x1006c4, 0x100a41, 0x1006db, 0x100827, 0x1004fc, 0x100949, 0x100bfe, 0x1006f5, 0x100a71, 0x100b15, 0x100b16, 0x100b14, 0x1009e3, 0x1006b2, 0x10059b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001ba);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
let mut e13 = Vec::new();
let mut e14 = Vec::new();
let mut e15 = Vec::new();
let mut e16 = None;
let mut e17 = Vec::new();
let mut e18 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b9e => { let v = loc::LocationReference::read(r)?; e0.extend(v); }
0x100532 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1330); }
0x10072b => { let v = r.enumeration::<sit::ComplianceOptionEnum>()?; r.set(&mut e2, v, 1835); }
0x1006c3 => { let v = r.enumeration::<loc::DirectionEnum>()?; e3.extend(v); }
0x1006c4 => { let v = r.enumeration::<sit::TrafficTypeEnum>()?; e4.extend(v); }
0x100a41 => { let v = r.enumeration::<sit::PlacesEnum>()?; e5.extend(v); }
0x1006db => { let v = r.value::<bool>()?; r.set(&mut e6, v, 1755); }
0x100827 => { let v = Some(com::VehicleCharacteristics::read(r)?); e7.extend(v); }
0x1004fc => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1276); }
0x100949 => { let v = r.multilingual()?; r.set(&mut e9, v, 2377); }
0x100bfe => { let v = r.enumeration::<rer::ReroutingTypeEnum>()?; r.set(&mut e10, v, 3070); }
0x1006f5 => { let v = r.value::<bool>()?; r.set(&mut e11, v, 1781); }
0x100a71 => { let v = r.value::<bool>()?; r.set(&mut e12, v, 2673); }
0x100b15 => { let v = loc::Location::read(r)?; e13.extend(v); }
0x100b16 => { let v = loc::Location::read(r)?; e14.extend(v); }
0x100b14 => { let v = loc::Location::read(r)?; e15.extend(v); }
0x1009e3 => { let v = Some(rer::RouteDescription::read(r)?); r.set(&mut e16, v.map(Box::new), 2531); }
0x1006b2 => { let v = Some(rer::RouteDescription::read(r)?); e17.extend(v); }
0x10059b => { let v = r.raw()?; r.set(&mut e18, v.map(Box::new), 1435); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 1835);
let v = Self {
target_location: e0,
operator_action_definition_extension: e1,
compliance_option: e2,
applicable_for_traffic_direction: e3,
applicable_for_traffic_type: e4,
places_at_which_applicable: e5,
automatically_initiated: e6,
for_vehicles_with_characteristics_of: e7,
network_management_definition_extension: e8,
name: e9,
r#type: e10,
binding_traffic_regulation: e11,
preventive_measure: e12,
routing_origin: e13,
routing_through: e14,
routing_destination: e15,
original_route: e16,
alternative_route: e17,
rerouting_management_definition_extension: e18,
};
r.close();
Ok(v)
}
}
impl ReroutingManagementDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
for v in &self.target_location { v.write(w, "tmp:targetLocation")?; }
if let Some(v) = &self.operator_action_definition_extension { w.extension("tmp:_operatorActionDefinitionExtension", v)?; }
match &self.compliance_option {
Some(v) => { w.enumeration("tmp:complianceOption", v.literal())?; }
None => return Err(w.missing("tmp:complianceOption")),
}
for v in &self.applicable_for_traffic_direction { w.enumeration("tmp:applicableForTrafficDirection", v.literal())?; }
for v in &self.applicable_for_traffic_type { w.enumeration("tmp:applicableForTrafficType", v.literal())?; }
for v in &self.places_at_which_applicable { w.enumeration("tmp:placesAtWhichApplicable", v.literal())?; }
if let Some(v) = &self.automatically_initiated { w.leaf("tmp:automaticallyInitiated", v)?; }
for v in &self.for_vehicles_with_characteristics_of { v.write(w, "tmp:forVehiclesWithCharacteristicsOf", "", "")?; }
if let Some(v) = &self.network_management_definition_extension { w.extension("tmp:_networkManagementDefinitionExtension", v)?; }
if let Some(v) = &self.name { w.multilingual("tmp:name", v)?; }
if let Some(v) = &self.r#type { w.enumeration("tmp:type", v.literal())?; }
if let Some(v) = &self.binding_traffic_regulation { w.leaf("tmp:bindingTrafficRegulation", v)?; }
if let Some(v) = &self.preventive_measure { w.leaf("tmp:preventiveMeasure", v)?; }
for v in &self.routing_origin { v.write(w, "tmp:routingOrigin")?; }
for v in &self.routing_through { v.write(w, "tmp:routingThrough")?; }
for v in &self.routing_destination { v.write(w, "tmp:routingDestination")?; }
if let Some(v) = &self.original_route { v.write(w, "tmp:originalRoute", "", "")?; }
for v in &self.alternative_route { v.write(w, "tmp:alternativeRoute", "", "")?; }
if let Some(v) = &self.rerouting_management_definition_extension { w.extension("tmp:_reroutingManagementDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ResponseType {
pub effect: Option<ResponseEffectTypeEnum>,
pub stage: Option<ResponseStageEnum>,
pub response_type_extension: Option<Box<Extension>>,
}
impl ResponseType {
const FIELDS: &'static [u32] = &[0x1007b7, 0x100b69, 0x10059d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001bc);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x1007b7 => { let v = r.enumeration::<ResponseEffectTypeEnum>()?; r.set(&mut e0, v, 1975); }
0x100b69 => { let v = r.enumeration::<ResponseStageEnum>()?; r.set(&mut e1, v, 2921); }
0x10059d => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1437); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1975);
let v = Self {
effect: e0,
stage: e1,
response_type_extension: e2,
};
r.close();
Ok(v)
}
}
impl ResponseType {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.effect {
Some(v) => { w.enumeration("tmp:effect", v.literal())?; }
None => return Err(w.missing("tmp:effect")),
}
if let Some(v) = &self.stage { w.enumeration("tmp:stage", v.literal())?; }
if let Some(v) = &self.response_type_extension { w.extension("tmp:_responseTypeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RoadOrCarriagewayOrLaneManagementDefinition {
pub target_location: Vec<loc::LocationReference>,
pub operator_action_definition_extension: Option<Box<Extension>>,
pub compliance_option: Option<sit::ComplianceOptionEnum>,
pub applicable_for_traffic_direction: Vec<loc::DirectionEnum>,
pub applicable_for_traffic_type: Vec<sit::TrafficTypeEnum>,
pub places_at_which_applicable: Vec<sit::PlacesEnum>,
pub automatically_initiated: Option<com::Boolean>,
pub for_vehicles_with_characteristics_of: Vec<com::VehicleCharacteristics>,
pub network_management_definition_extension: Option<Box<Extension>>,
pub road_or_carriageway_or_lane_management_type: Option<sit::RoadOrCarriagewayOrLaneManagementTypeEnum>,
pub minimum_car_occupancy: Option<com::NonNegativeInteger>,
pub road_or_carriageway_or_lane_management_definition_extension: Option<Box<Extension>>,
}
impl RoadOrCarriagewayOrLaneManagementDefinition {
const FIELDS: &'static [u32] = &[0x100b9e, 0x100532, 0x10072b, 0x1006c3, 0x1006c4, 0x100a41, 0x1006db, 0x100827, 0x1004fc, 0x100afb, 0x100935, 0x1005a6];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001c6);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b9e => { let v = loc::LocationReference::read(r)?; e0.extend(v); }
0x100532 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1330); }
0x10072b => { let v = r.enumeration::<sit::ComplianceOptionEnum>()?; r.set(&mut e2, v, 1835); }
0x1006c3 => { let v = r.enumeration::<loc::DirectionEnum>()?; e3.extend(v); }
0x1006c4 => { let v = r.enumeration::<sit::TrafficTypeEnum>()?; e4.extend(v); }
0x100a41 => { let v = r.enumeration::<sit::PlacesEnum>()?; e5.extend(v); }
0x1006db => { let v = r.value::<bool>()?; r.set(&mut e6, v, 1755); }
0x100827 => { let v = Some(com::VehicleCharacteristics::read(r)?); e7.extend(v); }
0x1004fc => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1276); }
0x100afb => { let v = r.enumeration::<sit::RoadOrCarriagewayOrLaneManagementTypeEnum>()?; r.set(&mut e9, v, 2811); }
0x100935 => { let v = r.value::<u64>()?; r.set(&mut e10, v, 2357); }
0x1005a6 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1446); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 1835);
r.required(&e9, 2811);
let v = Self {
target_location: e0,
operator_action_definition_extension: e1,
compliance_option: e2,
applicable_for_traffic_direction: e3,
applicable_for_traffic_type: e4,
places_at_which_applicable: e5,
automatically_initiated: e6,
for_vehicles_with_characteristics_of: e7,
network_management_definition_extension: e8,
road_or_carriageway_or_lane_management_type: e9,
minimum_car_occupancy: e10,
road_or_carriageway_or_lane_management_definition_extension: e11,
};
r.close();
Ok(v)
}
}
impl RoadOrCarriagewayOrLaneManagementDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
for v in &self.target_location { v.write(w, "tmp:targetLocation")?; }
if let Some(v) = &self.operator_action_definition_extension { w.extension("tmp:_operatorActionDefinitionExtension", v)?; }
match &self.compliance_option {
Some(v) => { w.enumeration("tmp:complianceOption", v.literal())?; }
None => return Err(w.missing("tmp:complianceOption")),
}
for v in &self.applicable_for_traffic_direction { w.enumeration("tmp:applicableForTrafficDirection", v.literal())?; }
for v in &self.applicable_for_traffic_type { w.enumeration("tmp:applicableForTrafficType", v.literal())?; }
for v in &self.places_at_which_applicable { w.enumeration("tmp:placesAtWhichApplicable", v.literal())?; }
if let Some(v) = &self.automatically_initiated { w.leaf("tmp:automaticallyInitiated", v)?; }
for v in &self.for_vehicles_with_characteristics_of { v.write(w, "tmp:forVehiclesWithCharacteristicsOf", "", "")?; }
if let Some(v) = &self.network_management_definition_extension { w.extension("tmp:_networkManagementDefinitionExtension", v)?; }
match &self.road_or_carriageway_or_lane_management_type {
Some(v) => { w.enumeration("tmp:roadOrCarriagewayOrLaneManagementType", v.literal())?; }
None => return Err(w.missing("tmp:roadOrCarriagewayOrLaneManagementType")),
}
if let Some(v) = &self.minimum_car_occupancy { w.leaf("tmp:minimumCarOccupancy", v)?; }
if let Some(v) = &self.road_or_carriageway_or_lane_management_definition_extension { w.extension("tmp:_roadOrCarriagewayOrLaneManagementDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RoadsideAssistanceDefinition {
pub target_location: Vec<loc::LocationReference>,
pub operator_action_definition_extension: Option<Box<Extension>>,
pub roadside_assistance_type: Option<sit::RoadsideAssistanceTypeEnum>,
pub roadside_assistance_definition_extension: Option<Box<Extension>>,
}
impl RoadsideAssistanceDefinition {
const FIELDS: &'static [u32] = &[0x100b9e, 0x100532, 0x100b04, 0x1005ad];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001cd);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b9e => { let v = loc::LocationReference::read(r)?; e0.extend(v); }
0x100532 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1330); }
0x100b04 => { let v = r.enumeration::<sit::RoadsideAssistanceTypeEnum>()?; r.set(&mut e2, v, 2820); }
0x1005ad => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1453); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2820);
let v = Self {
target_location: e0,
operator_action_definition_extension: e1,
roadside_assistance_type: e2,
roadside_assistance_definition_extension: e3,
};
r.close();
Ok(v)
}
}
impl RoadsideAssistanceDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
for v in &self.target_location { v.write(w, "tmp:targetLocation")?; }
if let Some(v) = &self.operator_action_definition_extension { w.extension("tmp:_operatorActionDefinitionExtension", v)?; }
match &self.roadside_assistance_type {
Some(v) => { w.enumeration("tmp:roadsideAssistanceType", v.literal())?; }
None => return Err(w.missing("tmp:roadsideAssistanceType")),
}
if let Some(v) = &self.roadside_assistance_definition_extension { w.extension("tmp:_roadsideAssistanceDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Scenario {
pub id: Option<String>,
pub version: Option<String>,
pub external_identification: Option<String>,
pub version_time: Option<DateTime>,
pub description: Option<MultilingualString>,
pub situation_type: Vec<sit::CauseTypeEnum>,
pub emergency_services_accessibility: Option<MultilingualString>,
pub name: Option<String>,
pub scenario_director: Option<Box<com::Reference>>,
pub situation_filter: Vec<String>,
pub strategy: Vec<Strategy>,
pub impact_kind: Option<Box<ImpactKind>>,
pub problem_location: Option<loc::LocationReference>,
pub scheduled_scenario_validity: Option<Box<com::OverallPeriod>>,
pub situation_type_detail: Vec<sit::DetailedCauseType>,
pub scenario_extension: Option<Box<Extension>>,
}
impl Scenario {
const FIELDS: &'static [u32] = &[0x100804, 0x100c4e, 0x100777, 0x100b47, 0x1007bf, 0x100949, 0x100b1c, 0x100b3f, 0x100b80, 0x10087c, 0x100a7d, 0x100b1e, 0x100b48, 0x1005b4];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001d3);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = Vec::new();
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = Vec::new();
let mut e13 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100804 => { let v = r.string()?; r.set(&mut e0, v, 2052); }
0x100c4e => { let v = r.date_time()?; r.set(&mut e1, v, 3150); }
0x100777 => { let v = r.multilingual()?; r.set(&mut e2, v, 1911); }
0x100b47 => { let v = r.enumeration::<sit::CauseTypeEnum>()?; e3.extend(v); }
0x1007bf => { let v = r.multilingual()?; r.set(&mut e4, v, 1983); }
0x100949 => { let v = r.string()?; r.set(&mut e5, v, 2377); }
0x100b1c => { let v = Some(com::Reference::read(r)?); r.set(&mut e6, v.map(Box::new), 2844); }
0x100b3f => { let v = r.string()?; e7.extend(v); }
0x100b80 => { let v = Strategy::read(r)?; e8.extend(v); }
0x10087c => { let v = Some(ImpactKind::read(r)?); r.set(&mut e9, v.map(Box::new), 2172); }
0x100a7d => { let v = loc::LocationReference::read(r)?; r.set(&mut e10, v, 2685); }
0x100b1e => { let v = Some(com::OverallPeriod::read(r)?); r.set(&mut e11, v.map(Box::new), 2846); }
0x100b48 => { let v = Some(sit::DetailedCauseType::read(r)?); e12.extend(v); }
0x1005b4 => { let v = r.raw()?; r.set(&mut e13, v.map(Box::new), 1460); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 3150);
let v = Self {
id: a0,
version: a1,
external_identification: e0,
version_time: e1,
description: e2,
situation_type: e3,
emergency_services_accessibility: e4,
name: e5,
scenario_director: e6,
situation_filter: e7,
strategy: e8,
impact_kind: e9,
problem_location: e10,
scheduled_scenario_validity: e11,
situation_type_detail: e12,
scenario_extension: e13,
};
r.close();
Ok(v)
}
}
impl Scenario {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.external_identification { w.max_len("externalIdentification", v, 1024)?; w.leaf("tmp:externalIdentification", v)?; }
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.description { w.multilingual("tmp:description", v)?; }
for v in &self.situation_type { w.enumeration("tmp:situationType", v.literal())?; }
if let Some(v) = &self.emergency_services_accessibility { w.multilingual("tmp:emergencyServicesAccessibility", v)?; }
if let Some(v) = &self.name { w.max_len("name", v, 1024)?; w.leaf("tmp:name", v)?; }
if let Some(v) = &self.scenario_director { v.write(w, "tmp:scenarioDirector", "", " targetClass=\"fac:Organisation\"")?; }
for v in &self.situation_filter { w.max_len("situationFilter", v, 1024)?; w.leaf("tmp:situationFilter", v)?; }
for v in &self.strategy { v.write(w, "tmp:strategy")?; }
if let Some(v) = &self.impact_kind { v.write(w, "tmp:impactKind", "", "")?; }
if let Some(v) = &self.problem_location { v.write(w, "tmp:problemLocation")?; }
if let Some(v) = &self.scheduled_scenario_validity { v.write(w, "tmp:scheduledScenarioValidity", "", "")?; }
for v in &self.situation_type_detail { v.write(w, "tmp:situationTypeDetail", "", "")?; }
if let Some(v) = &self.scenario_extension { w.extension("tmp:_scenarioExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SignSetting {
pub sign_setting_definition: Option<Box<SignSettingDefinition>>,
}
impl SignSetting {
const FIELDS: &'static [u32] = &[0x100b3a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001d7);
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b3a => { let v = Some(SignSettingDefinition::read(r)?); r.set(&mut e0, v.map(Box::new), 2874); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2874);
let v = Self {
sign_setting_definition: e0,
};
r.close();
Ok(v)
}
}
impl SignSetting {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.sign_setting_definition {
Some(v) => { v.write(w, "tmp:signSettingDefinition", "", "")?; }
None => return Err(w.missing("tmp:signSettingDefinition")),
}
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SignSettingDefinition {
pub target_location: Vec<loc::LocationReference>,
pub operator_action_definition_extension: Option<Box<Extension>>,
pub compliance_option: Option<sit::ComplianceOptionEnum>,
pub applicable_for_traffic_direction: Vec<loc::DirectionEnum>,
pub applicable_for_traffic_type: Vec<sit::TrafficTypeEnum>,
pub places_at_which_applicable: Vec<sit::PlacesEnum>,
pub automatically_initiated: Option<com::Boolean>,
pub for_vehicles_with_characteristics_of: Vec<com::VehicleCharacteristics>,
pub network_management_definition_extension: Option<Box<Extension>>,
pub setting: Vec<vms::VmsControllerStatus>,
pub sign_setting_definition_extension: Option<Box<Extension>>,
}
impl SignSettingDefinition {
const FIELDS: &'static [u32] = &[0x100b9e, 0x100532, 0x10072b, 0x1006c3, 0x1006c4, 0x100a41, 0x1006db, 0x100827, 0x1004fc, 0x100b36, 0x1005b8];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001d8);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = Vec::new();
let mut e10 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b9e => { let v = loc::LocationReference::read(r)?; e0.extend(v); }
0x100532 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1330); }
0x10072b => { let v = r.enumeration::<sit::ComplianceOptionEnum>()?; r.set(&mut e2, v, 1835); }
0x1006c3 => { let v = r.enumeration::<loc::DirectionEnum>()?; e3.extend(v); }
0x1006c4 => { let v = r.enumeration::<sit::TrafficTypeEnum>()?; e4.extend(v); }
0x100a41 => { let v = r.enumeration::<sit::PlacesEnum>()?; e5.extend(v); }
0x1006db => { let v = r.value::<bool>()?; r.set(&mut e6, v, 1755); }
0x100827 => { let v = Some(com::VehicleCharacteristics::read(r)?); e7.extend(v); }
0x1004fc => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1276); }
0x100b36 => { let v = Some(vms::VmsControllerStatus::read(r)?); e9.extend(v); }
0x1005b8 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1464); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 1835);
let v = Self {
target_location: e0,
operator_action_definition_extension: e1,
compliance_option: e2,
applicable_for_traffic_direction: e3,
applicable_for_traffic_type: e4,
places_at_which_applicable: e5,
automatically_initiated: e6,
for_vehicles_with_characteristics_of: e7,
network_management_definition_extension: e8,
setting: e9,
sign_setting_definition_extension: e10,
};
r.close();
Ok(v)
}
}
impl SignSettingDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
for v in &self.target_location { v.write(w, "tmp:targetLocation")?; }
if let Some(v) = &self.operator_action_definition_extension { w.extension("tmp:_operatorActionDefinitionExtension", v)?; }
match &self.compliance_option {
Some(v) => { w.enumeration("tmp:complianceOption", v.literal())?; }
None => return Err(w.missing("tmp:complianceOption")),
}
for v in &self.applicable_for_traffic_direction { w.enumeration("tmp:applicableForTrafficDirection", v.literal())?; }
for v in &self.applicable_for_traffic_type { w.enumeration("tmp:applicableForTrafficType", v.literal())?; }
for v in &self.places_at_which_applicable { w.enumeration("tmp:placesAtWhichApplicable", v.literal())?; }
if let Some(v) = &self.automatically_initiated { w.leaf("tmp:automaticallyInitiated", v)?; }
for v in &self.for_vehicles_with_characteristics_of { v.write(w, "tmp:forVehiclesWithCharacteristicsOf", "", "")?; }
if let Some(v) = &self.network_management_definition_extension { w.extension("tmp:_networkManagementDefinitionExtension", v)?; }
for v in &self.setting { v.write(w, "tmp:setting", "", "")?; }
if let Some(v) = &self.sign_setting_definition_extension { w.extension("tmp:_signSettingDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SpeedManagementDefinition {
pub target_location: Vec<loc::LocationReference>,
pub operator_action_definition_extension: Option<Box<Extension>>,
pub compliance_option: Option<sit::ComplianceOptionEnum>,
pub applicable_for_traffic_direction: Vec<loc::DirectionEnum>,
pub applicable_for_traffic_type: Vec<sit::TrafficTypeEnum>,
pub places_at_which_applicable: Vec<sit::PlacesEnum>,
pub automatically_initiated: Option<com::Boolean>,
pub for_vehicles_with_characteristics_of: Vec<com::VehicleCharacteristics>,
pub network_management_definition_extension: Option<Box<Extension>>,
pub speed_management_type: Option<sit::SpeedManagementTypeEnum>,
pub temporary_speed_limit: Option<com::KilometresPerHour>,
pub speed_management_definition_extension: Option<Box<Extension>>,
}
impl SpeedManagementDefinition {
const FIELDS: &'static [u32] = &[0x100b9e, 0x100532, 0x10072b, 0x1006c3, 0x1006c4, 0x100a41, 0x1006db, 0x100827, 0x1004fc, 0x100b64, 0x100bab, 0x1005c9];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001ea);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b9e => { let v = loc::LocationReference::read(r)?; e0.extend(v); }
0x100532 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1330); }
0x10072b => { let v = r.enumeration::<sit::ComplianceOptionEnum>()?; r.set(&mut e2, v, 1835); }
0x1006c3 => { let v = r.enumeration::<loc::DirectionEnum>()?; e3.extend(v); }
0x1006c4 => { let v = r.enumeration::<sit::TrafficTypeEnum>()?; e4.extend(v); }
0x100a41 => { let v = r.enumeration::<sit::PlacesEnum>()?; e5.extend(v); }
0x1006db => { let v = r.value::<bool>()?; r.set(&mut e6, v, 1755); }
0x100827 => { let v = Some(com::VehicleCharacteristics::read(r)?); e7.extend(v); }
0x1004fc => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1276); }
0x100b64 => { let v = r.enumeration::<sit::SpeedManagementTypeEnum>()?; r.set(&mut e9, v, 2916); }
0x100bab => { let v = r.value::<f32>()?; r.set(&mut e10, v, 2987); }
0x1005c9 => { let v = r.raw()?; r.set(&mut e11, v.map(Box::new), 1481); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 1835);
r.required(&e9, 2916);
let v = Self {
target_location: e0,
operator_action_definition_extension: e1,
compliance_option: e2,
applicable_for_traffic_direction: e3,
applicable_for_traffic_type: e4,
places_at_which_applicable: e5,
automatically_initiated: e6,
for_vehicles_with_characteristics_of: e7,
network_management_definition_extension: e8,
speed_management_type: e9,
temporary_speed_limit: e10,
speed_management_definition_extension: e11,
};
r.close();
Ok(v)
}
}
impl SpeedManagementDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
for v in &self.target_location { v.write(w, "tmp:targetLocation")?; }
if let Some(v) = &self.operator_action_definition_extension { w.extension("tmp:_operatorActionDefinitionExtension", v)?; }
match &self.compliance_option {
Some(v) => { w.enumeration("tmp:complianceOption", v.literal())?; }
None => return Err(w.missing("tmp:complianceOption")),
}
for v in &self.applicable_for_traffic_direction { w.enumeration("tmp:applicableForTrafficDirection", v.literal())?; }
for v in &self.applicable_for_traffic_type { w.enumeration("tmp:applicableForTrafficType", v.literal())?; }
for v in &self.places_at_which_applicable { w.enumeration("tmp:placesAtWhichApplicable", v.literal())?; }
if let Some(v) = &self.automatically_initiated { w.leaf("tmp:automaticallyInitiated", v)?; }
for v in &self.for_vehicles_with_characteristics_of { v.write(w, "tmp:forVehiclesWithCharacteristicsOf", "", "")?; }
if let Some(v) = &self.network_management_definition_extension { w.extension("tmp:_networkManagementDefinitionExtension", v)?; }
match &self.speed_management_type {
Some(v) => { w.enumeration("tmp:speedManagementType", v.literal())?; }
None => return Err(w.missing("tmp:speedManagementType")),
}
if let Some(v) = &self.temporary_speed_limit { w.leaf("tmp:temporarySpeedLimit", v)?; }
if let Some(v) = &self.speed_management_definition_extension { w.extension("tmp:_speedManagementDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct StrategyByReference {
pub version_time: Option<DateTime>,
pub strategy_extension: Option<Box<Extension>>,
pub strategy_reference: Option<Box<com::VersionedReference>>,
pub strategy_by_reference_extension: Option<Box<Extension>>,
}
impl StrategyByReference {
const FIELDS: &'static [u32] = &[0x100c4e, 0x1005d7, 0x100b82, 0x1005d5];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001f6);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100c4e => { let v = r.date_time()?; r.set(&mut e0, v, 3150); }
0x1005d7 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1495); }
0x100b82 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 2946); }
0x1005d5 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1493); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3150);
r.required(&e2, 2946);
let v = Self {
version_time: e0,
strategy_extension: e1,
strategy_reference: e2,
strategy_by_reference_extension: e3,
};
r.close();
Ok(v)
}
}
impl StrategyByReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.strategy_extension { w.extension("tmp:_strategyExtension", v)?; }
match &self.strategy_reference {
Some(v) => { v.write(w, "tmp:strategyReference", "", " targetClass=\"tmp:StrategyDefinition\"")?; }
None => return Err(w.missing("tmp:strategyReference")),
}
if let Some(v) = &self.strategy_by_reference_extension { w.extension("tmp:_strategyByReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct StrategyDefinition {
pub id: Option<String>,
pub version: Option<String>,
pub version_time: Option<DateTime>,
pub strategy_extension: Option<Box<Extension>>,
pub external_identification: Option<String>,
pub description: Option<MultilingualString>,
pub short_name: Option<String>,
pub priority: Option<com::Integer>,
pub strategy_measure: Vec<StrategyMeasure>,
pub response_type: Option<Box<ResponseType>>,
pub overall_activation: Option<Box<ActivationConditions>>,
pub strategy_definition_extension: Option<Box<Extension>>,
}
impl StrategyDefinition {
const FIELDS: &'static [u32] = &[0x100c4e, 0x1005d7, 0x100804, 0x100777, 0x100b38, 0x100a78, 0x100b81, 0x100aec, 0x1009ef, 0x1005d6];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001f7);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100c4e => { let v = r.date_time()?; r.set(&mut e0, v, 3150); }
0x1005d7 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1495); }
0x100804 => { let v = r.string()?; r.set(&mut e2, v, 2052); }
0x100777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x100b38 => { let v = r.string()?; r.set(&mut e4, v, 2872); }
0x100a78 => { let v = r.value::<i64>()?; r.set(&mut e5, v, 2680); }
0x100b81 => { let v = Some(StrategyMeasure::read(r)?); e6.extend(v); }
0x100aec => { let v = Some(ResponseType::read(r)?); r.set(&mut e7, v.map(Box::new), 2796); }
0x1009ef => { let v = Some(ActivationConditions::read(r)?); r.set(&mut e8, v.map(Box::new), 2543); }
0x1005d6 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1494); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3150);
r.required(&e3, 1911);
let v = Self {
id: a0,
version: a1,
version_time: e0,
strategy_extension: e1,
external_identification: e2,
description: e3,
short_name: e4,
priority: e5,
strategy_measure: e6,
response_type: e7,
overall_activation: e8,
strategy_definition_extension: e9,
};
r.close();
Ok(v)
}
}
impl StrategyDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.strategy_extension { w.extension("tmp:_strategyExtension", v)?; }
if let Some(v) = &self.external_identification { w.max_len("externalIdentification", v, 1024)?; w.leaf("tmp:externalIdentification", v)?; }
match &self.description {
Some(v) => { w.multilingual("tmp:description", v)?; }
None => return Err(w.missing("tmp:description")),
}
if let Some(v) = &self.short_name { w.max_len("shortName", v, 1024)?; w.leaf("tmp:shortName", v)?; }
if let Some(v) = &self.priority { w.leaf("tmp:priority", v)?; }
w.count("tmp:strategyMeasure", self.strategy_measure.len(), 1, usize::MAX)?;
for v in &self.strategy_measure { v.write(w, "tmp:strategyMeasure", "", "")?; }
if let Some(v) = &self.response_type { v.write(w, "tmp:responseType", "", "")?; }
if let Some(v) = &self.overall_activation { v.write(w, "tmp:overallActivation", "", "")?; }
if let Some(v) = &self.strategy_definition_extension { w.extension("tmp:_strategyDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct StrategyMeasure {
pub processing_index: Option<com::Integer>,
pub essential_for_strategy: Option<com::Boolean>,
pub activation_conditions: Option<Box<ActivationConditions>>,
pub measure: Option<Measure>,
pub strategy_measure_extension: Option<Box<Extension>>,
}
impl StrategyMeasure {
const FIELDS: &'static [u32] = &[0x100a80, 0x1007eb, 0x10067b, 0x100913, 0x1005d8];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x1001f8);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100a80 => { let v = r.value::<i64>()?; r.set(&mut e0, v, 2688); }
0x1007eb => { let v = r.value::<bool>()?; r.set(&mut e1, v, 2027); }
0x10067b => { let v = Some(ActivationConditions::read(r)?); r.set(&mut e2, v.map(Box::new), 1659); }
0x100913 => { let v = Measure::read(r)?; r.set(&mut e3, v, 2323); }
0x1005d8 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1496); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 2323);
let v = Self {
processing_index: e0,
essential_for_strategy: e1,
activation_conditions: e2,
measure: e3,
strategy_measure_extension: e4,
};
r.close();
Ok(v)
}
}
impl StrategyMeasure {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.processing_index { w.leaf("tmp:processingIndex", v)?; }
if let Some(v) = &self.essential_for_strategy { w.leaf("tmp:essentialForStrategy", v)?; }
if let Some(v) = &self.activation_conditions { v.write(w, "tmp:activationConditions", "", "")?; }
match &self.measure {
Some(v) => { v.write(w, "tmp:measure")?; }
None => return Err(w.missing("tmp:measure")),
}
if let Some(v) = &self.strategy_measure_extension { w.extension("tmp:_strategyMeasureExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TmplanImplementingAction {
pub non_predefined_action_id_reference: Option<String>,
pub predefined_action_reference: Option<Box<com::VersionedReference>>,
pub predefined_measure_reference: Option<Box<com::VersionedReference>>,
pub predefined_strategy_reference: Option<Box<com::VersionedReference>>,
pub tmplan_implementing_action_extension: Option<Box<Extension>>,
}
impl TmplanImplementingAction {
const FIELDS: &'static [u32] = &[0x100962, 0x100a5d, 0x100a68, 0x100a6b, 0x1005f8];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10021a);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100962 => { let v = r.string()?; r.set(&mut e0, v, 2402); }
0x100a5d => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e1, v.map(Box::new), 2653); }
0x100a68 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 2664); }
0x100a6b => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e3, v.map(Box::new), 2667); }
0x1005f8 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1528); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
non_predefined_action_id_reference: e0,
predefined_action_reference: e1,
predefined_measure_reference: e2,
predefined_strategy_reference: e3,
tmplan_implementing_action_extension: e4,
};
r.close();
Ok(v)
}
}
impl TmplanImplementingAction {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.non_predefined_action_id_reference { w.max_len("nonPredefinedActionIdReference", v, 1024)?; w.leaf("tmp:nonPredefinedActionIdReference", v)?; }
if let Some(v) = &self.predefined_action_reference { v.write(w, "tmp:predefinedActionReference", "", " targetClass=\"tmp:ActionDefinition\"")?; }
if let Some(v) = &self.predefined_measure_reference { v.write(w, "tmp:predefinedMeasureReference", "", " targetClass=\"tmp:MeasureDefinition\"")?; }
if let Some(v) = &self.predefined_strategy_reference { v.write(w, "tmp:predefinedStrategyReference", "", " targetClass=\"tmp:StrategyDefinition\"")?; }
if let Some(v) = &self.tmplan_implementing_action_extension { w.extension("tmp:_tmplanImplementingActionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TmplanOperationPublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub tmplan_operation: Vec<TmplanOperation>,
pub tmplan_operation_publication_extension: Option<Box<Extension>>,
}
impl TmplanOperationPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x100bc1, 0x1005fa];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10021c);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0x100bc1 => { let v = TmplanOperation::read(r)?; e5.extend(v); }
0x1005fa => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1530); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
tmplan_operation: e5,
tmplan_operation_publication_extension: e6,
};
r.close();
Ok(v)
}
}
impl TmplanOperationPublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
w.count("tmp:tmplanOperation", self.tmplan_operation.len(), 1, usize::MAX)?;
for v in &self.tmplan_operation { v.write(w, "tmp:tmplanOperation")?; }
if let Some(v) = &self.tmplan_operation_publication_extension { w.extension("tmp:_tmplanOperationPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TmplanTable {
pub id: Option<String>,
pub version: Option<String>,
pub external_identification: Option<String>,
pub version_time: Option<DateTime>,
pub description: Option<MultilingualString>,
pub scenario: Vec<Scenario>,
pub measure: Vec<Measure>,
pub action: Vec<Action>,
pub tmplan_table_extension: Option<Box<Extension>>,
}
impl TmplanTable {
const FIELDS: &'static [u32] = &[0x100804, 0x100c4e, 0x100777, 0x100b1b, 0x100913, 0x100674, 0x1005fb];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10021d);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100804 => { let v = r.string()?; r.set(&mut e0, v, 2052); }
0x100c4e => { let v = r.date_time()?; r.set(&mut e1, v, 3150); }
0x100777 => { let v = r.multilingual()?; r.set(&mut e2, v, 1911); }
0x100b1b => { let v = Some(Scenario::read(r)?); e3.extend(v); }
0x100913 => { let v = Measure::read(r)?; e4.extend(v); }
0x100674 => { let v = Action::read(r)?; e5.extend(v); }
0x1005fb => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1531); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 3150);
let v = Self {
id: a0,
version: a1,
external_identification: e0,
version_time: e1,
description: e2,
scenario: e3,
measure: e4,
action: e5,
tmplan_table_extension: e6,
};
r.close();
Ok(v)
}
}
impl TmplanTable {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.external_identification { w.max_len("externalIdentification", v, 1024)?; w.leaf("tmp:externalIdentification", v)?; }
match &self.version_time {
Some(v) => { w.leaf("tmp:versionTime", v)?; }
None => return Err(w.missing("tmp:versionTime")),
}
if let Some(v) = &self.description { w.multilingual("tmp:description", v)?; }
for v in &self.scenario { v.write(w, "tmp:scenario", "", "")?; }
for v in &self.measure { v.write(w, "tmp:measure")?; }
for v in &self.action { v.write(w, "tmp:action")?; }
if let Some(v) = &self.tmplan_table_extension { w.extension("tmp:_tmplanTableExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TmplanTablePublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub header_information: Option<Box<com::HeaderInformation>>,
pub tmplan_table: Vec<TmplanTable>,
pub tmplan_table_publication_extension: Option<Box<Extension>>,
}
impl TmplanTablePublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0x100857, 0x100bc2, 0x1005fc];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x10021e);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0x100857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0x100bc2 => { let v = Some(TmplanTable::read(r)?); e6.extend(v); }
0x1005fc => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1532); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
r.required(&e5, 2135);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
header_information: e5,
tmplan_table: e6,
tmplan_table_publication_extension: e7,
};
r.close();
Ok(v)
}
}
impl TmplanTablePublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
match &self.header_information {
Some(v) => { v.write(w, "tmp:headerInformation", "", "")?; }
None => return Err(w.missing("tmp:headerInformation")),
}
w.count("tmp:tmplanTable", self.tmplan_table.len(), 1, usize::MAX)?;
for v in &self.tmplan_table { v.write(w, "tmp:tmplanTable", "", "")?; }
if let Some(v) = &self.tmplan_table_publication_extension { w.extension("tmp:_tmplanTablePublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TrafficSignalSettingDefinition {
pub target_location: Vec<loc::LocationReference>,
pub operator_action_definition_extension: Option<Box<Extension>>,
pub compliance_option: Option<sit::ComplianceOptionEnum>,
pub applicable_for_traffic_direction: Vec<loc::DirectionEnum>,
pub applicable_for_traffic_type: Vec<sit::TrafficTypeEnum>,
pub places_at_which_applicable: Vec<sit::PlacesEnum>,
pub automatically_initiated: Option<com::Boolean>,
pub for_vehicles_with_characteristics_of: Vec<com::VehicleCharacteristics>,
pub network_management_definition_extension: Option<Box<Extension>>,
pub setting: Option<String>,
pub traffic_signal_setting_definition_extension: Option<Box<Extension>>,
}
impl TrafficSignalSettingDefinition {
const FIELDS: &'static [u32] = &[0x100b9e, 0x100532, 0x10072b, 0x1006c3, 0x1006c4, 0x100a41, 0x1006db, 0x100827, 0x1004fc, 0x100b36, 0x10061e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100240);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b9e => { let v = loc::LocationReference::read(r)?; e0.extend(v); }
0x100532 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1330); }
0x10072b => { let v = r.enumeration::<sit::ComplianceOptionEnum>()?; r.set(&mut e2, v, 1835); }
0x1006c3 => { let v = r.enumeration::<loc::DirectionEnum>()?; e3.extend(v); }
0x1006c4 => { let v = r.enumeration::<sit::TrafficTypeEnum>()?; e4.extend(v); }
0x100a41 => { let v = r.enumeration::<sit::PlacesEnum>()?; e5.extend(v); }
0x1006db => { let v = r.value::<bool>()?; r.set(&mut e6, v, 1755); }
0x100827 => { let v = Some(com::VehicleCharacteristics::read(r)?); e7.extend(v); }
0x1004fc => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1276); }
0x100b36 => { let v = r.string()?; r.set(&mut e9, v, 2870); }
0x10061e => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1566); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 1835);
r.required(&e9, 2870);
let v = Self {
target_location: e0,
operator_action_definition_extension: e1,
compliance_option: e2,
applicable_for_traffic_direction: e3,
applicable_for_traffic_type: e4,
places_at_which_applicable: e5,
automatically_initiated: e6,
for_vehicles_with_characteristics_of: e7,
network_management_definition_extension: e8,
setting: e9,
traffic_signal_setting_definition_extension: e10,
};
r.close();
Ok(v)
}
}
impl TrafficSignalSettingDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
for v in &self.target_location { v.write(w, "tmp:targetLocation")?; }
if let Some(v) = &self.operator_action_definition_extension { w.extension("tmp:_operatorActionDefinitionExtension", v)?; }
match &self.compliance_option {
Some(v) => { w.enumeration("tmp:complianceOption", v.literal())?; }
None => return Err(w.missing("tmp:complianceOption")),
}
for v in &self.applicable_for_traffic_direction { w.enumeration("tmp:applicableForTrafficDirection", v.literal())?; }
for v in &self.applicable_for_traffic_type { w.enumeration("tmp:applicableForTrafficType", v.literal())?; }
for v in &self.places_at_which_applicable { w.enumeration("tmp:placesAtWhichApplicable", v.literal())?; }
if let Some(v) = &self.automatically_initiated { w.leaf("tmp:automaticallyInitiated", v)?; }
for v in &self.for_vehicles_with_characteristics_of { v.write(w, "tmp:forVehiclesWithCharacteristicsOf", "", "")?; }
if let Some(v) = &self.network_management_definition_extension { w.extension("tmp:_networkManagementDefinitionExtension", v)?; }
match &self.setting {
Some(v) => { w.max_len("setting", v, 1024)?; w.leaf("tmp:setting", v)?; }
None => return Err(w.missing("tmp:setting")),
}
if let Some(v) = &self.traffic_signal_setting_definition_extension { w.extension("tmp:_trafficSignalSettingDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TriggerCondition {
pub negate: Option<com::Boolean>,
pub condition_extension: Option<Box<Extension>>,
pub trigger_definition: Option<String>,
pub description: Option<MultilingualString>,
pub trigger_condition_extension: Option<Box<Extension>>,
}
impl TriggerCondition {
const FIELDS: &'static [u32] = &[0x100955, 0x100442, 0x100bf9, 0x100777, 0x100627];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100249);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100955 => { let v = r.value::<bool>()?; r.set(&mut e0, v, 2389); }
0x100442 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1090); }
0x100bf9 => { let v = r.string()?; r.set(&mut e2, v, 3065); }
0x100777 => { let v = r.multilingual()?; r.set(&mut e3, v, 1911); }
0x100627 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1575); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 3065);
let v = Self {
negate: e0,
condition_extension: e1,
trigger_definition: e2,
description: e3,
trigger_condition_extension: e4,
};
r.close();
Ok(v)
}
}
impl TriggerCondition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.negate { w.leaf("tmp:negate", v)?; }
if let Some(v) = &self.condition_extension { w.extension("tmp:_conditionExtension", v)?; }
match &self.trigger_definition {
Some(v) => { w.max_len("triggerDefinition", v, 1024)?; w.leaf("tmp:triggerDefinition", v)?; }
None => return Err(w.missing("tmp:triggerDefinition")),
}
if let Some(v) = &self.description { w.multilingual("tmp:description", v)?; }
if let Some(v) = &self.trigger_condition_extension { w.extension("tmp:_triggerConditionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct WinterDrivingManagementDefinition {
pub target_location: Vec<loc::LocationReference>,
pub operator_action_definition_extension: Option<Box<Extension>>,
pub compliance_option: Option<sit::ComplianceOptionEnum>,
pub applicable_for_traffic_direction: Vec<loc::DirectionEnum>,
pub applicable_for_traffic_type: Vec<sit::TrafficTypeEnum>,
pub places_at_which_applicable: Vec<sit::PlacesEnum>,
pub automatically_initiated: Option<com::Boolean>,
pub for_vehicles_with_characteristics_of: Vec<com::VehicleCharacteristics>,
pub network_management_definition_extension: Option<Box<Extension>>,
pub winter_equipment_management_type: Option<com::WinterEquipmentManagementTypeEnum>,
pub winter_driving_management_definition_extension: Option<Box<Extension>>,
}
impl WinterDrivingManagementDefinition {
const FIELDS: &'static [u32] = &[0x100b9e, 0x100532, 0x10072b, 0x1006c3, 0x1006c4, 0x100a41, 0x1006db, 0x100827, 0x1004fc, 0x100c7c, 0x100660];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0x100285);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x100b9e => { let v = loc::LocationReference::read(r)?; e0.extend(v); }
0x100532 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1330); }
0x10072b => { let v = r.enumeration::<sit::ComplianceOptionEnum>()?; r.set(&mut e2, v, 1835); }
0x1006c3 => { let v = r.enumeration::<loc::DirectionEnum>()?; e3.extend(v); }
0x1006c4 => { let v = r.enumeration::<sit::TrafficTypeEnum>()?; e4.extend(v); }
0x100a41 => { let v = r.enumeration::<sit::PlacesEnum>()?; e5.extend(v); }
0x1006db => { let v = r.value::<bool>()?; r.set(&mut e6, v, 1755); }
0x100827 => { let v = Some(com::VehicleCharacteristics::read(r)?); e7.extend(v); }
0x1004fc => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1276); }
0x100c7c => { let v = r.enumeration::<com::WinterEquipmentManagementTypeEnum>()?; r.set(&mut e9, v, 3196); }
0x100660 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1632); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 1835);
r.required(&e9, 3196);
let v = Self {
target_location: e0,
operator_action_definition_extension: e1,
compliance_option: e2,
applicable_for_traffic_direction: e3,
applicable_for_traffic_type: e4,
places_at_which_applicable: e5,
automatically_initiated: e6,
for_vehicles_with_characteristics_of: e7,
network_management_definition_extension: e8,
winter_equipment_management_type: e9,
winter_driving_management_definition_extension: e10,
};
r.close();
Ok(v)
}
}
impl WinterDrivingManagementDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
for v in &self.target_location { v.write(w, "tmp:targetLocation")?; }
if let Some(v) = &self.operator_action_definition_extension { w.extension("tmp:_operatorActionDefinitionExtension", v)?; }
match &self.compliance_option {
Some(v) => { w.enumeration("tmp:complianceOption", v.literal())?; }
None => return Err(w.missing("tmp:complianceOption")),
}
for v in &self.applicable_for_traffic_direction { w.enumeration("tmp:applicableForTrafficDirection", v.literal())?; }
for v in &self.applicable_for_traffic_type { w.enumeration("tmp:applicableForTrafficType", v.literal())?; }
for v in &self.places_at_which_applicable { w.enumeration("tmp:placesAtWhichApplicable", v.literal())?; }
if let Some(v) = &self.automatically_initiated { w.leaf("tmp:automaticallyInitiated", v)?; }
for v in &self.for_vehicles_with_characteristics_of { v.write(w, "tmp:forVehiclesWithCharacteristicsOf", "", "")?; }
if let Some(v) = &self.network_management_definition_extension { w.extension("tmp:_networkManagementDefinitionExtension", v)?; }
match &self.winter_equipment_management_type {
Some(v) => { w.enumeration("tmp:winterEquipmentManagementType", v.literal())?; }
None => return Err(w.missing("tmp:winterEquipmentManagementType")),
}
if let Some(v) = &self.winter_driving_management_definition_extension { w.extension("tmp:_winterDrivingManagementDefinitionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Action {
ActionByReference(Box<ActionByReference>),
ActionDefinition(Box<ActionDefinition>),
}
impl Action {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x10000c) => Self::ActionByReference(Box::new(ActionByReference::read(r)?)),
Some(0x10000d) => Self::ActionDefinition(Box::new(ActionDefinition::read(r)?)),
_ => {
r.unknown_type("Action")?;
return Ok(None);
}
}))
}
pub fn version_time(&self) -> Option<&DateTime> {
match self {
Self::ActionByReference(v) => v.version_time.as_ref(),
Self::ActionDefinition(v) => v.version_time.as_ref(),
}
}
pub fn action_extension(&self) -> Option<&Extension> {
match self {
Self::ActionByReference(v) => v.action_extension.as_deref(),
Self::ActionDefinition(v) => v.action_extension.as_deref(),
}
}
}
impl Action {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::ActionByReference(v) => v.write(w, tag, " xsi:type=\"tmp:ActionByReference\"", ""),
Self::ActionDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:ActionDefinition\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Condition {
ConditionSet(Box<ConditionSet>),
TriggerCondition(Box<TriggerCondition>),
}
impl Condition {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x100058) => Self::ConditionSet(Box::new(ConditionSet::read(r)?)),
Some(0x100249) => Self::TriggerCondition(Box::new(TriggerCondition::read(r)?)),
_ => {
r.unknown_type("Condition")?;
return Ok(None);
}
}))
}
pub fn negate(&self) -> Option<&com::Boolean> {
match self {
Self::ConditionSet(v) => v.negate.as_ref(),
Self::TriggerCondition(v) => v.negate.as_ref(),
}
}
pub fn condition_extension(&self) -> Option<&Extension> {
match self {
Self::ConditionSet(v) => v.condition_extension.as_deref(),
Self::TriggerCondition(v) => v.condition_extension.as_deref(),
}
}
}
impl Condition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::ConditionSet(v) => v.write(w, tag, " xsi:type=\"tmp:ConditionSet\"", ""),
Self::TriggerCondition(v) => v.write(w, tag, " xsi:type=\"tmp:TriggerCondition\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Measure {
CompositeMeasure(Box<CompositeMeasure>),
MeasureByReference(Box<MeasureByReference>),
MeasureDefinition(Box<MeasureDefinition>),
}
impl Measure {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x100053) => Self::CompositeMeasure(Box::new(CompositeMeasure::read(r)?)),
Some(0x100103) => Self::MeasureByReference(Box::new(MeasureByReference::read(r)?)),
Some(0x100104) => Self::MeasureDefinition(Box::new(MeasureDefinition::read(r)?)),
_ => {
r.unknown_type("Measure")?;
return Ok(None);
}
}))
}
pub fn version_time(&self) -> Option<&DateTime> {
match self {
Self::CompositeMeasure(v) => v.version_time.as_ref(),
Self::MeasureByReference(v) => v.version_time.as_ref(),
Self::MeasureDefinition(v) => v.version_time.as_ref(),
}
}
pub fn measure_extension(&self) -> Option<&Extension> {
match self {
Self::CompositeMeasure(v) => v.measure_extension.as_deref(),
Self::MeasureByReference(v) => v.measure_extension.as_deref(),
Self::MeasureDefinition(v) => v.measure_extension.as_deref(),
}
}
}
impl Measure {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::CompositeMeasure(v) => v.write(w, tag, " xsi:type=\"tmp:CompositeMeasure\"", ""),
Self::MeasureByReference(v) => v.write(w, tag, " xsi:type=\"tmp:MeasureByReference\"", ""),
Self::MeasureDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:MeasureDefinition\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum OperatorActionDefinition {
GeneralInstructionOrMessageToRoadUsersDefinition(Box<GeneralInstructionOrMessageToRoadUsersDefinition>),
GeneralNetworkManagementDefinition(Box<GeneralNetworkManagementDefinition>),
ReroutingManagementDefinition(Box<ReroutingManagementDefinition>),
RoadOrCarriagewayOrLaneManagementDefinition(Box<RoadOrCarriagewayOrLaneManagementDefinition>),
SignSettingDefinition(Box<SignSettingDefinition>),
SpeedManagementDefinition(Box<SpeedManagementDefinition>),
TrafficSignalSettingDefinition(Box<TrafficSignalSettingDefinition>),
WinterDrivingManagementDefinition(Box<WinterDrivingManagementDefinition>),
RoadsideAssistanceDefinition(Box<RoadsideAssistanceDefinition>),
}
impl OperatorActionDefinition {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x1000bd) => Self::GeneralInstructionOrMessageToRoadUsersDefinition(Box::new(GeneralInstructionOrMessageToRoadUsersDefinition::read(r)?)),
Some(0x1000bf) => Self::GeneralNetworkManagementDefinition(Box::new(GeneralNetworkManagementDefinition::read(r)?)),
Some(0x1001ba) => Self::ReroutingManagementDefinition(Box::new(ReroutingManagementDefinition::read(r)?)),
Some(0x1001c6) => Self::RoadOrCarriagewayOrLaneManagementDefinition(Box::new(RoadOrCarriagewayOrLaneManagementDefinition::read(r)?)),
Some(0x1001d8) => Self::SignSettingDefinition(Box::new(SignSettingDefinition::read(r)?)),
Some(0x1001ea) => Self::SpeedManagementDefinition(Box::new(SpeedManagementDefinition::read(r)?)),
Some(0x100240) => Self::TrafficSignalSettingDefinition(Box::new(TrafficSignalSettingDefinition::read(r)?)),
Some(0x100285) => Self::WinterDrivingManagementDefinition(Box::new(WinterDrivingManagementDefinition::read(r)?)),
Some(0x1001cd) => Self::RoadsideAssistanceDefinition(Box::new(RoadsideAssistanceDefinition::read(r)?)),
_ => {
r.unknown_type("OperatorActionDefinition")?;
return Ok(None);
}
}))
}
pub fn target_location(&self) -> &[loc::LocationReference] {
match self {
Self::GeneralInstructionOrMessageToRoadUsersDefinition(v) => &v.target_location,
Self::GeneralNetworkManagementDefinition(v) => &v.target_location,
Self::ReroutingManagementDefinition(v) => &v.target_location,
Self::RoadOrCarriagewayOrLaneManagementDefinition(v) => &v.target_location,
Self::SignSettingDefinition(v) => &v.target_location,
Self::SpeedManagementDefinition(v) => &v.target_location,
Self::TrafficSignalSettingDefinition(v) => &v.target_location,
Self::WinterDrivingManagementDefinition(v) => &v.target_location,
Self::RoadsideAssistanceDefinition(v) => &v.target_location,
}
}
pub fn operator_action_definition_extension(&self) -> Option<&Extension> {
match self {
Self::GeneralInstructionOrMessageToRoadUsersDefinition(v) => v.operator_action_definition_extension.as_deref(),
Self::GeneralNetworkManagementDefinition(v) => v.operator_action_definition_extension.as_deref(),
Self::ReroutingManagementDefinition(v) => v.operator_action_definition_extension.as_deref(),
Self::RoadOrCarriagewayOrLaneManagementDefinition(v) => v.operator_action_definition_extension.as_deref(),
Self::SignSettingDefinition(v) => v.operator_action_definition_extension.as_deref(),
Self::SpeedManagementDefinition(v) => v.operator_action_definition_extension.as_deref(),
Self::TrafficSignalSettingDefinition(v) => v.operator_action_definition_extension.as_deref(),
Self::WinterDrivingManagementDefinition(v) => v.operator_action_definition_extension.as_deref(),
Self::RoadsideAssistanceDefinition(v) => v.operator_action_definition_extension.as_deref(),
}
}
}
impl OperatorActionDefinition {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::GeneralInstructionOrMessageToRoadUsersDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:GeneralInstructionOrMessageToRoadUsersDefinition\"", ""),
Self::GeneralNetworkManagementDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:GeneralNetworkManagementDefinition\"", ""),
Self::ReroutingManagementDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:ReroutingManagementDefinition\"", ""),
Self::RoadOrCarriagewayOrLaneManagementDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:RoadOrCarriagewayOrLaneManagementDefinition\"", ""),
Self::SignSettingDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:SignSettingDefinition\"", ""),
Self::SpeedManagementDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:SpeedManagementDefinition\"", ""),
Self::TrafficSignalSettingDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:TrafficSignalSettingDefinition\"", ""),
Self::WinterDrivingManagementDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:WinterDrivingManagementDefinition\"", ""),
Self::RoadsideAssistanceDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:RoadsideAssistanceDefinition\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Strategy {
StrategyByReference(Box<StrategyByReference>),
StrategyDefinition(Box<StrategyDefinition>),
}
impl Strategy {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x1001f6) => Self::StrategyByReference(Box::new(StrategyByReference::read(r)?)),
Some(0x1001f7) => Self::StrategyDefinition(Box::new(StrategyDefinition::read(r)?)),
_ => {
r.unknown_type("Strategy")?;
return Ok(None);
}
}))
}
pub fn version_time(&self) -> Option<&DateTime> {
match self {
Self::StrategyByReference(v) => v.version_time.as_ref(),
Self::StrategyDefinition(v) => v.version_time.as_ref(),
}
}
pub fn strategy_extension(&self) -> Option<&Extension> {
match self {
Self::StrategyByReference(v) => v.strategy_extension.as_deref(),
Self::StrategyDefinition(v) => v.strategy_extension.as_deref(),
}
}
}
impl Strategy {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::StrategyByReference(v) => v.write(w, tag, " xsi:type=\"tmp:StrategyByReference\"", ""),
Self::StrategyDefinition(v) => v.write(w, tag, " xsi:type=\"tmp:StrategyDefinition\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum TmplanOperation {
NonPredefinedTmplanOperation(Box<NonPredefinedTmplanOperation>),
PredefinedTmplanOperation(Box<PredefinedTmplanOperation>),
}
impl TmplanOperation {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0x10011d) => Self::NonPredefinedTmplanOperation(Box::new(NonPredefinedTmplanOperation::read(r)?)),
Some(0x100194) => Self::PredefinedTmplanOperation(Box::new(PredefinedTmplanOperation::read(r)?)),
_ => {
r.unknown_type("TmplanOperation")?;
return Ok(None);
}
}))
}
pub fn id(&self) -> Option<&str> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.id.as_deref(),
Self::PredefinedTmplanOperation(v) => v.id.as_deref(),
}
}
pub fn version(&self) -> Option<&str> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.version.as_deref(),
Self::PredefinedTmplanOperation(v) => v.version.as_deref(),
}
}
pub fn creation_time(&self) -> Option<&DateTime> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.creation_time.as_ref(),
Self::PredefinedTmplanOperation(v) => v.creation_time.as_ref(),
}
}
pub fn expiry_time(&self) -> Option<&DateTime> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.expiry_time.as_ref(),
Self::PredefinedTmplanOperation(v) => v.expiry_time.as_ref(),
}
}
pub fn status(&self) -> Option<&TmplanOperationStatusEnum> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.status.as_ref(),
Self::PredefinedTmplanOperation(v) => v.status.as_ref(),
}
}
pub fn status_reason(&self) -> Option<&MultilingualString> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.status_reason.as_ref(),
Self::PredefinedTmplanOperation(v) => v.status_reason.as_ref(),
}
}
pub fn version_time(&self) -> Option<&DateTime> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.version_time.as_ref(),
Self::PredefinedTmplanOperation(v) => v.version_time.as_ref(),
}
}
pub fn involved_road_operator_consensus_rate(&self) -> Option<&com::Percentage> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.involved_road_operator_consensus_rate.as_ref(),
Self::PredefinedTmplanOperation(v) => v.involved_road_operator_consensus_rate.as_ref(),
}
}
pub fn header_information(&self) -> Option<&com::HeaderInformation> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.header_information.as_deref(),
Self::PredefinedTmplanOperation(v) => v.header_information.as_deref(),
}
}
pub fn tmplan_operation_extension(&self) -> Option<&Extension> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.tmplan_operation_extension.as_deref(),
Self::PredefinedTmplanOperation(v) => v.tmplan_operation_extension.as_deref(),
}
}
}
impl TmplanOperation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::NonPredefinedTmplanOperation(v) => v.write(w, tag, " xsi:type=\"tmp:NonPredefinedTmplanOperation\"", ""),
Self::PredefinedTmplanOperation(v) => v.write(w, tag, " xsi:type=\"tmp:PredefinedTmplanOperation\"", ""),
}
}
}