rtps_parser/rtps/
endpoint.rs

1use super::{
2    entity::RtpsEntity,
3    types::{Guid, Locator, TopicKind},
4};
5
6pub struct RtpsEndpoint {
7    entity: RtpsEntity,
8    _topic_kind: TopicKind,
9    unicast_locator_list: Vec<Locator>,
10    multicast_locator_list: Vec<Locator>,
11}
12
13impl RtpsEndpoint {
14    pub fn new(
15        guid: Guid,
16        topic_kind: TopicKind,
17        unicast_locator_list: &[Locator],
18        multicast_locator_list: &[Locator],
19    ) -> Self {
20        Self {
21            entity: RtpsEntity::new(guid),
22            _topic_kind: topic_kind,
23            unicast_locator_list: unicast_locator_list.to_vec(),
24            multicast_locator_list: multicast_locator_list.to_vec(),
25        }
26    }
27}
28
29impl RtpsEndpoint {
30    pub fn guid(&self) -> Guid {
31        self.entity.guid()
32    }
33}
34
35impl RtpsEndpoint {
36    pub fn unicast_locator_list(&self) -> &[Locator] {
37        &self.unicast_locator_list
38    }
39
40    pub fn multicast_locator_list(&self) -> &[Locator] {
41        &self.multicast_locator_list
42    }
43}