1#![allow(non_upper_case_globals)]
18#![allow(non_camel_case_types)]
19#![allow(non_snake_case)]
20
21use bitmask::bitmask;
22
23include!("generated.rs");
24
25pub mod dds_error;
26pub use dds_error::DDSError;
27
28pub const DDS_FREE_KEY_BIT: u32 = 0x01;
30pub const DDS_FREE_CONTENTS_BIT:u32 = 0x02;
31pub const DDS_FREE_ALL_BIT:u32 = 0x04;
32
33
34#[derive(Clone,PartialEq)]
35pub struct DdsEntity(dds_entity_t);
36
37impl DdsEntity {
38 pub unsafe fn new(entity: dds_entity_t) -> Self {
39 DdsEntity(entity)
40 }
41 pub unsafe fn entity(&self) -> dds_entity_t {
42 self.0
43 }
44}
45
46pub mod builtin_entity {
47 use crate::DdsEntity;
48 pub const BUILTIN_TOPIC_DCPSPARTICIPANT_ENTITY : DdsEntity = DdsEntity(crate::BUILTIN_TOPIC_DCPSPARTICIPANT);
49 pub const BUILTIN_TOPIC_DCPSTOPIC_ENTITY : DdsEntity = DdsEntity(crate::BUILTIN_TOPIC_DCPSTOPIC);
50 pub const BUILTIN_TOPIC_DCPSPUBLICATION_ENTITY : DdsEntity = DdsEntity(crate::BUILTIN_TOPIC_DCPSPUBLICATION);
51 pub const BUILTIN_TOPIC_DCPSSUBSCRIPTION : DdsEntity = DdsEntity(crate::BUILTIN_TOPIC_DCPSSUBSCRIPTION);
52}
53
54pub type DdsDomainId = dds_domainid_t;
55pub type DdsTopicDescriptor = dds_topic_descriptor_t;
56
57bitmask! {
58 pub mask StateMask : u32 where flags State {
59 DdsReadSampleState = 0x1,
60 DdsNotReadSampleState = 0x2,
61 DdsAnySampleState = 0x1 | 0x2,
62 DdsNewViewState = 0x4,
63 DdsNotNewViewState = 0x8,
64 DdsAnyViewState = 0x4 | 0x8,
65 DdsAliveInstanceState = 16,
66 DdsNotAliveDisposedInstanceState = 32,
67 DdsNotAliveNoWritersInstanceState = 64,
68 DdsAnyInstanceState = 16 | 32 | 64,
69 DdsAnyState = 1 | 2 | 4 | 8 | 16 | 32 | 64,
70 }
71}